Go Back   CodingForums.com > :: Client side development > HTML & CSS

Before you post, read our: Rules & Posting Guidelines

Reply
 
Thread Tools Rate Thread
Enjoy an ad free experience by logging in. Not a member yet? Register.
Old 12-17-2002, 08:50 PM   PM User | #1
duniyadnd
Regular Coder

 
Join Date: Jun 2002
Location: Depends on the time of year
Posts: 478
Thanks: 0
Thanked 0 Times in 0 Posts
duniyadnd is an unknown quantity at this point
how far do classes work in css?

Just curious, I was going through some rudimentary css coding, and I wrote two sets of bold characterstics. One labled as b, the other labled as b.2

The first one would be automatically whenever the tag <b> was included.

Now on IBM compatible PCs, I've seen that calling in the second type of b works fine by saying: <b class="2">

However, I switch over to the Macs, and it stops at the default "b" style.

Is there a way of going around this?

Here are the two sets of styles:

b
{ font-family: Verdana, Arial, Helvetica, sans-serif; font-style: normal; line-height: 10pt; font-weight: bold; font-variant: normal; color: #0e3d9e; text-decoration: none; text-align: justify}

b.2
{ font-family: Verdana, Arial, Helvetica, sans-serif; font-style: normal; line-height: 10pt; font-weight: bold; font-variant: normal; color: #ffffff; text-decoration: none; text-align: justify}

The only difference is the text color.

Thanks
Duniyadnd
duniyadnd is offline   Reply With Quote
Old 12-17-2002, 09:49 PM   PM User | #2
krycek
Regular Coder

 
Join Date: Nov 2002
Location: Bristol, UK
Posts: 932
Thanks: 0
Thanked 0 Times in 0 Posts
krycek is an unknown quantity at this point
I think you will find it isn;t the PC that's the problem but the browser.

style.style works in some browsers (not sure which) but you will get a universal result by putting a space in; e.g. style .style

that also allows you to nest them more deeply, e.g. style .style .style

I think I am correct on this

::] krycek [::
__________________
ithium | SOAPI | SDP | PTPScript manual
"ithium is a non-profit webhost, which is pretty much unique. The mission of ithium is to provide free hosting resources for worthwhile and needy non-profit projects, which otherwise may not be able to obtain such facilities. The money from commercial customers goes to maintain ithium's servers and further development."
krycek is offline   Reply With Quote
Old 12-17-2002, 10:12 PM   PM User | #3
duniyadnd
Regular Coder

 
Join Date: Jun 2002
Location: Depends on the time of year
Posts: 478
Thanks: 0
Thanked 0 Times in 0 Posts
duniyadnd is an unknown quantity at this point
cool, i'll try that out. I should have mentioned that both type of machines I was using IE, 5.0/5.5/6.0 on the PC, not sure which one on the Mac.

Thanks
Duniyadnd
duniyadnd is offline   Reply With Quote
Old 12-18-2002, 02:12 AM   PM User | #4
duniyadnd
Regular Coder

 
Join Date: Jun 2002
Location: Depends on the time of year
Posts: 478
Thanks: 0
Thanked 0 Times in 0 Posts
duniyadnd is an unknown quantity at this point
Okay i tried out your suggestion, but it didn't work..

I tried three ways:

b. 2

and

b .2

and

b . 2

none of them worked, and this on IE 6.0 PC.

duniyadnd
duniyadnd is offline   Reply With Quote
Old 12-18-2002, 02:40 AM   PM User | #5
krycek
Regular Coder

 
Join Date: Nov 2002
Location: Bristol, UK
Posts: 932
Thanks: 0
Thanked 0 Times in 0 Posts
krycek is an unknown quantity at this point
I am not sure if it because you are using a number only, because I am pretty sure that valid names should start with a letter.

Also, I am not convinced that styling the <b> tag is a good idea... try styling divs or spans instead (there is nothing wrong in theory as far as I know but it just seems odd to me lol)

but the method itself is sound

::] krycek [::
__________________
ithium | SOAPI | SDP | PTPScript manual
"ithium is a non-profit webhost, which is pretty much unique. The mission of ithium is to provide free hosting resources for worthwhile and needy non-profit projects, which otherwise may not be able to obtain such facilities. The money from commercial customers goes to maintain ithium's servers and further development."
krycek is offline   Reply With Quote
Old 12-18-2002, 03:06 AM   PM User | #6
duniyadnd
Regular Coder

 
Join Date: Jun 2002
Location: Depends on the time of year
Posts: 478
Thanks: 0
Thanked 0 Times in 0 Posts
duniyadnd is an unknown quantity at this point
So true, it might be because of the number. I'll try that, but can only confirm with macs later on tonight.

btw, the space thing still doesn't work. The problem with divs is that I heard I can only use it for a unique location per page, and I want to avoid that, as I might want to use the different options wherever I need to. Never used span either.

Duniyadnd
duniyadnd is offline   Reply With Quote
Old 12-18-2002, 10:10 AM   PM User | #7
ronaldb66
Senior Coder

 
Join Date: Jun 2002
Location: The Netherlands, Baarn, Ut.
Posts: 4,253
Thanks: 0
Thanked 0 Times in 0 Posts
ronaldb66 is an unknown quantity at this point
Unique location?

Eh? Could you eleborate on that? I tried a test layout recently and used both divs and spans all over the place, liberally using several different classes without a hitch. I you mean that a div element by default behaves as a block element so you can't have more then one horizontally, consider positioning or, simpler, set display: inline, or use span elements which behave by default as inline elements. Then again, maybe i'm barking up the wrong tree here.
__________________
Regards,
Ronald.
ronaldvanderwijden.com
ronaldb66 is offline   Reply With Quote
Old 12-24-2002, 11:50 PM   PM User | #8
duniyadnd
Regular Coder

 
Join Date: Jun 2002
Location: Depends on the time of year
Posts: 478
Thanks: 0
Thanked 0 Times in 0 Posts
duniyadnd is an unknown quantity at this point
eh, would you believe it, there was no problem at all with the difference between the macintosh and pc versions except for the fact that the macintosh is less forgiving. In the css file, I by mistake wrote:

line-height: 11ph

Needless to say, it gave me a HUGE gap and which prompted me to ask this question as I somehow kept missing that.

As for your question ronaldb66, I was going through the w3schools.com website figuring out the restrictions and such that, and since I was going through exam week and lack of sleep etc. I read everything in a lopsided way. Sorry for the confusion.

But you can reference the tutorial from their site.

W3Schools

Thanks for the input people
Duniyadnd
duniyadnd is offline   Reply With Quote
Old 12-27-2002, 08:15 AM   PM User | #9
ronaldb66
Senior Coder

 
Join Date: Jun 2002
Location: The Netherlands, Baarn, Ut.
Posts: 4,253
Thanks: 0
Thanked 0 Times in 0 Posts
ronaldb66 is an unknown quantity at this point
W3Schools is great!

Know it, love it, use it all the time!
__________________
Regards,
Ronald.
ronaldvanderwijden.com
ronaldb66 is offline   Reply With Quote
Reply

Bookmarks

Jump To Top of Thread


Thread Tools
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

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +1. The time now is 11:00 PM.


Advertisement
Log in to turn off these ads.