.class1 .class2 h2{
color: red;
}
Selects all <h2>
elements within .class2
that is a descendant of .class1
elementdiv p {
background-color: yellow;
}
Selects all <p>
elements inside <div>
elements<i style="display:block;clear:both"></i>
.clearfix::after {
content: "";
clear: both;
display: block;
}
Modern way of clearing floats.main-inner div
1. Subtract padding & border from width
https://youtu.be/qhiQGPtD1PQ?t=137
2. Add inner div with padding
https://youtu.be/_Ai-_nZ6bw4?t=269
3. Use box-sizing: border-box
property
https://codepen.io/Tandilashvili/pen/yLeJvLO#nav li {
list-style: none;
float: left;
padding: 0 15px 0 0;
}
#body {
background: url(../images/bg.jpg) top left repeat-y;
}
span
, a
).
Solution - display: inline-block;
or display: block;
#header h1 {
background: url(../images/bg.jpg) top left no-repeat;
width: 702px;
height: 100px;
text-indent: -9999px;
}