为了实现移动友好,我实施了@cch友好建议的媒体查询.它有效地隐藏了"旁边"(侧边栏),但未能将"文章"(主要)扩展到所有浏览器和所有设备上的结果空白区域.我究竟做错了什么?
CSS后跟HTML:
@media screen and (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%;
}Run Code Online (Sandbox Code Playgroud)
<article id="main">
<h2>The Advanced ON-SITE Advantage</h2>
<p>As a service for maintaining shades, shutters, blinds, and drapes through occasional cleaning and repair, you can be confident we're supremely qualified. </p>
<p>Correct identification of the many fabrics and coatings used in draperies, shades and top …Run Code Online (Sandbox Code Playgroud)