471,598 Members | 1,273 Online
Bytes | Software Development & Data Engineering Community
Post +

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 471,598 software developers and data experts.

BASIC STYLE SHEET QUESTION

Can I use stylesheets to set a specific font for a particular line of
text througout the site without updating the content itself. For
example

I have multiple instances of the word "today" and I don't want to have
to go through all pages and find and replace "today" with <font
face="arial">today</font>

Thanks.

Aug 15 '07 #1
4 1339
Rik
On Wed, 15 Aug 2007 21:51:12 +0200, <bt*******@us.imshealth.comwrote:
Can I use stylesheets to set a specific font for a particular line of
text througout the site without updating the content itself. For
example

I have multiple instances of the word "today" and I don't want to have
to go through all pages and find and replace "today" with <font
face="arial">today</font>
Not with pure CSS, you can with either a server side filter or javascript.
--
Rik Wasmus
Aug 15 '07 #2
Scripsit bt*******@us.imshealth.com:
Can I use stylesheets to set a specific font for a particular line of
text througout the site without updating the content itself.
Yes, if you use a suitable markup like <div class="tagline">...</div>.
For example

I have multiple instances of the word "today" and I don't want to have
to go through all pages and find and replace "today" with <font
face="arial">today</font>
That's a different issue. A word is not a line. And you can't assign CSS
rules something without making it an element (or, in some cases that don't
apply here, a pseudo-element) in HTML markup. So you would have to use
something like

<span class="today">today</span>

for each occurrence of "today". It would still be better than <fontmarkup,
since you could change (when desired or needed) the styling by changing just
one line, such as

..today { font-family: Arial, Helvetica, sans-serif; }

On the other hand, presenting a word in running text in a font different
from the surrounding words is usually a bad idea. Usually font should be set
for blocks (lines, paragraphs).

P.S. PLEASE DO NOT SHOUT on the the Subject line or elsewhere - it hurts
eyes and it makes a post look like spam.

--
Jukka K. Korpela ("Yucca")
http://www.cs.tut.fi/~jkorpela/

Aug 15 '07 #3
Thanks Rik, that's the info I needed.

Aug 15 '07 #4
Thanks Rik,

Would you happen to have a javascript snippet that I could use?

Aug 15 '07 #5

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

3 posts views Thread by macgyver | last post: by
10 posts views Thread by Neil Zanella | last post: by
33 posts views Thread by amerar | last post: by
8 posts views Thread by pamelafluente | last post: by
10 posts views Thread by pamelafluente | last post: by
1 post views Thread by Looch | last post: by
12 posts views Thread by OccasionalFlyer | last post: by
6 posts views Thread by soni2926 | last post: by
2 posts views Thread by XIAOLAOHU | last post: by
reply views Thread by leo001 | last post: by
reply views Thread by Anwar ali | last post: by

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.