473,230 Members | 1,973 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,230 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 1362
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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
by: macgyver | last post by:
This is a strange question, and I think the answer is NO, but I am asking anyway. I am a member of a website which allows us to alter our member profiles. Using css in the middle of the profile...
10
by: Neil Zanella | last post by:
Hello, I would like to achieve the following effect for an FAQ page without having to resort to html tables. What is the best way to do it using CSS (note how the indentation is table-like)? ...
33
by: amerar | last post by:
Hi All, I can make a page using a style sheet, no problem there. However, if I make an email and send it out to my list, Yahoo & Hotmail totally ignore the style tags. It looks fine in...
3
by: Chris | last post by:
Hi I have another style sheet question: We effectively have a page that has two text boxes on it. We would like one text box to be in one style and the other text box to be in another style....
8
by: pamelafluente | last post by:
Hi guys, Is it possible to add "onload" (via Javascript) a new class to the <styleheader section? If yes, how would that be done ? <style type="text/css" media="screen"> .NewStyleClass{...
10
by: pamelafluente | last post by:
Hi, this time I am trying to add a style on the fly.I wish equivalency with this one (only the menuItemStyle line): <head> <style type="text/css" media="screen"> ... some static styles ......
1
by: Looch | last post by:
Hi All, I have a need for a user to open an XML file from a web site and have it open based on a style sheet, not just looking at the raw XML data. I'm wondering what the best way to go about...
7
Stang02GT
by: Stang02GT | last post by:
I am running into a problem with a style sheet for my menu and the style sheet on my web page. The style sheet for the web page is over riding some of the items of my menu sheet. Is there any...
12
by: OccasionalFlyer | last post by:
I am pretty new to JavaScript and having trouble with something that should, I think, be fairly easy. I have one form. I have two radio buttons. I have a text box that is hidden. If you click...
6
by: soni2926 | last post by:
hi, what's the difference between using . or #? #switcher { .... } ..chapter { ..... }
0
by: VivesProcSPL | last post by:
Obviously, one of the original purposes of SQL is to make data query processing easy. The language uses many English-like terms and syntax in an effort to make it easy to learn, particularly for...
3
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 3 Jan 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). For other local times, please check World Time Buddy In...
0
by: jianzs | last post by:
Introduction Cloud-native applications are conventionally identified as those designed and nurtured on cloud infrastructure. Such applications, rooted in cloud technologies, skillfully benefit from...
0
by: abbasky | last post by:
### Vandf component communication method one: data sharing ​ Vandf components can achieve data exchange through data sharing, state sharing, events, and other methods. Vandf's data exchange method...
2
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 7 Feb 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:30 (7.30PM). In this month's session, the creator of the excellent VBE...
0
by: fareedcanada | last post by:
Hello I am trying to split number on their count. suppose i have 121314151617 (12cnt) then number should be split like 12,13,14,15,16,17 and if 11314151617 (11cnt) then should be split like...
0
Git
by: egorbl4 | last post by:
Скачал я git, хотел начать настройку, а там вылезло вот это Что это? Что мне с этим делать? ...
0
by: MeoLessi9 | last post by:
I have VirtualBox installed on Windows 11 and now I would like to install Kali on a virtual machine. However, on the official website, I see two options: "Installer images" and "Virtual machines"....
0
by: Aftab Ahmad | last post by:
Hello Experts! I have written a code in MS Access for a cmd called "WhatsApp Message" to open WhatsApp using that very code but the problem is that it gives a popup message everytime I clicked on...

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.