css - Add background color to extra small devices navigation -
I'm developing a bootstrap responsive theme here: URL to add a background which only works on small devices Does, any class is connected to my problem which is waiting for a good solution. thank you in advanced.
The solution is to use a CSS. A block of CSS from a media query is applied only when certain criteria (like screen size) are found. According to the Mozilla Developer's Network, the definition of media queries is given here:
A Media query contains at least one type of media expression and style sheets Fields using media attributes, such as width, height, and color. Media queries, which have been added to CSS3, should make content presentation consistent with output devices of a particular category, without changing the content
For red examples, you can use the following code snippet if you only want a handheld device:
@ media hands In {body {background: red; Alternatively, if you only want devices that have a red background screen width 200px or less you will use it. The following code snippet:
@ Media (max-width: 200px) {body {background: red; Disclaimer: When targeting a mobile device, you should be aware of some "meet". The first, and the most problematic, is the difference between "device pixel" and "screen pixel". You can read more about that problem and how to address it. Also, keep in mind that most mobile browsers fly on the landscape And is designed to switch between portrait displays - but this is not much of a problem, because the media-query also has screen orientation assay You can be of use. / P>
Comments
Post a Comment