Note that there are some explanatory texts on larger screens.

plurals
  1. PObuilding my first navigation bar?
    primarykey
    data
    text
    <p>OK! I just started HTML and CSS today and thought it would be a good approach to learn by building something rather than just reading some text.</p> <p>[ <a href="http://jsfiddle.net/GUkrK/" rel="nofollow">http://jsfiddle.net/GUkrK/</a> ]</p> <p>So I decided to build one sample navigation bar. </p> <pre><code>&lt;html&gt; &lt;head&gt; &lt;title&gt; navigation bar &lt;/title&gt; &lt;link rel="stylesheet" type="text/css" href="menu.css"&gt; &lt;/head&gt; &lt;body&gt; &lt;ul id="menu"&gt; &lt;li id="menu1"&gt; &lt;a href="http://www.google.com"&gt; &lt;span&gt;GOOGLE&lt;/span&gt; &lt;/a&gt; &lt;/li&gt; &lt;li id="menu2"&gt; &lt;a href="http://www.github.com"&gt; &lt;span&gt;GITHUB&lt;/span&gt; &lt;/a&gt; &lt;/li&gt; &lt;li id="menu3"&gt; &lt;a href="http://www.quora.com"&gt; &lt;span&gt;QUORA&lt;/span&gt; &lt;/a&gt; &lt;/li&gt; &lt;li id="menu4"&gt; &lt;a href="http://www.facebook.com"&gt; &lt;span&gt;FACEBOOK&lt;/span&gt; &lt;/a&gt; &lt;/li&gt; &lt;/ul&gt; &lt;hr/&gt; &lt;/body&gt; &lt;/html&gt; </code></pre> <p>and the css</p> <pre><code>ul { list-style:none; color:red; } #menu { float:left; vertical-align:middle; display:block; width:600px; height:108px; } #menu li { display:inline; font-size:20px; padding:0px; } #menu a:link { color:white; font-weight:bold; padding:20px; background-color:#27A285; } #menu a:hover { background-color:#E1C618; color:brown; } hr { height:5px; background-color:red; } </code></pre> <p>But now my problem is the positioning of that horizontal line. Do I have to place that by setting the pixels in absolute or relative positioning? Can't it be done automatically? And how come the horizontal line does not cover the total width of the browser? and Can I adjust the width of that horizontal line?</p> <p><strong>EDIT:</strong> <em>Thanks everyone. Here is the edited sample <a href="http://jsfiddle.net/sunu0000/zdDU5/" rel="nofollow">http://jsfiddle.net/sunu0000/zdDU5/</a></em></p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

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