SitePoint Sponsor

User Tag List

Results 1 to 6 of 6
  1. #1
    SitePoint Enthusiast
    Join Date
    Dec 2012
    Posts
    25
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Selectivizr & Modernizr

    I wonder if I can used both (Selectivizr) and ( Modernizr) in my page without causing any problems?
    OR
    Should I use only one of these js file
    Thank you

  2. #2
    The CSS Clinic is open silver trophybronze trophy
    Paul O'B's Avatar
    Join Date
    Jan 2003
    Location
    Hampshire UK
    Posts
    40,340
    Mentioned
    179 Post(s)
    Tagged
    6 Thread(s)
    Hi,

    I don't use either but as far as I understand them then Modernizr adds classes to the html element which you can then use in your css to supply alternate rules when you use the newer features of css3.

    e.g.
    Code:
    .no-boxshadow div { /* styles for browsers that don't support box-shadow */ }
    Selectivizr on the other hand emulates some CSS3 pseudo-classes and attribute selectors for use in Internet Explorer 6-8. You don't need to do anything else such as add special classes as your original css will just work. Therefore there should be no conflict with Modernizr as Modernizr doesn't really change anything at all as you still have to manually add the classes where needed.

  3. #3
    SitePoint Enthusiast
    Join Date
    Dec 2012
    Posts
    25
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I want to use Selectivizr only to emulates CSS3 pseudo-classes specially :last-child , because when I test my site (in ie 7) the footer looks messy.
    Is there any alternative way to do the same thing without adding Selectivizr ?

    <style type="text/css">
    #foot_links li { margin:0 10px 7px; border-left:1px solid #000; padding-left:10px; display:inline; position:relative;}
    #foot_links li:last-child { border-left:0}
    </style>
    <ul id="foot_links">
    <ul>
    <li><h3><a href="#">home</a></h3></li>
    <li><h4><a href="#">sub1</a></h4></li>
    <li><h4><a href="#"> sub2</a></h4></li>
    <li><h4><a href="#"> sub3</a></h4></li>
    </ul>
    thank you

  4. #4
    The CSS Clinic is open silver trophybronze trophy
    Paul O'B's Avatar
    Join Date
    Jan 2003
    Location
    Hampshire UK
    Posts
    40,340
    Mentioned
    179 Post(s)
    Tagged
    6 Thread(s)
    You could add a class to the last list item and style it that way

    If you don't want to add a class and you only have 4 links you could do this:

    Code:
    #foot_links li + li + li + li{border-left:0}
    That should work in IE7+ (note that IE8 doesn't understand last-child either).

  5. #5
    SitePoint Enthusiast
    Join Date
    Dec 2012
    Posts
    25
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    thanks a lot
    it works very well
    But should I care about ie6 ???

  6. #6
    The CSS Clinic is open silver trophybronze trophy
    Paul O'B's Avatar
    Join Date
    Jan 2003
    Location
    Hampshire UK
    Posts
    40,340
    Mentioned
    179 Post(s)
    Tagged
    6 Thread(s)
    Quote Originally Posted by tulip-flower View Post
    But should I care about ie6 ???
    Only if you have a uniquely high proportion of IE6 users. IE6 is dead in the water these days and i don;t support it. However the fact that IE6 gets an extra border is not worth worrying about anyway.


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
  •