<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Attribute and nth child pseudo selectors</title>
<style>
.container {
display: block;
width: 23px;
margin: auto;
}
input {
display: block;
}
input[type='text'] {
padding: 23px;
border: 2px solid red;
}
a[target] {
font-size: 44px;
color: violet;
}
}
a[target='_self'] {
font-size: 44px;
color: rgb(21, 17, 233);
}
input[type='email'] {
color: yellow;
border: 2px solid black;
}
/* This is apply css for third child */
/* li:nth-child(3){
color: cyan;
}
li:nth-child(2n+0){
color: rgb(207, 20, 13);
} */
/* Odd child */
/* li :nth-child(odd){
background-color: blueviolet;
} */
li :nth-child(even) {
background-color: aqua;
}
</style>
</head>
<body>
<div class="container">
<h1><a href="http://google.com" target="_blank">Go to google</a></h1>
<h1><a href="http://facebook.com" target="_self">Go to facebook</a></h1>
<form action="" class="form-control">
<input type="text" placeholder="Enter your name">
<input type="email" placeholder="Enter your email">
<input type="password" placeholder="Enter your password">
<input type="submit" value="submit">
</form>
<ul>
<li class="item" id="item-1">Item1</li>
<li class="item" id="item-2">Item2</li>
<li class="item" id="item-3">Item3</li>
<li class="item" id="item-4">Item4</li>
<li class="item" id="item-5">Item5</li>
</ul>
</div>
</body>
</html>
No comments:
Post a Comment