私は2つのセクションが互いに隣り合っているウェブサイトデザインに取り組んでいますが、何らかの理由で1つのセクションが別のセクションの下に入ります。誰かが問題を見つけるのを助けることができますか?ありがとう!2つのセクションを同じ行に保存するにはどうすればよいですか?
HTMLコード:
<section id="sec1">
<img src="https://tse1.mm.bing.net/th?&id=OIP.Mbd6b4f30000f7e872ca4c55c2cedd6fao0&w=300&h=215&c=0&pid=1.9&rs=0&p=0&r=0" id="img1">
<h6 class="bodytext">Watershed Definition</h6>
<p class="bodytext">A ridge or area of land that separates waters flowing to different rivers, basins, or seas</p>
</section>
<section id="sec2">
<img src="http://www.nature-education.org/estuary.gif" id="img1">
<h6 class="bodytext">Estuary Definition</h6>
<p class="bodytext">An arm or inlet of the sea at the lower end of a river or body of water.</p>
</section>
CSSコード:
#sec1 {
background-color: #75c776;
width: 400px;
height: 550px;
margin-left: 300px;
margin-top: 40px;
border-radius: 5px;
border-style: solid;
clear: right;
}
#sec2 {
background-color: #75c776;
width: 400px;
height: 550px;
margin-left: 800px;
margin-top: 40px;
border-radius: 5px;
border-style: solid;
clear: left;
}
'display:inline'または' float:left'を使用します。 – rafaelcastrocouto