.text { color: blue; }
@media only screen and (max-width:480px) {
.text { color: red; }
}
If we add this CSS:
@media only screen and (max-width:480px) {
.sidebar { display:none; }
.text { padding-left:33px; }
.gr-box { background-image:none; }
}
@media only screen and (max-width:480px), you'll add a class selector like .da-media[mobile], and it'll be magically transformed onto a media query wrapping that rule..da-media[mobile] .sidebar { display:none; }
.da-media[mobile] .text { padding-left:33px; }
.da-media[mobile] .gr-box { background-image:none; }
[mobile] is the only media type supported. We may add others in the future, which is why we decided to have it explicitly stated in the current code.- It's called "mobile", but that doesn't mean it'll only trigger when you're viewing the mobile version of dA. Anyone with a narrow enough browser window will see it. You can even watch it switching back and forth by resizing your window.
- "Narrow enough" in this case means 767px. We might choose to tweak this value in the future, if it seems to make sense to do so.
- This still won't help with pages like the blog index page, where you can have a pretty wide screen and still be forced into a narrow column.











This is the code I used:
The images I used for the header and footer, I noticed they get cut off when resizing a window, so I thought that mobile code would help with that. And I thought it was working okay, except, I found that one specific link messes it up, as though the window thinks it's smaller than it is or something, and the 109% code makes the footer huge. It doesn't seem to effect the header image, though.