好得很程序员自学网

<tfoot draggable='sEl'></tfoot>

可以请教关于自适应网页的问题吗?毕业设计急_html/css_WEB-ITnose

网页如下:在 @media screen and (max-width: 980px)等的那几个规则里该怎样写 可以做到随着 网页宽度的改变,DIv:content里的DIV:box能够适应网页大小而改变大小??














Demo: Responsive Design in 3 Steps











body {

font: 1em/150% Arial, Helvetica, sans-serif;

}

a {

color: #669;

text-decoration: none;

}

a:hover {

text-decoration: underline;

}

h1 {

font: bold 36px/100% Arial, Helvetica, sans-serif;

}

/************************************************************************************

STRUCTURE

*************************************************************************************/

#pagewrap {

padding: 5px;

width: 960px;

margin: 20px auto;

}

#header {

height: 180px;

}

#content {

width: 960px;

float: left;

}
#content .m1{
width:958px;
border:1px solid #eee;
height:240px;}
#content .m1 .box{
width:238px;
height:238px;
float:left;
border:1px solid #eee;}


#footer {

clear: both;

}

/************************************************************************************

MEDIA QUERIES

*************************************************************************************/

/* for 980px or less */

@media screen and (max-width: 980px) {

#pagewrap {

width: 94%;

}


}

/* for 700px or less */

@media screen and (max-width: 700px) {



}

/* for 480px or less */

@media screen and (max-width: 480px) {

#header {

height: auto;

}


}

/* border & guideline (you can ignore these) */

#content {

background: #f8f8f8;

}

#sidebar {

background: #f0efef;

}

#header, #content, #sidebar {

margin-bottom: 5px;

}

#pagewrap, #header, #content, #sidebar, #footer {

border: solid 1px #ccc;

}









Header





查看更多关于可以请教关于自适应网页的问题吗?毕业设计急_html/css_WEB-ITnose的详细内容...

  阅读:32次