Home › Forums › CSS › Issue with div not lining up when using media query › Reply To: Issue with div not lining up when using media query
March 2, 2014 at 2:43 am
#164488
Participant
When making this a specificity battle
@media screen and (max-width: 480px) {
#sidebar {
background: #fff;
margin-top: 20px;
padding: 2%;
width: 100%;
float: none !important;
}
}
Doing it like this, float: none !important
or float: left !important
will override the float: right
on the body #sidebar, body.ms #sidebar
outside of the media-query. Curious about the tools you use, and current workflow. Do you check your site sometimes with W3C validator?
Can you maybe share:
- why you prefer
id
– overclass
-selectors in yourCSS
- reasons why you use the
XHTML strict
doctype, instead of HTML5<!doctype html>
Seeing a lot of ‘issues’, and don’t want to be pedantic, for instance: including the jQuery library three times is supposedly by accident.