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

Kevin Fitzhenry
Kevin Fitzhenry
30,096 Points

Vertically Align the graduation cap icon with the work education

https://dl-web.dropbox.com/get/WTF.png?_subject_uid=279295174&w=AAA14zTlrY5pagzMaAuR_xYc2R7yebamQxlTRw1uAcutlg

Please see the link above, it is a screenshot of what I am trying to achieve. I am trying to vertically align the graduation-cap icon with the h3 EDUCATION. The html is included in the screenshot and the CSS is below. I am also using html5-reset.css

THANKS SO MUCH FOR ANY AND ALL HELP

.container {
    width: 80%;
    margin: auto;
}

/****************************************************************
        HEADER - Name and PICTURE
*****************************************************************/

header {
    margin-top: 45px;
    margin-bottom: 20px;
}

h1 {
    font-family: 'Josefin Sans', sans-serif;
    font-weight: 700;
    font-size: 2.5rem;
}


/******************************************************************************
        SECTION TITLES - EDUCATION, EMPLOYMENT, SKILLS, REFERENCES, CONNECT
*******************************************************************************/

a, a:visited, a:hover {
    text-decoration: none;
    color: black;
}

.title {
    background-color: lightgrey;
    border-radius: 5px;
    padding: 5px;
    margin: 10px 0px;
    font-family: 'Josefin Sans', sans-serif;
    font-weight: 400;
    text-transform: uppercase;

}

.icon {
    float: left;
    margin-right: 8px;
    max-width: 30px;


}

1 Answer

Damien Watson
Damien Watson
27,419 Points

Hi Kevin,

The link doesn't work for me so I can't see your html, but if I was to put an icon inside a h3, I would use background image like below. My icon image is 24 x 24px.

  h3              { text-indent:30px; line-height:30px; background-repeat:no-repeat; background-position:left center; }
  .icon-circle    { background-image:url(icon-circle.png); }
  <h3 class="icon-circle">Example heading!</h3>