Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 9 of 9
  1. #1
    Regular Coder
    Join Date
    Jun 2002
    Location
    Depends on the time of year
    Posts
    478
    Thanks
    0
    Thanked 0 Times in 0 Posts

    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

  • #2
    Regular Coder
    Join Date
    Nov 2002
    Location
    Bristol, UK
    Posts
    932
    Thanks
    0
    Thanked 0 Times in 0 Posts
    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."

  • #3
    Regular Coder
    Join Date
    Jun 2002
    Location
    Depends on the time of year
    Posts
    478
    Thanks
    0
    Thanked 0 Times in 0 Posts
    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

  • #4
    Regular Coder
    Join Date
    Jun 2002
    Location
    Depends on the time of year
    Posts
    478
    Thanks
    0
    Thanked 0 Times in 0 Posts
    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

  • #5
    Regular Coder
    Join Date
    Nov 2002
    Location
    Bristol, UK
    Posts
    932
    Thanks
    0
    Thanked 0 Times in 0 Posts
    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."

  • #6
    Regular Coder
    Join Date
    Jun 2002
    Location
    Depends on the time of year
    Posts
    478
    Thanks
    0
    Thanked 0 Times in 0 Posts
    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

  • #7
    Senior Coder
    Join Date
    Jun 2002
    Location
    The Netherlands, Baarn, Ut.
    Posts
    4,253
    Thanks
    0
    Thanked 0 Times in 0 Posts

    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

  • #8
    Regular Coder
    Join Date
    Jun 2002
    Location
    Depends on the time of year
    Posts
    478
    Thanks
    0
    Thanked 0 Times in 0 Posts
    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

  • #9
    Senior Coder
    Join Date
    Jun 2002
    Location
    The Netherlands, Baarn, Ut.
    Posts
    4,253
    Thanks
    0
    Thanked 0 Times in 0 Posts

    W3Schools is great!

    Know it, love it, use it all the time!
    Regards,
    Ronald.
    ronaldvanderwijden.com


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •