Forums

The forums ran from 2008-2020 and are now closed and viewable here as an archive.

Home Forums CSS Max Width Stylesheet Being Applied to All Widths

  • This topic is empty.
Viewing 9 posts - 1 through 9 (of 9 total)
  • Author
    Posts
  • #34003
    frankb
    Member

    Hi. I’m following a tutorial found here: https://css-tricks.com/resolution-specific-stylesheets/

    I added this snippet to my header:

    Paulie_D
    Member

    We’ll need to see the link to your site but at a guess, you have other stylesheets linked after the ‘small.css’ which are overriding that one

    Or perhaps you did you not include the full snippet or perhaps you didn’t add the full snippet for all stylesheets?

    #122919
    frankb
    Member
    #122921
    frankb
    Member

    Ok so the width specific stylesheets should go before the main stylesheet in the header?

    #122926
    frankb
    Member

    Sorry – this is the code I have in the header:

    #122927
    frankb
    Member
    #122928
    Paulie_D
    Member

    What do you mean by main stylesheet?

    You seemed to indicate that you wanted specific viewport widths to receive specific stylesheets is that not the case?

    In any case, this looks to be a WP site and I suspect that any advice I could give in that regard is likely to be wrong.

    #122930
    frankb
    Member

    Sorry for the confusion. Let me try to explain more clearly.

    If I put the (max-width: 640px) code in my header _after_ the “style.css” (or my main stylesheet) it applies the styles from the max-width:640px stylesheet to all screensizes instead of just to screens that are 640px or less.

    Does that make sense?

    #122931
    frankb
    Member

    If I put the (max-width: 640px) code in my header _before_ the “style.css” (or my main stylesheet) it doesn’t apply the styles from the max-width:640px stylesheet at all to any screens.

Viewing 9 posts - 1 through 9 (of 9 total)
  • The forum ‘CSS’ is closed to new topics and replies.