PDA

View Full Version : Bit of coding help?



Bojangles
02-03-2008, 07:34 PM
Okay so I'm coding a layout for gangster but I need everything to be centred.. Also I need the black gradient fixed to the top of the page. And so the banner isn't fixed onto the blackgradient. This is the code, what shall I change?

<html>
<head>
<title>Test</title>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<style type="text/css">
<!--
body,td,th {
font-family: Verdana;
font-size: 10px;
color: #000000;
}
body {
background-color: #9BCDFF;
text-align: center;
}
#top {
height: 32px;
width: 900px;
background-image: url(images/topgradient.gif);
padding-top: 5px;
}
#banner{
height: 133px;
width: 850px;
background-image: url(images/banner.gif);
}



-->
</style></head>
<body>
<div id="top"></div>
<div id="banner"></div>

</body>
</html>What bits do I need to change, if any?

EDIT: I have sorted the centering problem, just need the blackgradient to be up the top and a way to move the banner down from the blackgradient.

kk.
02-03-2008, 07:46 PM
hey sorry I couldn't help earlier

On the body, put

margin-left: auto
margin-right: auto

Don't understand the other question

Bojangles
02-03-2008, 07:54 PM
Oops forgot to give some linkage :) http://www.igoboy.com/gangster/index.html
What I want to do is seperate the black gradient, the banner, and the red bit.

kk.
02-03-2008, 08:03 PM
k did the other thing work. And also, add margin-bottom: 5px (the value you want). Add this tithe bottom of the div attributes

Bojangles
02-03-2008, 08:15 PM
Haha :D Thanks and yea it did :)

kk.
02-03-2008, 08:22 PM
no problem
also, add padding on the right and left side divs where the marquees are, it goes over the borders LOL

Bojangles
02-03-2008, 08:23 PM
Oops :) Also why won't the boxes expand?:S

kk.
02-03-2008, 08:27 PM
make sure that you have a top
middle and bottom and ur typing in the middle one lol
bit obvious but you know

Bojangles
02-03-2008, 08:30 PM
<div id="navtop"></div>
<div id="navmiddle">ggggggggggggggg</div>
<div id="navbottom"></div>
I am typing in the middle.
www.igoboy.com/gangster

kk.
02-03-2008, 08:41 PM
k I think I know
Add a height to the navmiddle attribute the same as the text font (12px) it should work

Hypertext
02-03-2008, 08:46 PM
Do you even need margin-right? I think not, also if you want it completely centered eg vertically too, use vertical-align: or use margin-top

kk.
02-03-2008, 08:50 PM
I know you can use margin: auto aswell, its just easier to explain.. Anyway theirs a new question

Want to hide these adverts? Register an account for free!