我有2个div,属于div。就像在代码中一样:
HTML:
<div class="main" style="clear: both;">
<div class="text">
/text is here
</div>
<div class="sponsors">
<img src="images/Sponsors/asfalpan.png" alt="Asfalpan" width="285">
</div>
</div>
Css:
.main {
width: 1000px;
margin-left: auto;
margin-right: auto;
position:relative;
background-color:#232021;
border-radius: 50px;
}
.text {
width: 700px;
padding-left:10px;
padding-top: 20px;
padding-bottom: 20px;
position:relative;
font-family: Gisha;
color: white;
font-size:14px;
}
.sponsors {
margin-left: 710px;
margin-top: 20px;
position: relative;
font-family: Gisha;
color: white;
font-size: 14px;
background-color: #E5173E;
}
所以我希望.sponsors和.text在.main中彼此相邻 但由于某种原因,这不会发生。它们出现在彼此之下。我该如何解决这个问题?