Html – css – Make two
tags side by side

csshtmlsections

My current code is this:

<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>

My assignment requires me to use the section tag on both the iframe and the textarea, but I need them to line up side by side. When I take they section tags away, they line up perfectly, but I need to keep the section tags. How do I get this to line up like 2 columns but still keep the tags?

Best Solution

Use CSS styles with css selectors and look at float.

Quick and dirty fix:

<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>