strict/transitional Q's

M

mark | r

is there a way to get xhtml script doc type to act like transitional in
relation to line height, it doesnt matter whats in a DIV strict gives the
div a line height which knocks out my design and stops it from lookin good.

mark
 
J

Jukka K. Korpela

mark | r said:
is there a way to get xhtml script doc type to act like transitional
in relation to line height, it doesnt matter whats in a DIV strict
gives the div a line height which knocks out my design and stops it
from lookin good.

In future, please write normal English using mixed case and full stops
(".") between sentences. Also consider explaining the problem you have,
and illustrating it with a URL, instead of a confused explanation of your
assumed solution to an unspecified problem.

What do you mean by "xhtml script doc type", and why are you using XHTML?

If variations in line height break your design, then your design is
broken by design. You need to give more information in order to get help
in seeing what is wrong with your design. Actually, it's hardly the line
height, but that remains to be seen.
 
S

Steve Pugh

mark | r said:
is there a way to get xhtml script doc type to act like transitional in
relation to line height, it doesnt matter whats in a DIV strict gives the
div a line height which knocks out my design and stops it from lookin good.

Browsers don't care about strict or transitional. Some doctypes
trigger standards mode and some doctypes trigger quirks mode, it is by
no means as simple as transitional doctype = quirks mode.

That said there are no XHTML 1.0 Strict doctypes that trigger quirks
mode in Mozilla or Opera 7.1+. IE6 and Opera 7.0x can be sent into
quirks mode by including an XML declaration before the doctype.

Which browsers are displaying different line height properties in
different modes? (As ever a URL helps).
Are you talking about the way that Mozilla includes extra space below
an image? This can often be resolved with CSS.

Steve
 
W

Whitecrest

If variations in line height break your design, then your design is
broken by design.

Bullshit. Trying to stick with the (non standard) standards is breaking
the design. Which is why the current standards suck. They are what is
broke.

If your design is unachievable by using Strict, or xhtml, then use
transitional. There is no sin in doing that. And it will work on all
browsers for the foreseeable future.
 
G

GeoffC

Which browsers are displaying different line height properties in
different modes? (As ever a URL helps).
Are you talking about the way that Mozilla includes extra space below
an image? This can often be resolved with CSS.

Steve

Can you explain about this extra space included by Mozilla and how to
overcome it?. It may well be the cause of a problem I am having when
the doctype is HTML 4.01 but not when Transitional is inserted.

I have a vertical set of absolutely positioned links which are images
only, no text at all. When I resize text in Moz, the images move down
a bit but the background images behind them stay where they are. I
have tried padding 0, margin 0, border 0 etc. but to no avail.

Regards

-- GeoffC
 
G

GeoffC

Forgot to mention that I even set the line height explicitly to the
image height in pixels but even that made no difference. Problem
doesn't occur in Opera or IE 6.
Regards

-- GeoffC
 
S

Steve Pugh

GeoffC said:
Can you explain about this extra space included by Mozilla and how to
overcome it?. It may well be the cause of a problem I am having when
the doctype is HTML 4.01 but not when Transitional is inserted.

Typically it will show up with something like this:
<div style="border:1px solid; padding: 0;"><img alt=""
src="foo.gif"></div>

In Standards mode, if the image is smaller than the line height then
space will appear above and below the image. If the image is taller
than the line height then space will appear below the image.

Setting display: block; for the relevant img elements is one possible
CSS solution.

See this message (and the rest of the thread) for the gory details of
why this happens:
http://groups.google.com/[email protected]

Steve
 
S

Steve Pugh

Spartanicus said:
img{vertical-align:text-bottom} IIRC

Works if the image is taller than the line height. If the image is
smaller than the line height then it just makes all the white space
appear above the image, rather than some above and some below.

Steve
 
S

Steve Pugh

GeoffC said:
Forgot to mention that I even set the line height explicitly to the
image height in pixels but even that made no difference.

The height of line boxes is not determined by the line-height
property.
The line-height property of the parent determines the minimum height
of the line box.
The actual height is determined by the heights of the various inline
boxes that make up the line box.

Then you have the fact that the image sits on the text baseline and
thus the actual height of the line box is from the top of the image or
the font (even when no text is actually present) whichever is taller
to the bottom of the font.

So you would need to:
* set the line-height of the parent element to the height of the image
(or less but safer to make it equal);
* and set the font-size to the height of the image (or less);
* and set the vertical-align property of the images themselves as
outlined in Spartanicus's post.

Or make the images block elements, in which case there will be no line
boxes as there are no inline elements, and thus no problem.
Problem doesn't occur in Opera or IE 6.

Opera and IE don't apply this part of CSS 2.1 and CSS 2 was rather
more vague on this topic.

Steve
 
G

GeoffC

Steve,

Thank you for that detailed reply and the link - very illuminating.

I'll have another go at the problem now.
Regards

-- GeoffC
 
S

Spartanicus

Steve Pugh said:
Works if the image is taller than the line height. If the image is
smaller than the line height then it just makes all the white space
appear above the image, rather than some above and some below.

Indeed, and since the image is usually larger than the line-height, this
is the behaviour most want.
 

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,743
Messages
2,569,478
Members
44,898
Latest member
BlairH7607

Latest Threads

Top