DTD and CSS incompatibility?

A

Attys Erebos

Hello. I was recently doing a very simple website. I used a lot CSS;
changing the font size for <h1> and <li>, positioning with an absolute
value certain image,..

I wrote the DTD only when the rest of the site was finished. But then,
most of the CSS effects disappeared (but background-color for div still
worked). This happened either with transitional or strict DTD.

Why? Which DTD should I use? none?
 
J

Jim Higson

Attys said:
Hello. I was recently doing a very simple website. I used a lot CSS;
changing the font size for <h1> and <li>, positioning with an absolute
value certain image,..

I wrote the DTD only when the rest of the site was finished. But then,
most of the CSS effects disappeared (but background-color for div still
worked). This happened either with transitional or strict DTD.

Which DTD, disappeared in which browser? Examples of HTML/CSS that
disappeared?
Why? Which DTD should I use? none?

Presumably because you put the browser out of quirks mode. There isn't much
information to go on though.
 
A

Attys Erebos

Jim said:
Attys Erebos wrote:




Which DTD, disappeared in which browser? Examples of HTML/CSS that
disappeared?




Presumably because you put the browser out of quirks mode. There isn't much
information to go on though.
I didn't explain it properly.
Nothing disappeared, just didn't work.
Examples of the CSS code that didn't work:
font-size aplied to <h1> or <li>
Browser: Mozilla firefox
The DTDs I'm speaking about are those referred by the HTML 4.01
specification: loose.dtd for transitional, and strict.dtd for strict.
 
J

Jonathan N. Little

Attys said:
I didn't explain it properly.

I'm afraid your *still* aren't
Nothing disappeared, just didn't work.
Examples of the CSS code that didn't work:
font-size aplied to <h1> or <li>
Browser: Mozilla firefox
The DTDs I'm speaking about are those referred by the HTML 4.01
specification: loose.dtd for transitional, and strict.dtd for strict.

a url please so we can actually *see* what you are doing and then we
might have a chance at finding your error!

Sorry if this sounds a little exasperated, but you wouldn't believe how
often this happens in this NG, it's like playing "I spy with my little
eye..."
 
J

Jim Higson

Attys said:
I didn't explain it properly.
Nothing disappeared, just didn't work.
Examples of the CSS code that didn't work:
font-size aplied to <h1> or <li>
Browser: Mozilla firefox
The DTDs I'm speaking about are those referred by the HTML 4.01
specification: loose.dtd for transitional, and strict.dtd for strict.

Have you validated the CSS and HTML to find any typos etc? It is likely the
browser would be more tolerant to small mistakes in quirksmode, and this
might be why your rules worked without a DTD.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,578
Members
45,052
Latest member
LucyCarper

Latest Threads

Top