| Home | Register | FAQ | Members List | Search | Today's Posts | Mark Forums Read |
| DesignersTalk > <span> Tags...the best way to format a style within a style? |
|
LinkBack | Thread Tools | Search this Thread |
|
|
#1 (permalink) |
|
This is it - ground zero.
|
<span> Tags...the best way to format a style within a style?
Ok, I'll just get right into a question I'm sure is rather rudimentary...I have a td with a certain class defined (for this example, it is for the text contained within it) and I want to change one word to red (for this example)... The classes are: .text { font-family:verdana; color:#000000; } .textred { font-family:verdana; color:#FF0000; } Would the following be the best way to do it: Code:
I really don't want to use flash or read a book, and I also don't want annoying <span> tags everywhere in my code -- they remind too much of even more annoying <font> tags. This has always bothered me, but if this is the accepted way to do it, then so be it and I will let it rest. fun: HGC v.4 | last.fm: DT | me | oi! f*ck u roto: ...via meebo!
New to interweb design? Your friends at dt can help. |
|
|
|
|
|
#2 (permalink) |
|
I Ain't Losing Any Sleep™
Join Date: Apr 2003
Posts: 5,240
|
If you're doing it to emphasis the text use the <em> tag and style it. em { color: red; font-weight: normal; } That's fuckin' ingenious, if I understand it correctly. It's a Swiss fuckin' watch.
|
|
|
|
#5 (permalink) |
|
trouble free and loverlee
Join Date: Mar 2003
Location: YooKay
Posts: 2,930
|
Nah, you were right first time, sb. <span> tags may appear useful, but they are meaningless. They're certainly not 'the best way' to achieve what you're after, oto. Use styled <em> tag as sb suggested and it'll emphasise the red word in other circumstances too. Whenever possible, use meaningful tags in your markup, not meaningless ones. Why are you emphasising the word in the first place? |
|
|
|
#6 (permalink) |
|
This is it - ground zero.
|
It is just a theoretical question. I'm more after WHAT would be the best way to JUST make the text RED (not italic) and/or the best way to accomplish adding a different style within a style. If <span> tags are meaningless, I'm asking about substitutes, and IF they are meaningless...why do they exist? I'm curious... fun: HGC v.4 | last.fm: DT | me | oi! f*ck u roto: ...via meebo!
New to interweb design? Your friends at dt can help. |
|
|
|
#8 (permalink) |
|
volkswagen yellow & gold
Join Date: Apr 2003
Location: london, england.
Posts: 6,215
|
they work for all. span tags are meaningless when taken away from a stylesheet. stylesheets are there to seperate style from content. take a look at your markup without the style sheet attached. if you use a styled <em> tag then your browser will still know to give emphasis to this word. if you're not wanting to put the word in red for emphasis then why is it highlighted in red? surely you are emphasising the word's existance on the page? this can't be a theoretical question. |
|
|
|
#9 (permalink) | |
|
I Ain't Losing Any Sleep™
Join Date: Apr 2003
Posts: 5,240
|
Quote:
<em> is not <i>. It just so happens that <em>'s default weight is set to italics. The point that I, and Bill after me, was making is that by making a certain word within a paragraph red you ARE emphasising it, even if you don't realise, and therefore should us the proper markup. That's fuckin' ingenious, if I understand it correctly. It's a Swiss fuckin' watch.
|
|
|
|
|
#13 (permalink) |
|
trouble free and loverlee
Join Date: Mar 2003
Location: YooKay
Posts: 2,930
|
jftr, <span> tags were devised with a 'structural' effect in mind, but will also support the 'presentational' effect you want. Seeing as you are creating a presentational emphasis rather than a structural one, it is recommended that you use a semantic, presentational tag (i.e. <em>) as these tags can then be used to emphasise that text in alternative web reading/browing software (i.e. Lynx, Jaws, ...). Or to put it another way... ditto. [edit] That'll learn me to have breakfast mid-post [/edit] |
|
|
|
#16 (permalink) | |
|
I Ain't Losing Any Sleep™
Join Date: Apr 2003
Posts: 5,240
|
Quote:
should I use a fork or spoon? It depends what you're eating! </wise monkey> That's fuckin' ingenious, if I understand it correctly. It's a Swiss fuckin' watch.
|
|
|
|
|
#18 (permalink) |
|
This is it - ground zero.
|
Alright...it all makes more sense now...TA (and it doesn't seem like such a basic/rudimentary question anymore) fun: HGC v.4 | last.fm: DT | me | oi! f*ck u roto: ...via meebo!
New to interweb design? Your friends at dt can help. |
|
![]() |