CSS inconsistent behaviour

I

Ian Davies

I have a class in a style sheet to make text x-large.
However it behaves differently on different pages. The text is large on one
page, as it should be but not on the other even though the text on both
pages uses the same style

anyone know why this happens?
 
M

Martin Jay

Ian Davies said:
I have a class in a style sheet to make text x-large.
However it behaves differently on different pages. The text is large on one
page, as it should be but not on the other even though the text on both
pages uses the same style

anyone know why this happens?

A URL would be helpful.

Font sizes are relative to the size of their parent element, so the
following two paragraphs have different font sizes, even though they
both have a font-size of 'smaller.'

<div style="font-size: 2em;">
<p style="font-size: smaller;">Hello</p>
</div>

<div style="font-size: 1.5em;">
<p style="font-size: smaller;">Hello</p>
</div>
 
N

Neredbojias

To further the education of mankind, "Ian Davies"
I have a class in a style sheet to make text x-large.
However it behaves differently on different pages. The text is large
on one page, as it should be but not on the other even though the text
on both pages uses the same style

anyone know why this happens?

There are a number of reasons why it could happen but which one's the one
is significant.
 
I

Ian Davies

Hello
Thanks for the feedback
I sorted it out. I had created a dynamic page in dreamweaver from a
template and the following line is automatically placed at the top of the
html

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">

All my other pages I have either not used dreamweaver to create them or have
deleted this line. On deleating the line the css style was displayed
properly.
Out of interest does anyone know what this line does exactly
Ian
 
N

Neredbojias

To further the education of mankind, "Ian Davies"
Hello
Thanks for the feedback
I sorted it out. I had created a dynamic page in dreamweaver from a
template and the following line is automatically placed at the top of
the html

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">

All my other pages I have either not used dreamweaver to create them
or have deleted this line. On deleating the line the css style was
displayed properly.
Out of interest does anyone know what this line does exactly
Ian

"Neredbojias" <http://www.neredbojias.com/fliam.php?cat=alt.html>
wrote in message

Get a load of this. That line puts browsers into "standards mode" with a
somewhat-deprecated tag-set. The optimal method is to use the strict
doctype which is similar but more accurate. Not including a doctype at all
goads browsers into "quirks mode", -a sort of haphazard way of functioning
peculiar to the particular browser at hand. Ergo, all your other pages are
flawed and the one with the problem was acceptably correct.
 
I

Ian Davies

Thanks for that
If my page is is a php dynamic page with html script where is the best place
for the
document type declaration to be put?
Presumably if the the php file contains no html then presumably I would not
need a document type declaration?

Ian
 
N

Neredbojias

To further the education of mankind, "Ian Davies"
Thanks for that
If my page is is a php dynamic page with html script where is the best
place for the
document type declaration to be put?
Presumably if the the php file contains no html then presumably I
would not need a document type declaration?

If it generates html markup sent to the client as a page, the doctype
should go at the top. Strict is:

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN"
"http://www.w3.org/TR/html4/strict.dtd">

And yes, if the script doesn't generate a page, no doctype needed.
 

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

Forum statistics

Threads
473,767
Messages
2,569,572
Members
45,045
Latest member
DRCM

Latest Threads

Top