Welcome to the Treehouse Community

The Treehouse Community is a meeting place for developers, designers, and programmers of all backgrounds and skill levels to get support. Collaborate here on code errors or bugs that you need feedback on, or asking for an extra set of eyes on your latest project. Join thousands of Treehouse students and alumni in the community today. (Note: Only Treehouse students can comment or ask questions, but non-students are welcome to browse our conversations.)

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and a supportive community. Start your free trial today.

CSS

Background doesn't work....

Tried everything. Why is it not showing?

.wrapper {
    max-width:970px;
    margin: 0 auto;
}

.fields {
    background: #F7F7F7;
}

.block1 {
    float:right;
    max-width: 470px;
}

.block2 {
    float:left;
    max-width: 470px;
}
<!DOCTYPE HTML>

<html>
<head>
    <meta charset="utf-8">
    <title>Site</title>
    <link rel="stylesheet" href="css/normalize.css">
    <link rel="stylesheet" href="css/style2.css">
</head>

<body>
<div class ="wrapper">
<div class ="fields">
    <div class="block1">
        add a method called getTileCount that uses the for each loop you just learned to loop through the characters and increme
        </div>
    <div class="block2">
        А что будет, если плавающих блоков на странице несколько? Давайте добавим в нашу html-страницу еще один блок:
        </div>
</div>
</div>
</body>
</html>

2 Answers

made it small.... still doesn't work(

William Li
William Li
Courses Plus Student 26,867 Points

that's because inner div does NOT inherit background style from its parent div, and in your html, the field div basically contains nothing except the two inner divs, plus that in the CSS file, background is the only style it has, of course it's showing nothing.

Also, in your html, you need to wrap your paragraph in p tags.

How should i add it then? If i will add it separately there will be a gap in the middle

William Li
William Li
Courses Plus Student 26,867 Points

well, in this case, the quickest fix is:

.fields {
    background: #F7F7F7;
    overflow: hidden;
}
Emma Willmann
seal-mask
.a{fill-rule:evenodd;}techdegree seal-36
Emma Willmann
Treehouse Project Reviewer

In your html, remove the space after class. Should be:

<body>
<div class="wrapper">
<div class="fields">