Я создал div
, содержащий дочерние div. Предполагается, что дочерние divs имеют тот же background-color
, что и главный div (<div id="how-it-works">
), но он не работает, и я не уверен, почему.CSS: Не принимайте весь div
Любые предложения?
#how-it-works{
background-color: #eeeeee;
padding-top: 50px;
}
#how-it-works h3{
font-family: gill sans;
letter-spacing: 10px;
font-size: 20px;
font-weight: 500;
text-align: center;
padding-top: 0px;
padding-bottom: 10px; \t \t
}
#details-wrapper{
padding-top: 50px;
margin-left: 10px;
margin-right: 10px;
background-color: #eeeeee;
}
#feature-one{
width: 30%;
float: left;
margin-right: 30px;
}
#feature-one p {
font-family: times;
font-size: 14px;
font-weight: normal;
text-align: justify;
}
#feature-one img {
width: 100px;
height: 100px;
}
#feature-two{
width: 30%;
float: left;
margin-left: 20px;
}
#feature-two p{
font-family: times;
font-size: 14px;
font-weight: normal;
text-align: justify;
}
#feature-two img{
width: 100px;
height: 100px;
}
#feature-three{
width: 30%;
float: right;
margin-left: 10px;
}
#feature-three p {
font-family: times;
font-size: 14px;
font-weight: normal;
text-align: justify;
}
#feature-three img{
width: 100px;
height: 100px;
}
<div id="how-it-works">
<h3>TITLE</h3>
<p>Text.</p>
<div id="details-wrapper">
\t <div id="feature-one">
<img src="images/bild.jpg">
\t <h4>TITLE</h4>
\t <p>Text.</p>
</div>
\t <div id="feature-two">
\t <img src="images/bild.jpg">
\t <h4>TITLE</h4>
\t <p>Text.</p>
\t </div>
\t <div id="feature-three">
\t <img src="images/bild.jpg">
\t <h4>TITLE</h4>
\t <p>Text.</p>
\t </div>
</div>
</div>
переполнение: скрыто; to # how-it-works работает так же хорошо, и меньше кода –