SitePoint Sponsor

User Tag List

Results 1 to 4 of 4

Thread: Ignore a class?

  1. #1
    SitePoint Addict
    Join Date
    Sep 2008
    Posts
    341
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Ignore a class?

    Is there a way to ignore a class, such as this:

    <div class="class1 class2">etc.</div>

    <style>
    .class1 {
    width: 50%;
    }
    .class2 {
    width: 100%;
    }
    @media all and (min-width: 470px) {
    .class2 {
    //ignore this class now so it only reads class 1
    }
    }

    It's for devices which don't support media queries (which is why I can't do the obvious other way).

  2. #2
    It's all Geek to me silver trophybronze trophy
    ralph.m's Avatar
    Join Date
    Mar 2009
    Location
    Melbourne, AU
    Posts
    24,220
    Mentioned
    457 Post(s)
    Tagged
    8 Thread(s)
    Not quite sure what's happening here, but you can set a width there to override the one above. The default div width is 100% anyway, so if you want something different, just set it inside the media query.

  3. #3
    SitePoint Addict
    Join Date
    Sep 2008
    Posts
    341
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    To be honest, my problem is better explained in this post: http://www.sitepoint.com/forums/show...-Media-Queries

    ...but it's probably too long for anyone to want to read, so I tried to ask a different question which hopefully would help me.

  4. #4
    It's all Geek to me silver trophybronze trophy
    ralph.m's Avatar
    Join Date
    Mar 2009
    Location
    Melbourne, AU
    Posts
    24,220
    Mentioned
    457 Post(s)
    Tagged
    8 Thread(s)
    OK, let's close this and stick with the other thread. I'll post an answer there.


Bookmarks

Posting Permissions

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