Forums

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

Home Forums CSS Responsive @media points

  • This topic is empty.
Viewing 7 posts - 1 through 7 (of 7 total)
  • Author
    Posts
  • #42903
    TWG
    Participant

    I have been playing with a local responsive layout based on Foundation by Zurb. I’ve set quite a few @media only points in my CSS and when I check how the page is responding to the different points, a few of them are having issues.

    I have points set at 320px, 480px, 600px, 800px, and 768px. I’ve set them with the following code:
    @media only screen and (max-width: ___px){ }

    I have my logo changing in all the break points but at 320 and 480 it only wants to read that change at 600px. Any help suggestions would be great.

    #125540
    Paulie_D
    Member

    Perhaps a link?

    #125546
    Paulie_D
    Member

    Yeah…Codepen for just bits relating to the Logo

    #125551
    Anonymous
    Inactive

    They should be in order starting from your widest media query (800px) on down.

    In CSS any change made to an element below an already set value will overwrite whatever was initially set (with a few exceptions).

    Therefore by putting them in order, whatever styles that are applied in your 320px query will overwrite what is in the 600px query because the 320px query is lower in the file.

    #125555
    Kitty Giraudel
    Participant

    Depends on your strategy. Mobile first or desktop first.

    #125564
    Paulie_D
    Member

    Codepen is not much help without some HTML…:)

    #125570
    Paulie_D
    Member

    >Depends on your strategy. Mobile first or desktop first.

    Actually it doesn’t.

    If there is a query that says JUST max-width 320px and another one **below it** with JUST max-width 800px the second will override any duplicated CSS.

    Mobile first refers to your design strategy…not CSS cascades.

    Or have I missed something?

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