Css Program
Css Program
TEXT Properties
<!DOCTYPE html>
<html>
<head>
<style>
.fontProperties
{
/* Font properties */
font-family: Arial, sans-serif;
font-size: 20px;
font-weight: bold;
font-style: italic;
text-decoration: underline;
text-transform: uppercase;
color: #333;
}
.textProperties
{
/* Text alignment */
text-align: center;
/* Text shadow */
text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.3);
/* Word spacing */
word-spacing: 5px;
}
</style>
</head>
<body>
<h1 class="textProperties">
This is a sample text demonstrating various font properties in CSS.</h1>
<h2 class="fontProperties">
This is the sample text demonstrating various text properties in CSS</h2>
</body>
</html>
<!DOCTYPE html>
<html>
<head>
<style>
/* CSS for box properties */
.box {
width: 300px;
height: 200px;
background-color: cyan;
border: 6px double blue;
border-radius: 10px;
padding: 20px;
margin: 20px;
box-shadow: 3px 3px 5px rgba(0, 0, 0, 0.3);
text-align: center;
font-family: Arial, sans-serif;
line-height: 1.6;
transition: transform 0.5s ease-in-out;
color:red
}
.box:hover {
transform: scale(1.05);
box-shadow: 5px 5px 8px rgba(0, 0, 0, 0.5);
}
h2 {
color: #333;
margin-bottom: 10px;
}
p{
color: #555;
}
</style>
</head>
<body>
<div class="box">
<h2>This is a Box</h2>
<p>It demonstrates various box properties.</p>
</div>
</body>
</html>
#hiddenText {
display: none;
margin-top: 10px;
padding: 15px;
background-color: #f1c40f;
color: #333;
border-radius: 5px;
}
ol.upper-roman {
list-style-type: upper-roman; /* Roman numerals (uppercase) for ordered list */
}
ol.lower-alpha {
list-style-type: lower-alpha; /* Lowercase alphabetical for ordered list */
}
ul.square {
list-style-type: square; /* Square bullet points for unordered list */
}
<label for="password">Password:</label><br>
<input type="password" id="password" name="password"><br><br>
<label for="email">Email:</label><br>
<input type="email" id="email" name="email"><br><br>
<label for="age">Age:</label><br>
<input type="number" id="age" name="age"><br><br>
<label for="gender">Gender:</label><br>
<input type="radio" id="male" name="gender" value="male">
<label for="male">Male</label>
<input type="radio" id="female" name="gender" value="female">
<label for="female">Female</label><br><br>
<label for="comments">Comments:</label><br>
<textarea id="comments" name="comments" rows="4"
cols="40"></textarea><br><br>
Pgm#6 image
<!DOCTYPE html>
<html>
<head>
<title>Background Image Example</title>
<style>
body {
background-image: url('images.jpg'); /* Replace with your image URL */
background-size: cover; /* Cover the entire background */
background-position: center; /* Center the background image */
background-repeat: no-repeat; /* Prevent image from repeating */
height: 100vh; /* Full viewport height */
margin: 0; /* Remove default margin */
display: flex;
justify-content: center;
align-items: center;
color: white;
font-family: Arial, sans-serif;
text-align: center;
}
.content {
background-color: rgba(0, 0, 0, 0.7); /* Semi-transparent background for
readability */
padding: 20px;
border-radius: 10px;
}
</style>
</head>
<body>
<div class="content">
<h1>Welcome to Background Image Example</h1>
<p>This is a demonstration of setting a background image using CSS
properties.</p>
</div>
</body>
</html>