Quick css question

Associate
Joined
25 Jul 2005
Posts
430
Hi guys, im trying to learn css but am having a few problems. Im trying to get the text on the left of the page to align left, but it refuses to move from the centre, can anyone see what im doing wrong?
http://four.fsphost.com/st00dent/test.html

Heres the css

/* CSS Document */
#container {
position:absolute;
top: 15%;
width:100%;
margin:0px;
border:1px solid gray
}

#left {
float:left;
border-right:1px solid gray
}

#main {
margin-left: 20%;
border-right:1px solid gray
}

ul.navgation {
list-style-type: none;
text-align: left
}
 
It is - <ul> just has a default margin :)

Add the following to the top of the CSS to remove all the default margins/padding which will simplify learning imo:)

Code:
* {
margin: 0;
padding: 0;
}
So what you write will be closer to what you actualy see as browsers won't show their default margin/paddings :)
 
Last edited:
Beansprout said:
It is - <ul> just has a default margin :)

Add the following to the top of the CSS to remove all the default margins/padding which will simplify learning imo:)

* {
margin: 0;
padding: 0;
}
[/code]
So what you write will be closer to what you actualy see as browsers won't show their default margin/paddings :)

Thanks, is this seen as bad practice in anyway? I will be assessed on this you see:)
 
st00dent said:
Thanks, is this seen as bad practice in anyway? I will be assessed on this you see:)

Not at all. You are just using CSS to affect the design of your page - exactly what it is for!
 
SherberT* said:
/OT Beansprout, are you still on holiday? :)
Nope :)

Thanks, is this seen as bad practice in anyway? I will be assessed on this you see
I shouldn't expect so - I use it a lot since there's so many differences in browsers. So your reasons for using it are not just convenience while learning, but also because each browser has its own different set of default margins/padding which can impede the layout of your page - therefore it's better to get rid of them than have them possibly cause trouble an a browser which you weren't to check or something :)

Marks++ :D
 
Back
Top Bottom