老师,发现显示在这个地方时,给article设置了宽度,但是好像没有用,图片还是超出了
*{
font-family: Arial;
font-size: 14px;
margin: 0;
padding: 0;
border: none;
}
a {
text-decoration: none;
}
ul{
list-style: none;
}
header{
height: 80px;
background: #000;
}
header > .container{
width: 1200px;
margin: 0 auto;
}
header > .container > a{
display: block;
float: left;
margin: 5px 25px;
}
header > .container > nav{
float: right;
}
header > .container > nav > a{
font-size: 24px;
display: block;
float: left;
height: 73px;
line-height: 73px;
width: 110px;
text-align: center;
color: #fff;
}
header > .container > nav > a.Home{background: #433b90;}
header > .container > nav > a.Course{background: #017fcb;}
header > .container > nav > a.Actual{background: #78b917;}
header > .container > nav > a.Plan{background: #feb800;}
header > .container > nav > a.FAQ{background: #f27c01;}
header > .container > nav > a.Notes{background: #d40112;}
header > .container > nav > a:hover,
header > .container > nav > a.active{
padding-bottom: 7px;
}
.banner{
background: #eaeaea;
}
.banner > ul{
position: relative;
width: 1490px;
height: 538px;
overflow: hidden;/*超出部分隐藏*/
margin: 0 auto;
}
.banner > ul > li{
position: absolute;
width: 610px;
height: 300px;
overflow: hidden;
}
.banner > ul > li.active{
z-index: 2;/*设置层级关系*/
top: 37px;
right: 0;
left: 0;/*居中显示*/
width: 960px;
height: 460px;
margin: auto;
border: 1px solid #fff;
}
.banner > ul > li.left{
z-index: 1;
top: 0;
bottom: 0;
left: 0;
margin: auto;
}
.banner > ul > li.right{
z-index: 1;
top: 0;
right: 0;
bottom: 0;
margin: auto;
}
.banner > ul > li > img{
position: absolute;
left: -30%;
height: 100%;
}
.main{
width: 1200px;
height: 473px;
margin: 34px auto 0;
}
.main h1{
font-size: 30px;
font-weight: lighter;
margin-bottom: 23px;
}
.main h1 > samp {
font-size: 30px;
color: #7c7c7c;
}
.main > aside {
float: left;
width: 450px;
}
.main > article {
float: right;
width: 720px;
overflow: hidden;
}
恭喜解决一个难题,获得1积分~
来为老师/同学的回答评分吧
0 星