html - Why Are My Media Query's Instructions not Honored 100% On Some Devices -
in effort become mobile friendly have implemented media query kindly suggested @cchacholiades. hides "aside" (sidebar) effectively, fails expand "article" (main) resulting empty space in browsers , on devices. doing wrong?
css followed html below:
@media screen , (max-width: 750px) { aside { display: none; } article { width: 100%; } } #main { width: 58%; float: left; margin-left: 2%; } #sidebar { float: left; width: 34%; margin-left: 4%; }
<article id="main"> <h2>the advanced on-site advantage</h2> <p>as service maintaining shades, shutters, blinds, , drapes through occasional cleaning , repair, can confident we're supremely qualified. </p> <p>correct identification of many fabrics , coatings used in draperies, shades , top treatments critical safe, yet effective, cleaning of these items. advanced on-site certified that. it's why we're able <a href="guarantee.html">guarantee</a> against shrinkage or damage.</p> <p><span class="centered"> <figure> <img src="images/cleaninstall.jpg" width="400" height="225"> <figcaption>flawless cleaning , installations</figcaption> </figure> </span> likewise, window coverings installed advanced on-site not suffer poor funtionality due improper installation. best materials , fasteners used, , great care taken ensure every component enjoys complete freedom of movement imperative long life.</p> </article> <aside id="sidebar"> <h2>tip</h2> <p>window coverings damaged through incorrect operation. following suggestion increase life expectancy.</p> <blockquote> <p><strong>never let go of cord until know has come rest:</strong></p> <p>shades , blinds modern retractable mechanisms typically use control cord assemblies. these incorporate hard connectors can damage delicate components on impact. traditional cord-lock mechanisms, cord should not released until "catch" engaged. prevents bottom-heavy shade crashing onto sill.</p> </blockquote> <p>even when foregoing observed, sun damage , simple wear may render occassional repair necessary. if happens call us.</p> </aside>
thanks in advance,
dave
selector #main
has higher specificity article
, width still 58% when media query matches.
chose selector higher specificity formatting of article inside media query; or, if want 1 same, place media query below general formatting.
Comments
Post a Comment