Web Design Forum: Keeping text on the same line, with separate hovers. - Web Design Forum

Jump to content

WDF
WDF Premium Memberships Reseller Hosting
Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

Keeping text on the same line, with separate hovers.

#1 User is offline   jacksaidwhat 

  • Dedicated Member
  • PipPip
  • Group: Members
  • Posts: 211
  • Joined: 03-November 09
  • Reputation: 24
  • Gender:Male
  • Location:Bucks, UK
  • Experience:Intermediate
  • Area of Expertise:Web Designer

Posted 05 January 2010 - 12:22 AM

Hey guys,

Just wondering what method I should use to create two different hovers over "text one" & "text two" whilst keeping them on the same line.

Obviously placing </p> after "text one" would cause " | text two" to shift down a line. So how do I keep them on one line?

<div style="text-align: center;">
<p class="hover">
text one | text two
</p>
</div>


I'm still new to CSS and learning the ropes, so any help would be amazing.
0

#2 User is offline   craftedpixelz 

  • Expert
  • PipPipPipPip
  • Group: Members
  • Posts: 644
  • Joined: 28-June 08
  • Reputation: 5
  • Gender:Male
  • Location:Manchester, UK
  • Experience:Web Guru
  • Area of Expertise:Web Designer

Posted 05 January 2010 - 12:38 AM

Something like this:

HTML:
<div>
  <p><a id="link1" href="#">Text One</a> | <a id="link2" href="#">Text Two</a></p>
</div>


CSS
#link1:hover {
    color: #ccc;
}

#link2:hover {
    color: #333;
}

0

#3 User is offline   jacksaidwhat 

  • Dedicated Member
  • PipPip
  • Group: Members
  • Posts: 211
  • Joined: 03-November 09
  • Reputation: 24
  • Gender:Male
  • Location:Bucks, UK
  • Experience:Intermediate
  • Area of Expertise:Web Designer

Posted 05 January 2010 - 12:55 AM

Works a treat buddy. I owe you one. :lol:
0

Share this topic:


Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

1 User(s) are reading this topic
0 members, 1 guests, 0 anonymous users