Jump to content


[CSS] Simple Question


4 replies to this topic

#1 Robbie.Knox

    Young Padawan

  • Members
  • Pip
  • 42 posts

Posted 07 June 2007 - 10:57 AM

Ok I'm trying to write 'Latest News' in CSS, with the word Latest in white and News in black. How could I do this? I tried this:

<div style="color: #ffffff;">Latest</div> <div style="color: #000000;">News</div>

But that makes them go on separate lines like this:

Latest
News

How can I fix it?

Thanks

#2 Marc

    Young Padawan

  • Members
  • Pip
  • 51 posts

Posted 07 June 2007 - 11:49 AM

You can do this using a <span> tag within your <div>, like this:

<div style="color: #ffffff;">Latest <span style="color: #000000">News</span></div>


#3 Robbie.Knox

    Young Padawan

  • Members
  • Pip
  • 42 posts

Posted 07 June 2007 - 03:53 PM

Thanks.

#4 Bug

    P2L Staff

  • P2L Staff
  • PipPipPipPip
  • 3,611 posts
  • Gender:Male
  • Location:Perth, Australia

Posted 07 June 2007 - 08:01 PM

What's the definition of span? I've always wondered what that meant and what it was used for...

Time to Google that

#5 rc69

    PHP Master PD

  • P2L Staff
  • PipPipPipPip
  • 3,827 posts
  • Gender:Male
  • Location:Here
  • Interests:Web Development

Posted 07 June 2007 - 08:19 PM

Quote

to extend over or across
It's the same concept as a div, but with out the bells and whistles.





1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users