我有一个有2个不同div的div。这三个图片中的每一个都有一个宽度为60%的图片和一些文字(40%),但是它根本没有排列。文本位于正确的位置,图片位于正确的组织中,但它们距页面太远。我新望对CSS,我不知道如何解决这个混淆为什么这些图片和文字没有排队
这里是什么样子
HTML图片:
<div class="section 1">
<p id="section1text">
<b>ME</b><br>Hello! My name is Max Jordan. I am a student living in the UK currently doing A-Levels in Maths, Engineering, Physics and computer science. I then want to do a degree in computer science and work as a Software Engineer/Developer. I currently live in Nottingham in the UK. I love programming and creating elegant soloutions for problems.
</p>
<img src="section1.jpg" id="section1pic">
</div>
<div class="section 2">
<p id="section2text">
<b>WORK</b><br>
</p>
<img src="section2.jpg" id="section2pic">
</div>
<div class="section 3">
<p id="section3text">
</p>
<img src="section3.jpg" id="section3pic">
</div>
CSS:
.aboutSection{
width: 100%;
height:100%;
}
.section{
text-align: center;
display: inline-block;
width: 90%;
height: 20%;
margin-left: 5%;
}
#section1text{
float: left;
display: inline-block;
height: 100%;
width:40%;
background-color: #3399ff;
color: white;
font-size: 20;
padding: 10px;
}
#section2text{
float: right;
height: 100%;
width:40%;
float: right;
background-color: #3399ff;
color: white;
font-size: 20;
display: inline-block;
padding: 10px;
}
#section3text{
float: left;
height: 100%;
width:40%;
background-color: #3399ff;
color: white;
font-size: 20;
display: inline-block;
padding: 10px;
}
#section1pic{
float: right;
position:relative;
display: inline-block;
height: 100%;
width: 60%;
}
#section2pic{
float: left;
position:relative;
display: inline-block;
height: 100%;
width: 60%;
}
#section3pic{
float: right;
position:relative;
display: inline-block;
height: 100%;
width: 60%;
}
我知道CSS是非常糟糕的,但我只是想让它工作。
你可以简单介绍一下它的外观吗 – Geeky
https://gyazo.com/22b24142b2d557e9fe2bdd4e9ee17b9f – mexO