Hey guys!
So I have started HTML for the first time yesterday, and CSS for the first time today, so please don't use advanced website admin lingo on me!
The code is short. I have a header, body, and footer, all in a container div, and I have a CSS style sheet that the HTML links to.
My issue?
My only issue currently lies with my most recent addition to the code: My navbar, which is basically an unorganized list of hyperlinks (<UL> tag). My CSS code gives it the horizontal navbar formation.
Onto the problem. Everything on my site centers perfectly, except for this navbar. Below is a picture of the website and the non-centered navbar.
Please note that the body, the title, and all of the other text IS aligned. The navbar circle in green is a little bit to far to the right.
HTML:
<HTML>
<link rel="stylesheet" type="text/css" href="style.css">
<div id="container">
<div id="header"><TITLE>DemonicMC - Stay Demonic!</TITLE>
<img src="images/demonicmc_title.png"><BR>
<P><B>Welcome to the DemonicMC community site!</B></P>
<a href="http://www.demonicmc.com">DemonicMC</a>
</div
<div id="body">
<div id="navbar">
<ul>
<li><a href="default.asp">Home</a></li>
<li><a href="news.asp">News</a></li>
<li><a href="contact.asp">Contact</a></li>
<li><a href="about.asp">About</a></li>
</ul>
</div>
<div style="background-image: url(images/content_bg.png); height: 100%; width: 900px; padding-top: 0px; margin-top: 0px;">
Body content!
</div>
<div id="footer">
Footer!
</div>
</HTML>
----------------------------------------
CSS:
html, #container, #body{
width:100%;
height:100%;
color:#FFFFFF;
}
#footer{
text-align:center;
position:relative;
bottom:0;
}
body
{
background-image:url('images/demonicmc_bg.png');
position:absolute;
background-repeat:repeat-y;
text-align: center;
font-family:"Carter One",Times New Roman,Georgia,Serif;
}
#header{
text-align: center;
}
#navbar ul li {
a:link color:#FF0000;
display: inline;
margin-left: auto;
margin-right: auto;
padding: 0em 0em;
background-color: #000000;
}
Nothing seems out of line to me. I don't see any factors that could cause it to become offset like this. Any ideas?
Thanks!
-Baker
So I have started HTML for the first time yesterday, and CSS for the first time today, so please don't use advanced website admin lingo on me!
The code is short. I have a header, body, and footer, all in a container div, and I have a CSS style sheet that the HTML links to.
My issue?
My only issue currently lies with my most recent addition to the code: My navbar, which is basically an unorganized list of hyperlinks (<UL> tag). My CSS code gives it the horizontal navbar formation.
Onto the problem. Everything on my site centers perfectly, except for this navbar. Below is a picture of the website and the non-centered navbar.
Please note that the body, the title, and all of the other text IS aligned. The navbar circle in green is a little bit to far to the right.

HTML:
<HTML>
<link rel="stylesheet" type="text/css" href="style.css">
<div id="container">
<div id="header"><TITLE>DemonicMC - Stay Demonic!</TITLE>
<img src="images/demonicmc_title.png"><BR>
<P><B>Welcome to the DemonicMC community site!</B></P>
<a href="http://www.demonicmc.com">DemonicMC</a>
</div
<div id="body">
<div id="navbar">
<ul>
<li><a href="default.asp">Home</a></li>
<li><a href="news.asp">News</a></li>
<li><a href="contact.asp">Contact</a></li>
<li><a href="about.asp">About</a></li>
</ul>
</div>
<div style="background-image: url(images/content_bg.png); height: 100%; width: 900px; padding-top: 0px; margin-top: 0px;">
Body content!
</div>
<div id="footer">
Footer!
</div>
</HTML>
----------------------------------------
CSS:
html, #container, #body{
width:100%;
height:100%;
color:#FFFFFF;
}
#footer{
text-align:center;
position:relative;
bottom:0;
}
body
{
background-image:url('images/demonicmc_bg.png');
position:absolute;
background-repeat:repeat-y;
text-align: center;
font-family:"Carter One",Times New Roman,Georgia,Serif;
}
#header{
text-align: center;
}
#navbar ul li {
a:link color:#FF0000;
display: inline;
margin-left: auto;
margin-right: auto;
padding: 0em 0em;
background-color: #000000;
}
Nothing seems out of line to me. I don't see any factors that could cause it to become offset like this. Any ideas?
Thanks!
-Baker