+ Reply to Thread
Results 1 to 7 of 7

Thread: CSS Question

  1. #1
    Zenax's Avatar
    Zenax is offline Lord Of The Keys Zenax is an unknown quantity at this point
    Join Date
    Jul 2006
    Location
    The Brilliant United Kingdom
    Posts
    1,339

    CSS Question

    Ok Dudes,

    I don't know if this is possible, but is it possible to apply two classes too one div?

    regards,
    Zenax
    Regards,
    Zenax

  2. #2
    dyfuse's Avatar
    dyfuse is offline x10 Sophmore dyfuse is an unknown quantity at this point
    Join Date
    Apr 2006
    Posts
    196

    Re: CSS Question

    I don't think that would be possible (but don't quote me on it)...At some stage, I'm sure one of the classes would be 'overwritten' by the other....


    But I can think of many ways in which you could use this method though - but just differently:

    **applying a class to a <div></div> element whilst having a different class for a <span></span> or <table></table> or other element....which is inside the original div element.

    Code:
    <div class="divclass">
             <span class="spanclass">Span Text</span>
    </div>

  3. #3
    Cubeform is offline x10 Lieutenant Cubeform is an unknown quantity at this point
    Join Date
    Aug 2006
    Location
    127.0.0.1
    Posts
    339

    Re: CSS Question

    Yes, you can. And it's simpler than you think.
    HTML Code:
    <div class="class1 class2"></div>
    Note that there is a space between the classes you want to implement.

    Oh yeah, in your CSS files, if those two classes have conflicting declarations (e.g. class1 has a background colour of blue, class2 has a background colour of green), I'm pretty sure the second class would override the first one.
    Last edited by Cubeform; 12-01-2006 at 04:07 PM.
    CUBEFORM
    XHTML | CSS | PHP | JavaScript
    THIS WEEK


  4. #4
    Zenax's Avatar
    Zenax is offline Lord Of The Keys Zenax is an unknown quantity at this point
    Join Date
    Jul 2006
    Location
    The Brilliant United Kingdom
    Posts
    1,339

    Re: CSS Question

    Tried that and it didn't work.
    However problem has been solved!

    Regards,
    Zenax
    Regards,
    Zenax

  5. #5
    dyfuse's Avatar
    dyfuse is offline x10 Sophmore dyfuse is an unknown quantity at this point
    Join Date
    Apr 2006
    Posts
    196

    Re: CSS Question

    Quote Originally Posted by Cubeform View Post
    Yes, you can. And it's simpler than you think.
    HTML Code:
    <div class="class1 class2"></div>
    Note that there is a space between the classes you want to implement.

    Oh yeah, in your CSS files, if those two classes have conflicting declarations (e.g. class1 has a background colour of blue, class2 has a background colour of green), I'm pretty sure the second class would override the first one.
    I didn't actually know that you could do that....until it didn't work for Zenax...but interesting though
    (Cubeform have you used this method before?)

  6. #6
    Zenax's Avatar
    Zenax is offline Lord Of The Keys Zenax is an unknown quantity at this point
    Join Date
    Jul 2006
    Location
    The Brilliant United Kingdom
    Posts
    1,339

    Re: CSS Question

    Erm what this question was relevant for, was that I was using the curvycorners script to create curvy corners, and one of the methods is for it too look for a class with a certain name, and then I wanted a second class after that, but it didn't work.

    However, I have solved the problem, by using the divs I want curved to have a class and a ID.

    and the ones I don't curved, I just use a normal class!

    Regards,
    Zenax
    Regards,
    Zenax

  7. #7
    dyfuse's Avatar
    dyfuse is offline x10 Sophmore dyfuse is an unknown quantity at this point
    Join Date
    Apr 2006
    Posts
    196

    Re: CSS Question

    Yeah, that worked!

    I'd actually forgot about ID's - I think they only apply to one element (they can only be used once), with classes able to be used on multiple items.

    But, what you've done is used that for very specific customisation of the elements on your page!

+ Reply to Thread

Similar Threads

  1. An urgent question on ads to the admin/x10hosting CEO
    By lionheart8 in forum Free Hosting
    Replies: 3
    Last Post: 11-03-2006, 12:45 PM
  2. Simple Ad Question
    By Death in forum Free Hosting
    Replies: 4
    Last Post: 02-14-2006, 04:46 AM
  3. Answer a question/Ask a question
    By humphrey in forum Off Topic
    Replies: 29
    Last Post: 11-26-2005, 07:06 PM
  4. Ad Code Question
    By reiterb in forum Free Hosting
    Replies: 1
    Last Post: 08-18-2005, 09:29 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
x10hosting free hosting for the masses
dedicated servers