Image 我能';t对齐我的div';It’她紧挨着

Image 我能';t对齐我的div';It’她紧挨着,image,html,alignment,next,Image,Html,Alignment,Next,我有两个div,它们位于一个div内。如代码中所示: Html: 所以我希望.赞助商和.text在.main中彼此相邻 但出于某种原因,这并没有发生。他们在一起。如何解决此问题?添加float:left,可能还有一个宽度 在这里了解更多 添加浮动:左侧,可能还有一个宽度 在这里了解更多 <div class="main" style="clear: both;"> <div class="text"> /text is her

我有两个div,它们位于一个div内。如代码中所示:

Html:

所以我希望.赞助商和.text在.main中彼此相邻
但出于某种原因,这并没有发生。他们在一起。如何解决此问题?

添加
float:left,可能还有一个宽度

在这里了解更多


添加
浮动:左侧,可能还有一个宽度

在这里了解更多

    <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>
.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;
}