cwiggo
cwiggo

Reputation: 2599

How to align an image slightly under text

I have a navigation bar. Horizontal.

I have an image on the left. Text on the right. Show below:

Not how I want it

I want to take the image so it is position slightly underneath the text, so basically the image needs to slide a tiny bit under the left part of the text. Shown below:

How I want it

My current HTML is:

<p class="menu_text">
    <img class="tgss_icon" src="http://www.thegoldservicescholarship.co.uk/images/icon.jpg" alt="TGSS Icon"/>
    <a class="menu_links" href="contact_us.php">Contact Us</a>
</p>​

My current CSS is:

img.tgss_icon{
  height: 30px;
  width: 35px;
  padding-bottom: 7px;
}

a.menu_links:link { color: #58595B; text-decoration: none;}
a.menu_links:visited  { color: #58595B; text-decoration: none; }
a.menu_links:active { color: #E6BD13; text-decoration: none; }
a.menu_links:hover  { color: #E6BD13; text-decoration: none; }

p.menu_text{
  font-size: 15pt;
  /*color: #58595B;*/
}​

Thanks in advance! Chris.

Upvotes: 0

Views: 86

Answers (1)

sachleen
sachleen

Reputation: 31131

You can do this with a negative margin on the link.

a.menu_links { margin-left: -20px; }

Demo

Upvotes: 3

Related Questions