CSS Help
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me

The Shed is going Social! Join us on FaceBook and Twitter and chime in on the conversation.

Go Back   Dev Shed ForumsWeb DesignCSS Help

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Dev Shed Forums Sponsor:
  #1  
Old July 27th, 2001, 09:46 AM
rtaylor rtaylor is offline
Contributing User
Dev Shed Novice (500 - 999 posts)
 
Join Date: Jan 2001
Location: In a multi-cultural mess.
Posts: 569 rtaylor User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 1 h 59 m 30 sec
Reputation Power: 13
Is there a "neutral" HTML tag to hold CSS class or id specification ?

I have a paragraph --

<p>Now is the time for all good men...</p>

Several phrases are highlighted with color --

<p>Now is the <font color="red">time</font> for
all <font color="green">good</font> men ...</p>

I want to use css instead of the font tag.
I can use <i> or <b> tags with "css id or class" --

<p>Now is the <i id="myRed">time</i> for
all <b id="myGreen">good</b> men ...</p>

My question -- Is there a tag that does nothing?
Just allows you to invoke some css id or class?

What "neutral" tag can I use in place of the following question marks?
<??? id="myRed">

I feel like I am missing the obvious way to do this ( without <font> ).

Robert
__________________
Robert
---
If it's hard, it's probably wrong.

Reply With Quote
  #2  
Old July 27th, 2001, 09:55 AM
pippo's Avatar
pippo pippo is offline
A PAtCHy sErver
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jun 2001
Location: Italy
Posts: 408 pippo User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 2 m 27 sec
Reputation Power: 12
Try something like this:

<span class="green">my text in green</span>

Reply With Quote
  #3  
Old July 27th, 2001, 10:13 AM
dunxster dunxster is offline
Junior Member
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jul 2001
Location: Pittsburgh, PA, USA
Posts: 13 dunxster User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
or:

<div id="myRed">text</div>

Reply With Quote
  #4  
Old July 27th, 2001, 10:41 AM
rtaylor rtaylor is offline
Contributing User
Dev Shed Novice (500 - 999 posts)
 
Join Date: Jan 2001
Location: In a multi-cultural mess.
Posts: 569 rtaylor User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 1 h 59 m 30 sec
Reputation Power: 13
dunxster and pippo,

Thanks for the ideas. I tried the following on NN4.7

Now is the <span id="bfgRed">time</span> for all <div id="bfgGreen">good</div> men to ...

<span... was ignored.
<div... made the word "good" green, but isolated "good" on a separate line.

Maybe it would work on IE?

Perhaps the HTML authors didn't see a need for an "exit" or a "no operation" for css.

Robert

Reply With Quote
  #5  
Old July 27th, 2001, 11:18 AM
jkd jkd is offline
CF sMod
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jul 2000
Location: Maine, USA (a.k.a. Boonies)
Posts: 242 jkd User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 6 m 43 sec
Reputation Power: 13
Send a message via ICQ to jkd Send a message via AIM to jkd Send a message via Yahoo to jkd
<span> is an inline element, you can have an unlimited amount of them on the same line.
<div> is a block-level element, you can only have one on a line (unless you change its style to display:inline).

Use <span>, NS4 has no problems with, perhaps it was something in your stylesheet which threw it, or perhaps it was the id attribute in the <span>? I know NS4 has no problems with <span class="bla">
__________________
Jason Contact Me
Super moderator @ CodingForums

Reply With Quote
  #6  
Old July 27th, 2001, 07:05 PM
jakke jakke is offline
Junior Member
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jul 2001
Location: Belgium
Posts: 10 jakke User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Exclamation when to use SPAN or DIV tags

When using styles for fragment of text you use the SPAN-tag. If it's a complete block of text you want to manipulate, use the DIV-tag. This is very clear when you use the background-color property on those tags.
When using the SPAN-tags around one word, together with background-color, only that word will have the specified bg-color. When using the DIV-tag on that same word, the whole line will have that background-color.

Reply With Quote
  #7  
Old July 28th, 2001, 12:27 PM
rtaylor rtaylor is offline
Contributing User
Dev Shed Novice (500 - 999 posts)
 
Join Date: Jan 2001
Location: In a multi-cultural mess.
Posts: 569 rtaylor User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 1 h 59 m 30 sec
Reputation Power: 13
Thumbs up SPAN and DIV is right. css comments can't be //

Thank you all -- jakke, jkd, dunxster, pippo

You were right <span and <div do work as you said.

It was my error.

I had an invalid comment at the end of a css line as suggested
by jkd ( thank you ). It negated the following css line.
So bfgRed was not recognized.
Yet bfgGreen was OK.

#fInDataHor {background-color: 33cc66; color: black; } // invalid comment
#bfgRed {color: ff0000;}
#bfgGreen {color: 00ff00;}

Robert

Reply With Quote
  #8  
Old July 29th, 2001, 11:06 AM
itsakoo itsakoo is offline
Junior Member
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jul 2001
Posts: 1 itsakoo User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Hi Robert,

You can use <span>, for in-line formating (i.e. no caridge returns) or <div> for block formating. Neather of these tags have any formating other than layout, so all you'll need to do is set the color to red using css as other properties will be inherited from the <p> tag.

Hope this helps.

Pete.

Reply With Quote
  #9  
Old July 30th, 2001, 05:40 AM
Spyder Spyder is offline
Web Weaver
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Dec 1999
Location: Australia
Posts: 64 Spyder User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 14
Send a message via ICQ to Spyder Send a message via AIM to Spyder
This may be a bit of a dumb question but how do you do a proper comment within CSS? I thought it was //...
__________________
Never say never.

Reply With Quote
  #10  
Old July 30th, 2001, 06:00 AM
hpwbakker's Avatar
hpwbakker hpwbakker is offline
Member
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Apr 2001
Posts: 15 hpwbakker User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Lightbulb

Comments in CSS are as follows:
/* some comment goes here */
/* this is another one */

Reply With Quote
  #11  
Old July 30th, 2001, 08:12 AM
Spyder Spyder is offline
Web Weaver
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Dec 1999
Location: Australia
Posts: 64 Spyder User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 14
Send a message via ICQ to Spyder Send a message via AIM to Spyder
ah, I see now... thanks

Reply With Quote
  #12  
Old July 30th, 2001, 05:25 PM
jakke jakke is offline
Junior Member
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jul 2001
Location: Belgium
Posts: 10 jakke User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
/**************************************
you can always span this comment
over different lines ;-)
which is handy to subdivide a long Style Sheet
***************************************/

Last edited by jakke : July 30th, 2001 at 05:28 PM.

Reply With Quote
Reply

Viewing: Dev Shed ForumsWeb DesignCSS Help > Is there a "neutral" HTML tag to hold CSS class or id specification ?

Developer Shed Advertisers and Affiliates



Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump

Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 


Powered by: vBulletin Version 3.0.5
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.

© 2003-2013 by Developer Shed. All rights reserved. DS Cluster - Follow our Sitemap