13 replies [Last post]
lipets
Offline
newbie
Last seen: 17 years 8 weeks ago
Joined: 2005-12-15
Posts: 9
Points: 0

It looks ok in IE and Opera and is left justified,

FF centers the list? url

Any ideas?

Jack

Anonymous
Anonymous's picture
Guru

Nested list centered in Firefox

No DOCTYPE.

lipets
Offline
newbie
Last seen: 17 years 8 weeks ago
Joined: 2005-12-15
Posts: 9
Points: 0

Nested list centered in Firefox

Can't find one to work?

Anonymous
Anonymous's picture
Guru

Nested list centered in Firefox

lipets wrote:
Can't find one to work?
Huh?

lipets
Offline
newbie
Last seen: 17 years 8 weeks ago
Joined: 2005-12-15
Posts: 9
Points: 0

Nested list centered in Firefox

I tried three or four they all came up with errors thru the validator?

Which one do you suggest?

I put it in.

Anonymous
Anonymous's picture
Guru

Nested list centered in Firefox

lipets wrote:
I tried three or four they all came up with errors thru the validator?
The errors are not caused by the doctype. The errors are caused by the use of deprecated elements and attributes and the improper use of current elements and attributes.

Did I spot an image map in there?

lipets
Offline
newbie
Last seen: 17 years 8 weeks ago
Joined: 2005-12-15
Posts: 9
Points: 0

Nested list centered in Firefox

The mapping is for the heading links.

So based on what you're seeing in the source code which DOC type is most appropriate, and then the errors can be fixed I suppose?

Any Idea why it looks ok besides that the DOC is not there?

lipets
Offline
newbie
Last seen: 17 years 8 weeks ago
Joined: 2005-12-15
Posts: 9
Points: 0

Nested list centered in Firefox

Ok, did some searching and chose this one

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"

"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">

I stripped down the elements to focus on the left nav bar nested list.

gary.turner
gary.turner's picture
Offline
Moderator
Dallas
Last seen: 1 year 48 weeks ago
Dallas
Timezone: GMT-6
Joined: 2004-06-25
Posts: 9776
Points: 3858

Nested list centered in Firefox

IE and Opera use margin-left to control the list indention, while Moz and KHTML/Safari use padding-left. You set the margin, which works for IE and Opera because they have no padding set. Moz and Safari, otoh, now have a margin-left and 40px of padding. Simply add the rule ul {padding: 0;}.

Since you were happy with IE and unhappy with Firefox, it is plain that you're developing with IE as your test bed. This is a Bad Thing®. If you code against a buggy browser, you will write buggy code. Use Firefox as your prime browser—even if your target audience is overwhelmingly saddled with IE.

Oh, and do not put style rules within the html tags. Embed all rules, during development, in the head. You can move them to an external file when you've got things right.

cheers,

gary

If your web page is as clever as you can make it, it's probably too clever for you to debug or maintain.

lipets
Offline
newbie
Last seen: 17 years 8 weeks ago
Joined: 2005-12-15
Posts: 9
Points: 0

Nested list centered in Firefox

kk5st wrote:

Oh, and do not put style rules within the html tags. Embed all rules, during development, in the head. You can move them to an external file when you've got things right.

cheers,

gary

Thanks Gary,

What do you mean which style rules?
How would I add them correctly to the stylessheet?

Styles

Thanks
Jack

Tyssen
Tyssen's picture
Offline
Moderator
Brisbane
Last seen: 8 years 16 weeks ago
Brisbane
Timezone: GMT+10
Joined: 2004-05-01
Posts: 8201
Points: 1386

Nested list centered in Firefox

He means stuff like this:

<ul style="margin-left:15px;"> should go in your stylesheet, not your HTML, e.g.:

/* CSS */
ul { margin-left: 15px; }

How to get help
Post a link. If you can't post a link, jsFiddle it.
My blog | My older articles | CSS Reference

gary.turner
gary.turner's picture
Offline
Moderator
Dallas
Last seen: 1 year 48 weeks ago
Dallas
Timezone: GMT-6
Joined: 2004-06-25
Posts: 9776
Points: 3858

Nested list centered in Firefox

You have

<ul style="margin-left:15px;">

You should move that ruleset to your stylesheet. Preferably, the stylesheet would reside within the style element in the head section of the document until the design is satisfactory.

You should have something like this;

<ul id="menu">

and then in the stylesheet,

#menu {
    padding: 0;
    margin-left: 15px;
    }

Due to the use of tables for layout, you have a mess to try to style. You'll have to derive your selectors from the cluster**** that is your html. It may be difficult since the markup is neither well structured, nor semantic. Were it up to me, I would start over with proper markup.

cheers,

gary

If your web page is as clever as you can make it, it's probably too clever for you to debug or maintain.

Anonymous
Anonymous's picture
Guru

Nested list centered in Firefox

lipets wrote:
Any Idea why it looks ok besides that the DOC is not there?
Without a doctype you render in quirks mode. It might work, might not.

You pays your money and you takes your chances.

lipets
Offline
newbie
Last seen: 17 years 8 weeks ago
Joined: 2005-12-15
Posts: 9
Points: 0

Nested list centered in Firefox

Great input and well understood.

I didn't see a spot for paid work projects, would anyone like to clean up the code in the original page template and stylesheet?

I'm building a few hundred pages off this layout.



Thanks