浮动问题啊
<div class="about-bottom">
<div class="image">
<img src="images/b1.jpg" >
</div>
<div class="container">
<div class="triangle"></div>
<div class="container-common">
<span class="large">Libary Lab</span> <br>
<span class="mid">Lorem Ipsum is simply dummy test of the <br>
printing and typesetting industry</span> <br>
<span class="small">Lorem Ipsum has been the industry's standard dummy <br>
text ever since the 1500s,when an unknow printer took <br>
a galley of type and scrambled it to make a type <br>
specimen book.</span>
<div class="butt"><button>EXPORT</button></div>
</div>
<!-- <div class="butt"><button>EXPORT</button></div> -->
</div>
<div class="image">
<img src="images/b2.jpg" alt="">
</div>
<div class="container">
<div class="triangle"></div>
<div class="container-common">
<span class="large">Libary Lab</span> <br>
<span class="mid">Lorem Ipsum is simply dummy test of the <br>
printing and typesetting industry</span> <br>
<span class="small">Lorem Ipsum has been the industry's standard dummy <br>
text ever since the 1500s,when an unknow printer took <br>
a galley of type and scrambled it to make a type <br>
specimen book.</span>
<div class="butt"><button>EXPORT</button></div>
</div>
<!-- <div class="butt"><button>EXPORT</button></div> -->
</div>
<div class="container1">
<!-- <div class="triangle2"></div> -->
<div class="container-common">
<span class="large">Libary Lab</span> <br>
<span class="mid">Lorem Ipsum is simply dummy test of the <br>
printing and typesetting industry</span> <br>
<span class="small">Lorem Ipsum has been the industry's standard dummy <br>
text ever since the 1500s,when an unknow printer took <br>
a galley of type and scrambled it to make a type <br>
specimen book.</span>
<div class="butt"><button>EXPORT</button></div>
</div>
<!-- <div class="butt"><button>EXPORT</button></div> -->
</div>
</div>
</div>
上面是html代码
.about .about-bottom{
width: 100%;
overflow: hidden;
zoom:1;
/*background: red;*/
}
.about .about-bottom .image{
width: 25%;
float: left;
position: relative;
}
.about .about-bottom img{
width: 100%;
height:260px;
}
.about .about-bottom .container{
width: 25%;
position: relative;
float: left;
background: #07cbc9;
}
.about .about-bottom .container1{
width: 25%;
/*position: relative;*/
float: left;
background: #07cbc9;
}
.about .about-bottom .container .container-common{
height: 240px;
padding: 10px;
}
.about .about-bottom .container .butt{
position: absolute;
width: 40px;
left:50%;
margin-left: -40px;
margin-top:30px;
}
.about .about-bottom .container .container-common .butt button{
background: #000;
border: 1px solid #000;
padding: 7px 10px;
color: #ffffff;
}
.about .about-bottom .container .container-common .butt button:hover{
background: #ffffff;
color: #000;
cursor: pointer;
}
.about .about-bottom .container .container-common .large{
font-size: 20px;
font-family: "Microsoft YaHei UI";
color: #ffffff;
}
.about .about-bottom .container .container-common .mid{
font-size: 14px;
font-family: "Microsoft YaHei UI";
color: #ffffff;
}
.about .about-bottom .container .container-common .small{
font-size: 10px;
font-family: "Microsoft YaHei UI";
color: gray;
}
.about .about-bottom .triangle{
position: absolute;
top:50%;
margin-top:-15px;
left:-35px;
float: left;
border:20px solid #07cbc9;
width: 0;
height: 0;
border-left: 15px solid transparent;
border-top: 15px solid transparent;
border-bottom: 15px solid transparent;
}
上面是css样式代码。
运行结果如下:
请问老师container1为什么没浮动在左边?
正在回答
正常设置浮动是可以向左排列的,但是由于你的container-common高度设置的较低,所以导致布局变形,如下图所示,将height设置为245,不清除浮动也是可以进行排列的,
效果如下图所示,建议同学不要着急,根据所学过的知识,慢慢调试并完成本次作业,本次作业的难度不低,能独立完成本次作业对你来说也是很大的一个提高,如果有什么不明白的地方可以在问答区继续提问,祝学习愉快~
同学不是想将文字移动到最左边吗?清除左边的浮动之后就可以了呀,下图是效果图。祝学习愉快~
你可以清除一下左浮动试试,如下图所示,依旧保留container1的浮动效果,但是清除container左边的浮动效果,祝学习愉快~
- 参与学习 人
- 提交作业 1088 份
- 解答问题 10205 个
如果你有Java语言基础,又想以后从事Java Web开发,那么本路径是你的不二选择!本路径从网页搭建开始入手,通过大量案例来学习Java Web基础。定能助你完成Java Web小白的蜕变!
了解课程
恭喜解决一个难题,获得1积分~
来为老师/同学的回答评分吧
0 星