...

View Full Version : Changing font colour half way through a paragraph



MozazDesign
08-21-2010, 09:45 PM
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!

bazz
08-21-2010, 11:07 PM
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



<span class='orange_bit'>this will show in orange</span>


css:


.orange_bit {
color: #ff6600; /*with whatever the hex code is for your shade of orange */
}



bazz

The reaper
08-22-2010, 12:17 AM
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.

Major Payne
08-23-2010, 04:03 AM
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".

bazz
08-23-2010, 12:47 PM
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

Major Payne
08-23-2010, 05:34 PM
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.

bazz
08-23-2010, 06:08 PM
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 :rolleyes:

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. :)

boogily
08-23-2010, 06:38 PM
Just use span tags. Weeeeeeeeeeeeeeeeeeeeeeeeeeeee
<span class='black'>this will show in black</span>



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum