CSS: truncated background image

Do you have a question? Post it now! No Registration Necessary.  Now with pictures!

Threaded View


when I define a background image for a <DIV> tag and text, the
background image is truncated at the position when the text ends.

But how can I display the whole image, regardless of the length of the
text displayed in front of it?


Re: CSS: truncated background image


Rob wrote:

Quoted text here. Click to load it

You probably have to specify the height of the DIV to be greater or equal to
the height of the background image. You should use 'min-height', so the DIV
will expand, if there is more text (or the text gets larger than you
expected due to a larger font size). But min-height is not supported by
older IE versions, by those browsers treat 'height' as 'min-height' and
ignore 'min-height', so setting

[selector-for-div] {
  background: ...;
  height: NNNpx;
  min-height: NNNpx;

could work as intended.


P.S.: a URL to a document showing the problem would help.

Benjamin Niemann
Email: pink at odahoda dot de
WWW: http://pink.odahoda.de /

Re: CSS: truncated background image

Fleeing from the madness of the chello.at jungle
and said:

Quoted text here. Click to load it

How do you do?

Quoted text here. Click to load it

yes - well in fact it is truncated where the div ends

Quoted text here. Click to load it

fix the minimum height of the div - see the excellent article by Grey  
Wyvern, bachelor of this parish ...

William Tasso


Site Timeline