- This topic is empty.
Viewing 9 posts - 1 through 9 (of 9 total)
Viewing 9 posts - 1 through 9 (of 9 total)
- The forum ‘CSS’ is closed to new topics and replies.
The forums ran from 2008-2020 and are now closed and viewable here as an archive.
Am new with css media query and i have created a media rule for a particular device viewport and this media rule has its css styles in it . But the problem is that when i increase from maybe 319px to 320px the same css rule in 319px is still seen in 320px until when i increase to maybe 340px that’s when the css rule for 320px will come to play. Please someone should tell me where am getting it wrong . Thank you guys.
We’d need to see the code.
@media screen and (min-device-width: 50px) and (max-device-width: 319px) and (orientation : portrait) {
body {
background: black;
}
}
@media screen and (min-device-width: 320px) and (max-device-width: 359px) and (orientation : portrait) {
body {
background: green;
}
}
this is the code Thank you Mr Paulie_D
this is also my viewport meta description:
<meta name=”viewport” content=”width=device-width, initial-scale=1″>
Hmmm…perhaps you could make a demo showing the problem?
I’m not sure you need the device-width
in the media query though…the meta
tag takes care of that for you.
Am also using bootstrap and it has it’s own media query rule . though I created some of the css so I need to create my media query rule that will work the way I want it.
Might this be the problem?
Possibly but until we see a demo it’s hard to help.
Thank you sor