Announcement

Collapse
No announcement yet.

float attribute for multi-colored text effect

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • float attribute for multi-colored text effect

    Can the float attribute in CSS be used to make each letter in headings a different color? Is there a maximum number of elements in the same sequence for using float left? Some of my pages look a bit generic, but I don't want to add pictures.

  • #2
    There isn't a maximum number of elements, but floating doesn't affect the colour of the letters. Rather do it as a series of spans eg:
    Code:
    <span class="red">T</span><span class="green">H</span><span class="blue">E</span> <span class="yellow">T<span><span class="purple">I</span><span class="red">T</span><span class="blue">T</span><span class="pink">L</span><span class="black">E</span>
    with the appropriate css entries .red {color:#f00;} etc
    David Allen - www.serina.co.uk

    Comment


    • #3
      I've used the float function in defining classes and ID selectors to make each word a different color. David's suggestion for using span is much better especially if you're doing this for each individual letter.

      Comment


      • #4
        Colorful headings are a good way to visually break up the text into sections. I've seen some headings with a rainbow or prism effect that look very nice. The span tag is a convenient way to do it.

        Comment

        Working...
        X