Note that there are some explanatory texts on larger screens.

plurals
  1. POSelect different CSS style sheet for different browser window sizes?
    primarykey
    data
    text
    <p>I have my div (#box) centering in the middle of the browser window which is groovy for browsers that are 600px vertical or taller. If the window is smaller than that, content at the top of the div gets sheared off, and the scroll bar only scrolls the page up (when I pull the scroll bar down), so it's impossible to see anything hidden above the top edge of the window even when the scroll bar is at its top-most position.</p> <p>Here's how I center my div--you can see why the top of the div gets cut off in smaller browser windows.</p> <pre><code>{position: absolute; top: 50%; left: 50%; width: 1930px; height: 607px; margin-left: -965px; margin-top: -302px;} </code></pre> <p>(It's really wide to accommodate the animation working on even the widest screens--the width isn't an issue.)</p> <p>Here's a page to look at: <a href="http://ianmartinphotography.com/test-site/" rel="nofollow">http://ianmartinphotography.com/test-site/</a><br> And my CSS: <a href="http://ianmartinphotography.com/test-site/css/basic.css" rel="nofollow">http://ianmartinphotography.com/test-site/css/basic.css</a></p> <p>This is easily fixed in my CSS style sheet, but it seems like I can't have it both ways for monitors greater than 600px and monitors smaller than 600px.</p> <p><strong>So, how do I detect a browser window size and then select one of two different CSS style sheets?</strong> One for small windows, another for larger windows? Is there a jquery script that will do this for me?</p> <p><strong>Or, is there another way to make my div center in the middle of the browser window with CSS</strong> that will allow scrolling so that the top of the div can be accessed on smaller browser windows?</p> <p>Thanks for your thoughts!</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload