<main style="overflow: hidden;">
<nav style="width: 25%;height: inherit; display: inline-block; float:left;">
<li><a href="index.html">Home</a></li><br>
<li><a href="archive.html">Archives</a></li><br>
<li><a href="about.html">About</a></li>
</nav>
<section>
<p style="padding: 10px;">hi</p>
</section>
</main>
如何在nav元素旁边启动section元素?
答案 0 :(得分:0)
将显示{:inline-block;
添加到您的section
元素:
<main style="overflow: hidden;">
<nav style="width: 25%;height: inherit; display: inline-block; float:left;">
<li><a href="index.html">Home</a></li><br>
<li><a href="archive.html">Archives</a></li><br>
<li><a href="about.html">About</a></li>
</nav>
<section style="display: inline-block;">
<p style="padding: 10px;">hi</p>
</section>
</main>