uxk8396
Oct 11 2008, 11:22 AM
Hi,
In what circumstances do we use a div Id and a div class in CSS?
Regards,
Darin McGrew
Oct 11 2008, 02:00 PM
Are there going to be more than one of them? If so, then you must use CLASS.
Is there going to be only one of them? If so, then you can use either.
Using ID is appropriate when the name identifies the element uniquely and clearly.
pandy
Oct 11 2008, 04:13 PM
The usefulness of id lies in its high specificity.
'#foo p' will always override '.bar p', but '.foo p' will only override '.bar p' if it comes later in the cascade.
uxk8396
Oct 11 2008, 09:43 PM
Hello,
Is there a way to use a property in CSS in order to center the navigation bar?
I cannot get it centered for some obvious reason.
How do you check if your codes are OK in Dreamweaver, just like in Flash we can check syntax for errors.
Thank you very much.
pandy
Oct 11 2008, 10:00 PM
It depends on what you want to center. Inline elements or a block.
http://www.w3.org/Style/Examples/007/center.htmlFor CSS use w3c's checker.
http://jigsaw.w3.org/css-validator/For HTML use the validator at this site or the w3c one.
http://htmlhelp.com/tools/validator/http://validator.w3.org/They can all do local files. I have no idea what can be integrated in DW or already is.
uxk8396
Oct 11 2008, 10:32 PM
Hi,
Thank you for the prev reply.
I tried using margin:auto in my CSS file to get the navigation (se attached file in previous post) but could not do it. Am I missing some step here, for instance to creating a container
first, set its width and height, center it and then position the nav inside the container. I am confused, please advise.
pandy
Oct 11 2008, 10:42 PM
Do you want it centered on the page? Then don't float it left.
uxk8396
Oct 12 2008, 01:47 PM
Hi,
I still cannot get the navigation to be on the centered on the screen. Please take a look at the attachment to suggest where I am going wrong.
Thanks again
uxk8396
Oct 12 2008, 02:15 PM
QUOTE(uxk8396 @ Oct 12 2008, 01:47 PM)

Hi,
I still cannot get the navigation to be on the centered on the screen. Please take a look at the attachment to suggest where I am going wrong.
Thanks again

I got it to work finally by setting the width of the #nav to 585 px, and margin:auto
Thank you
This is a "lo-fi" version of our main content. To view the full version with more information, formatting and images, please
click here.