Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 8 of 8
  1. #1
    New to the CF scene
    Join Date
    Aug 2010
    Posts
    1
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Changing font colour half way through a paragraph

    Hey there!

    I was wondering if it's possible, and if it is, what is the best way to change a font's colour halfway through a paragraph.

    For example, if I have a paragraph of white text, and I want a sentence halfway through that paragraph to be orange, and then continue with white text after, what is the best way of doing this?

    Thanks in advance!

  • #2
    Master Coder
    Join Date
    Apr 2003
    Location
    in my house
    Posts
    5,211
    Thanks
    39
    Thanked 201 Times in 197 Posts
    just surround the bit you want to be orange with 'span' tags and assign a class so the css can cause the orange to display

    Code:
    <span class='orange_bit'>this will show in orange</span>
    css:
    Code:
    .orange_bit {
    color: #ff6600; /*with whatever the hex code is for your shade of orange */
    }

    bazz
    "The day you stop learning is the day you become obsolete"! - my late Dad.

    Why do some people say "I don't know for sure"? If they don't know for sure then, they don't know!
    Useful MySQL resource
    Useful MySQL link

  • #3
    Regular Coder
    Join Date
    Oct 2009
    Location
    Florida
    Posts
    155
    Thanks
    16
    Thanked 2 Times in 2 Posts
    Or if you do not want to use css, you can use the font tag.

    This text is white <font color="#ff6600">but this text inside the font tag is orange</font> also the text after the closing of the font tag is white.

    Just change the hexadecimal value to whatever color you wish.

  • #4
    Regular Coder
    Join Date
    Aug 2005
    Location
    MS
    Posts
    820
    Thanks
    10
    Thanked 78 Times in 76 Posts
    Quote Originally Posted by The reaper View Post
    Or if you do not want to use css, you can use the font tag.

    This text is white <font color="#ff6600">but this text inside the font tag is orange</font> also the text after the closing of the font tag is white.

    Just change the hexadecimal value to whatever color you wish.
    Font tags are deprecated. Span tags replaced them. Just because they work, doesn't mean you need to use them. One day, browser developers will stop this backwards-compatibility nonsense and keep browsers updated to latest standards. Of course, you know this will never happen as millions of web sites would be "broken".
    ☠ ☠RON☠ ☠

  • #5
    Master Coder
    Join Date
    Apr 2003
    Location
    in my house
    Posts
    5,211
    Thanks
    39
    Thanked 201 Times in 197 Posts
    I look forward to the day when it does happen. It wouldn't matter that for a time numerous websites would be broken. The people who developed them would have to either fix them at their own cost or repay the client who can then pay someone else.

    It would certainly clear the industry of many cruddy (client_side), coders and probably would raise the standard of web dev. But it wouldn't stop young people having access to 'getting on the ladder', which would also be a good thing, imv.

    bazz
    "The day you stop learning is the day you become obsolete"! - my late Dad.

    Why do some people say "I don't know for sure"? If they don't know for sure then, they don't know!
    Useful MySQL resource
    Useful MySQL link

  • #6
    Regular Coder
    Join Date
    Aug 2005
    Location
    MS
    Posts
    820
    Thanks
    10
    Thanked 78 Times in 76 Posts
    O.T.: @bazz: Thank you, thank you for those last comments. The Internet would be a much better place to access if everyone used coding standards and all browsers stopped the backwards-compatibility. You're the only one I have seen that seemed to agree that it may break millions of sites, but they would get fixed in a hurry if they are worth fixing. The newer coders would not learn all those bad habits. Even the colleges are teaching outdated material.
    ☠ ☠RON☠ ☠

  • #7
    Master Coder
    Join Date
    Apr 2003
    Location
    in my house
    Posts
    5,211
    Thanks
    39
    Thanked 201 Times in 197 Posts
    Still off-topic:

    I agree about schools and, indeed, universities teaching out-dated methods. I had this discussion a few weeks back and the uni tutor agreed with me. My point was that if a teacher/tutor is the professional/specialist in their chosen subject, how can they *teach* that specialist subject, when to be up-to-date on that subject requires its own speciality - *learning*.

    And if they were to spend sufficient time on learning and keeping up to date, they would have no time to teach. So; the uni system seems to require someone to have 48 hrs in a day so they can learn and teach. Of course that means they will actually fall behind in their speciality and consequently not be specialists any longer

    How to fix?? do it the w3schools way and with forums like this. after all, why re-invent the wheel - with a brick. forums were teaching people long before uni did these same courses.

    So, in a nutshell, we need the browsers to come together with a concerted policy for the future so that semantic code is all that they will recognise.

    If that were donw, we reach the next problem: Because IE allowed people to build really cruddy code and get away with it, I would suggest that more sites which would break would be the ones designed in old versions of IE.

    So M$ would get the blame and take the hit for that and the consequences would be unbelievably-massively, humungous. It would likely render M$ reputation to be NULL, at best and absolutely obsolete at worst (for them).

    So I don't see any surprise that browsers haven't come together with cohesive standards for the future, already. What I do see is M$ starting to address standards in thier latest browsers as well as addresing backwards-compatibility. once they reach the stage where everything is coded well, through semantics and because their browsers aren't so rubbish, they will be able to drop the concept of backwards-compatibility completely.

    That'll take about a decade in my view and to do it quicker would be simply addressed with the only difficulty being for M$ reputation.

    I feel better but still need a lie down.
    "The day you stop learning is the day you become obsolete"! - my late Dad.

    Why do some people say "I don't know for sure"? If they don't know for sure then, they don't know!
    Useful MySQL resource
    Useful MySQL link

  • #8
    Regular Coder boogily's Avatar
    Join Date
    Jul 2009
    Posts
    275
    Thanks
    18
    Thanked 4 Times in 4 Posts

    Span tag it

    Just use span tags. Weeeeeeeeeeeeeeeeeeeeeeeeeeeee
    <span class='black'>this will show in black</span>
    Joomla Development Company and MN SEO
    "Joomla development from design to SEO"


  •  

    Tags for this Thread

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •