June 11th, 2013, 01:45 PM
Help positioning container
I have been learning CSS and it seems pretty straight forward thus far.
I am, however, having a positioning issue. I am attempting to use a div container to put my navbar and search bar in. But when I decrease my browser window, the div container does not stay centered(just kind of stays to the right).
The following is the css i used:
border: 4px inset #66cccc;
and the following is the HTML:
<li><a href="URL here">Home</a></li>
<li><a href="URL here">Contact</a></li>
<li><a href="URL here">Things</a></li>
<form id="searchbox" method="get" action="URL here" align="center">
<input id="search" type="text" placeholder="Google it..." name="q" maxlength="255" value="">
<input id="submit" type="submit" value="Search">
Any suggestions would be swell!
June 11th, 2013, 06:32 PM
try setting your margin-left/margin-right to auto instead of an actual pixel value.
And your closing </h2> , </form> and </div> items are in wrong order.
Last edited by DonR; June 11th, 2013 at 06:35 PM.
June 12th, 2013, 09:37 AM
Originally Posted by DonR
Thank you, that did the trick. Like I said, I am new to this. Just started learning a few days ago. I greatly appreciate the help! Have a wonderful day.