Welcome to the Treehouse Community

Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.

Start your free trial

CSS CSS Transitions and Transforms Adding 3D Effects with CSS Activate 3D Space with perspective

Saqib Ali
Saqib Ali
3,686 Points

.content why does this div class exist within this page?

Within the index.html file the div class is present with an attribute of clearfix, I think understand why the clearfix, it's there so that the picture are separated from the header.

But is there any other reason why this is the parent div class of this section?

<div class="content clearfix">

            <div class="photo-container">
                <div class="photo">
                  <img class="side-a" src="img/photos/1.jpg" alt="Dazzling Auroras over Earth"> 
                  <div class="photo-desc side-b">
                      <h3>Dazzling Auroras</h3>
                      <p>Aenean lacinia bibendum nulla sed consectetur. Fusce dapibus, tellus ac cursus commodo.</p>
                        <a href="#" class="button">download</a>
                    </div>
                </div>
            </div>  

            <div class="photo-container">
                <div class="photo">
                  <img class="side-a" src="img/photos/2.jpg" alt="International Space Station"> 
                  <div class="photo-desc side-b">
                      <h3>The Space Station</h3>
                      <p>Aenean lacinia bibendum nulla sed consectetur. Fusce dapibus, tellus ac cursus commodo.</p>
                        <a href="#" class="button">download</a>
                    </div>
                </div>
            </div>  

            <div class="photo-container">
                <div class="photo">
                  <img class="side-a" src="img/photos/3.jpg" alt="Planet Earth">    
                  <div class="photo-desc side-b">
                      <h3>Planet Earth</h3>
                      <p>Aenean lacinia bibendum nulla sed consectetur. Fusce dapibus, tellus ac cursus commodo.</p>
                        <a href="#" class="button">download</a>
                    </div>
                </div>
            </div>  

        </div>

2 Answers

That div is like a wapper for other HTML elements, I bet that the child elements of that div are like 3 columns ( all the divs with the class .photo-container ), so, when you have similar situations, put your columns inside a wrapper.The clearfix class is used to clear the floats because those 3 columns are floated.

Gari Merrifield
Gari Merrifield
9,597 Points

From caniuse.com's 3D Tranforms page : "The perspective property doesn't work on the body element in Firefox, it must be used on an inner element."

So from that, it sounds like a wrapper div is a requirement.