我目前的代码是这样的:
<section><iframe id="frame1" width="675" height="380" src="http://www.youtube.com/embed/hmAFhsxWhdY" frameborder="0" allowfullscreen></iframe></section>
<section><textarea rows="24" cols="25" id="desc" width="200" height="478">Text here</textarea></section>
我的作业要求我在 iframe 和 textarea 上都使用 section 标签,但我需要它们并排排列。当我把它们的部分标签拿走时,它们排列得很好,但我需要保留部分标签。我如何让它像 2 列一样排列但仍然保留标签?
最佳答案
使用CSS styles与 css selectors看看float .
快速而肮脏的修复:
<section style="float:left; width:675px;"><iframe id="frame1" width="675" height="380" src="http://www.youtube.com/embed/hmAFhsxWhdY" frameborder="0" allowfullscreen></iframe></section>
<section style="float:left; width:200px;"><textarea rows="24" cols="25" id="desc" width="200" height="478">Text here</textarea></section>
关于html - css - 并排制作两个 <section> 标签,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/16351985/