| Home | Register | FAQ | Members List | Search | Today's Posts | Mark Forums Read |
|
|
#1 (permalink) |
|
Registered User
Join Date: Aug 2005
Posts: 38
|
Please Explain CSS Style Differences
This is basic stuff and im quite new to this but can someone explain the difference between styles using # and . and ones without. I can't find any basic sites explaining it and its just totally confusing me at the mo!!? And how from a linked external css file can you get all the page margins to zero or do you have to do that in the actual page? Im also looking to have a constant footer at the base of my page say 40px tall but when i put it in it lines up completely differently to the rest of the page? Thanks for any help Dave |
|
|
|
|
|
#2 (permalink) |
|
dt immigrant
|
# = ids - these are unique can only be applied once per page (div id="header") . = classes - these can be applied to several items on the same page, and can be combined (<p class="whiteText">, <a class="whiteText">, <p class="witheText bold">) there is no sign before HTML tags (body, div, a, etc) to have zero margins use in your CSS body {margin:0px; padding:0px;} |
|
|
|
#3 (permalink) | |
|
i'm done, son
Join Date: Jan 2005
Posts: 12,262
|
Quote:
To remove all margins and padding from every HTML element on the page, I always start my stylesheets with... Code:
|
|
|
|
|
#5 (permalink) |
|
Registered User
Join Date: Aug 2005
Posts: 38
|
Ok cheers guys, in terms of making say a box which is it better to use a (#) or (.) style And why has PGO used a (*) *{ padding: 0; margin: 0; } what does that symbolise is that refering to everything instead of putting body there? |
|
|
|
#6 (permalink) |
|
I like code.
|
If you are making a box you can do it with eiter Id's or Class's but try an ID, like something like this. Code:
Code:
That will make you a 200x200 box with a black border. But I think you sould already know that. Any way just try something like that. Oh, and yes the * is for all like you can use that in PHP (SELECT * FROM table). Hope that helped. |
|
|
|
#7 (permalink) | |
|
Barney army!
Join Date: Mar 2003
Location: London
Posts: 696
|
Quote:
Er, thats SQL, not PHP. Luke Redpath .::. Software Engineer .::. Reevoo - Real Reviews From Real Customers
|
|
|
|
|
#10 (permalink) | |
|
dt immigrant
|
Quote:
|
|
|
![]() |