Note that there are some explanatory texts on larger screens.

plurals
  1. POHow do I line up CSS elements? Is there a tool I can use?
    text
    copied!<p>In light of the answers to the original question I had, I have amended my code. I was hoping if someone could tell me if this is a better approach in comparison. My original post and code is below. </p> <p><strong>UPDATED CODE</strong></p> <pre><code>&lt;!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"&gt; &lt;html xmlns="http://www.w3.org/1999/xhtml"&gt; &lt;head&gt; &lt;meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /&gt; &lt;meta http-equiv="Content-Language" content="en-us" /&gt; &lt;meta name="keywords" content="" /&gt; &lt;meta name="description" content="" /&gt; &lt;meta name="author" content= "" /&gt; &lt;title&gt;Example&lt;/title&gt; &lt;base href="" /&gt; &lt;link rel="stylesheet" type="text/css" href="" /&gt; &lt;style type="text/css"&gt; * { margin: 0; padding: 0; } #wrapper { } #header { background-image: url('images/bg-inner-page.gif'); height: 200px; } #logo { float: left; margin-top: 50px; margin-left: 100px; } #topnav { float: right; margin-top: 50px; margin-right: 1250px; } #topnav ul { word-spacing: 10px; } #topnav ul li { list-style-type: none; display: inline; } #content { background-color: orange; } #footer { background-color: blue; } &lt;/style&gt; &lt;/head&gt; &lt;body&gt; &lt;div id="wrapper"&gt; &lt;div id="header"&gt; &lt;div id="logo"&gt; logo &lt;/div&gt; &lt;div id="topnav"&gt; &lt;ul&gt; &lt;li&gt;home&lt;/li&gt; &lt;li&gt;about&lt;/li&gt; &lt;li&gt;browse&lt;/li&gt; &lt;li&gt;faq&lt;/li&gt; &lt;li&gt;contact&lt;/li&gt; &lt;/ul&gt; &lt;/div&gt; &lt;/div&gt; &lt;div id="content"&gt;content&lt;/div&gt; &lt;div id="footer"&gt;footer&lt;/div&gt; &lt;/div&gt; &lt;/body&gt; &lt;/html&gt; </code></pre> <p><strong>ORIGINAL POST</strong></p> <p>I am new to the world of coding as well as CSS. I am attempting to line up CSS elements however unaware how I can place some sort of lines to get the exact line-height, position, etc. I attempted to use FireBug however to no avail. Is there some of tool I can use that possible places a grid over the canvas?</p> <p><strong>EDIT</strong></p> <p>Here is a sample of the code I am working with.</p> <pre><code>&lt;!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"&gt; &lt;html xmlns="http://www.w3.org/1999/xhtml"&gt; &lt;head&gt; &lt;meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /&gt; &lt;meta http-equiv="Content-Language" content="en-us" /&gt; &lt;meta name="keywords" content="" /&gt; &lt;meta name="description" content="" /&gt; &lt;meta name="author" content= "" /&gt; &lt;title&gt;Example&lt;/title&gt; &lt;base href="" /&gt; &lt;link rel="stylesheet" type="text/css" href="" /&gt; &lt;style type="text/css"&gt; body { margin: 0; padding: 0; } #wrapper { } #header { background-image: url('images/bg-inner-page.gif'); height: 200px; } #logo { width: 20px; position: relative; top: 50px; left: 100px; } #topnav { width: 500px; position: relative; top: 14px; left: 150px; } #topnav ul { word-spacing: 10px; } #topnav ul li { list-style-type: none; display: inline; word-spacing: 10px; } #content { background-color: orange; } #footer { background-color: blue; } &lt;/style&gt; &lt;/head&gt; &lt;body&gt; &lt;div id="wrapper"&gt; &lt;div id="header"&gt; &lt;div id="logo"&gt; logo &lt;/div&gt; &lt;div id="topnav"&gt; &lt;ul&gt; &lt;li&gt;home&lt;/li&gt; &lt;li&gt;about&lt;/li&gt; &lt;li&gt;browse&lt;/li&gt; &lt;li&gt;faq&lt;/li&gt; &lt;li&gt;contact&lt;/li&gt; &lt;/ul&gt; &lt;/div&gt; &lt;/div&gt; &lt;div id="content"&gt;content&lt;/div&gt; &lt;div id="footer"&gt;footer&lt;/div&gt; &lt;/div&gt; &lt;/body&gt; &lt;/html&gt; </code></pre>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload