我在一个div中有一个段落和一个图像,我正在尝试调整图像的上边距,使其在页面上稍微高一些,而不是与段落顶部对齐的图像顶部
#aboutmetext{
font-family:avenir,calibri;
font-size:30px;
color:white;
text-shadow:2px 2px 5px black;
width:45%;
float:left;
margin-left:5%;
margin-top:0%;
}
#picture{
float:right;
margin-right: 10%;
}
<div>
<p id="aboutmetext"><b>I am a visual effects & motion graphics
artist with a Bachelor of Science degree from The Art Institute of
Pittsburgh. My focus is in motion graphics and graphic design.</b></p>
<img src="http://moroccodunes.com/img/tours/14290060392.jpg" id="picture" class="bigEntrance" width="500px"
border="5" style="border-color:white;padding:5px">
</div>
答案 0 :(得分:0)
#aboutmetext{
font-family:avenir,calibri;
font-size:30px;
color:white;
text-shadow:2px 2px 5px black;
width:45%;
float:left;
margin-left:5%;
margin-top:0%;
}
#picture{
float:right;
width:45%;
margin-top:-50px;/* define the negative margin to your need */
}
&#13;
<h1>This is the title</h1>
<div>
<p id="aboutmetext"><b>I am a visual effects & motion graphics
artist with a Bachelor of Science degree from The Art Institute of
Pittsburgh. My focus is in motion graphics and graphic design.</b></p>
<img src="http://moroccodunes.com/img/tours/14290060392.jpg" id="picture" class="bigEntrance"
border="5px" style="border-color:white;padding:5px">
</div>
&#13;