<li> titles and descriptions align across top

Posted by AMC on Stack Overflow See other posts from Stack Overflow or by AMC
Published on 2012-06-18T03:14:48Z Indexed on 2012/06/18 3:15 UTC
Read the original article Hit count: 313

Not quite sure how to go about describing what it is I'm trying to achieve, so I have some screenshots.. Basically, I'd like the <h2>s all have their top edges align, as well as the <p>'s.

What I currently have: current

What I would like to have: ideal

index.html

<div id="services">
    <p><span>Services</span></p>
    <ul>
    <li><h2>Identity and Logo Design</h2><p>Nulla et diam risus. Praesent vestibulum augue non purus tincidunt placerat. Sed in orci leo. Duis dignissim nibh vitae lacus placerat et posuere</p></li>
    <li><h2>Branding</h2><p>Nulla et diam risus. Praesent vestibulum augue non purus tincidunt placerat. Sed in orci leo. Duis dignissim nibh vitae lacus placerat et posuere</p></li>
    <li><h2>Web Design and Development</h2><p>Nulla et diam risus. Praesent vestibulum augue non purus tincidunt placerat. Sed in orci leo. Duis dignissim nibh vitae lacus placerat et posuere</p></li>
    <li><h2>Social Media</h2><p>Nulla et diam risus. Praesent vestibulum augue non purus tincidunt placerat. Sed in orci leo. Duis dignissim nibh vitae lacus placerat et posuere</p></li>
    </ul>
    <div class="next">
    <a href="#"><img src="img/next.png" alt="Click for more information" /></a>
    </div><!-- end next -->
</div><!-- end services -->

style.css

#services {
    border-top: 1px solid #202020;
    padding-bottom: 60px;
    padding-top: 40px;
}

#services p span {
    font-family: nevis-webfont;
    font-size: 112.5%;
    font-weight: normal;
    letter-spacing: 1px;
    text-transform: uppercase;
}

#services ul li {
    display: inline-block;
    padding-left: 100px;
    width: 160px;
}

#services ul li:first-child {
    padding-left: 0px;
} 

#services ul li h2 {
    padding-top: 20px;
    text-align: center;
}

#services .next {
    float: right
}

© Stack Overflow or respective owner

Related posts about css

Related posts about list