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

Home Forums CSS media queries question…

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

    Hello all,

    First thenk you for taking the time to read this.

    Working on a site that has a ratehr extinsive style sheet and I want to make a mobile version using media queries.

    The question on my mind would be, is there a way to (without touching the html) a way to create in the css mobile version of the classes used and then add a line of javascript that will detect the users device (computer or mobile) and toggle between the .screen-only classes and the .mobile-only classes.

    In other words I have in the actual HTML:

    PLEASE NOTE: To view the documents, you will need a copy of Adobe® Reader® loaded on your computer.

    I would like to have two versions of “sideContainer” defined in my CSS and depending on the users screen a javascript that will serve the correct set of classes.

    Has anyone seen and example of this being done?


    If you are using media queries, why do you need javascript?

    Device &/or Browser detection is not recommended (AFAIK) these days.

    Feature detection is more appropriate.

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