473,396 Members | 2,011 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,396 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 1364
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: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

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.