正如您從下面的代碼片段中看到的那樣,該文本出現在圖像下方。我如何製作它,使其看起來就在圖像旁邊?如何正確定位文字?
#pag{
margin-top: 20vh;
margin-right: 60vw;
height: 30vh;
width: 45vh;
}
#pa{
float: right;
margin-right: 8vw;
font-size: 60px;
font-family: Courier;
margin-bottom: 40vh;
}
<img id="pag" src="https://www.google.com/images/branding/googlelogo/2x/googlelogo_color_272x92dp.png">
<p id="pa">Google lorem ipsume lorem ipsumelorem ipsume</p>
http://stackoverflow.com/questions/16568272/why-doesnt-the-height-of-a-container-element-increase-if-it -contains-floated-el/16568504#16568504? –