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

Home Forums CSS [Solved] Preventing Style Jump using Media Queries and Responsive Layouts?

  • This topic is empty.
Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
  • #151721

    We have a fairly large site with a fairly large CSS file. Plans are in the works to cut it down, HOWEVER, for now, is there a way to prevent or minimize the style jump on a page when the pages load. I am using @Media queries directly in the CSS file to ‘mobilize’ the site if it hits anything below 767px. I have been using the Media Queries in the style sheet and adjusting them for a few years now but I can not figure out the best way to minimize the layout jump from desktop to mobile when a mobile device hits the page. I have also tried pulling them out of the main style sheet and putting them in a separate ‘mobile’ stylesheet.

    Any ideas on how to do this or links on how to do this?


    No-one will see the ‘jump’, they’ll get served the styles appropriate to their device.

    The only people who see the ‘jump’ are people who resize their browsers…basically, web developers, who are used to it.



    Yeh, that is my issue though. I just realized. I don’t have an @Media query around the main desktop styles so it is more or less.

    /All my styles for everything: colors, font-family,desktop widths, etc./




    /My mobile styles/

    @media screen and (max-width: 767px){
    /My mobile styles here./





    So I am seeing the jump because I am serving the general desktop styles first for width, etc. and then the mobile styles kick in after those load.
    There is a jump no matter what.

    I am going to have to rethink my whole CSS when it is pertaining to fixed width and height elements and separate out the colors, fonts, etc. to other areas of the style sheet.

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