treehouse : what would you like to learn today?
Web Design Web Development iOS Development

centering elements

  • what css property do I need to apply to cente this?
    <section class="features">
    <section class="feature">
    <img src="Images/aspNetHome.png" alt="" />
    <h3>News</h3>
    <p>
    Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nullam porttitor nisi vel justo pulvinar placerat.
    Class aptent taciti sociosqu ad litora torquent per conubia nostra, per inceptos himenaeos.
    </p>

    </section>
    <section class="feature">
    <img src="Images/NuGetGallery.png" alt="" />
    <h3>Photos</h3>
    <p>
    Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nullam porttitor nisi vel justo pulvinar placerat.
    Class aptent taciti sociosqu ad litora torquent per conubia nostra, per inceptos himenaeos.
    </p>
    </section>
    <section class="feature">
    <img src="Images/findHosting.png" alt="" />
    <h3>Events</h3>
    <p>
    Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nullam porttitor nisi vel justo pulvinar placerat.
    Class aptent taciti sociosqu ad litora torquent per conubia nostra, per inceptos himenaeos.
    </p>
    </section>
    </section>
  • Centre what?...all of it, just the text , just parts?

    Need more information.

    I would add that the 'section' elements you have given the class of 'feature' should, more appropriately, be 'articles'...but each to their own.
  • If you want to center your features class then do this:
    .features {
    width: 900px ; /*or whatever you want*/
    margin: 0 auto;
    }