CSS
CSS
Types in CSS :
1. Inline CSS
2. Internal CSS/Embedded CSS
3. External CSS
================================================================================
<p style="color:orange;">INDIA is GREAT COUNTRY..!!</p>
Here p - element/tag,
style - attribute,
color - property,
orange - value
=================================================================================
Inline CSS
<p style="color: orange;">INDIA is GREAT COUNTRY..!!</p>
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Document</title>
</head>
<body style="background-color: blanchedalmond;">
</p>
</body>
</html>
=================================================================================
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Document</title>
</head>
<body>
</div>
</body>
</html>
=================================================================================
Internal CSS/Embedded CSS :
In internal CSS we use the properties with help of selecters
=================================================================================
Tag
=================================================================================
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Document</title>
<style>
h2{color: red;}
</style>
</head>
<body>
<h2>Welcome to Pune</h2>
<h3>Today it Wednesday</h3>
</body>
</html>
=================================================================================
Group
=================================================================================
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Document</title>
<style>
</style>
</head>
<body>
<h2>Welcome to Pune</h2>
<h3>Today it Wednesday</h3>
<p>Hello All</p>
</body>
</html>
=================================================================================
ID
=================================================================================
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Document</title>
<style>
h2{color: brown;}
#a1{color: yellow;}
#a2{color: green;}
</style>
</head>
<body>
<style>
h2{color: brown;}
.a1{color:blue;}
.a2{color: green;}
</style>
</head>
<body>
</body>
</html>
=================================================================================
Universal
=================================================================================
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Document</title>
<style>
h2{color: brown;}
.a1{color:blue;}
.a2{color: green;}
*{font-family: cursive;font-style: italic;font-size: 100px;}
</style>
</head>
<body>
</body>
</html>
=================================================================================
External CSS
=================================================================================
Add ExternalCSS1.html
=================================================================================
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>External CSS1</title>
=================================================================================
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>External CSS2</title>
<link href="mystylesheet.css" rel="stylesheet">
</head>
<body class="ex2">
</body>
</html>
=================================================================================
Add mystylesheet.css
=================================================================================
h1{color: blue;}
#ex1{background-color: aqua;}
.ex2{background-color: yellow;}
=================================================================================
Login Page
=================================================================================
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Document</title>
<style>
body{
margin: 0;
padding: 0;
display: flex;
justify-content: center;
align-items: center;
height: 100vh;
background-image: url('Nature.jpg');
background-size: cover;
}
.container{
width: 300px;
padding: 20px;
border: 1px solid black;
background-color: aqua;
text-align: center;
}
input[type="text"],input[type="password"],
input[type="button"] {
width: 100%;
padding: 10px;
margin: 10px;
box-sizing: border-box;
border: 1px solid black;
border-radius: 5px;
}
input[type="button"]
{
background-color: brown;
color: white;
cursor: pointer;
}
input[type="button"]:hover{
background-color: blue;
}
</style>
</head>
<body>
<div class="container">
<h2>Login Page</h2>
<form>
<input type="text" placeholder="Username"><br/>
<input type="password" placeholder="password"><br/>
<input type="button" value="Login">
</form>
</div>
</body>
</html>
=================================================================================
=================================================================================
=================================================================================
=================================================================================
=================================================================================
=================================================================================
=================================================================================