Jump to content


Div Heights :(


6 replies to this topic

#1 Spyder

    Jedi In Training

  • Members
  • PipPip
  • 438 posts
  • Gender:Male
  • Location:London, UK

Posted 05 August 2006 - 06:40 AM

How do i make a div a fixed height?
I put in the height tg n css and i styled a page but when i view it the div just squashes itseflf round the text ignoring my height tag?

How do i make it si that the div comes out at that height but still has room for text inside?
(i only wish to enter quite a small dynamic message inside.)

#2 dEcade

    P2L Staff

  • P2L Staff
  • PipPipPipPip
  • 1,850 posts
  • Gender:Male
  • Location:Saskatoon, Saskatchewan
  • Interests:Guitar, Programming, Storm Chasing, Games (Designing and playing), Hockey, Photography

Posted 05 August 2006 - 10:13 AM

It should worked if you did something like this:

#div_id_name
{
height: 200px;
}

Make sure you remember the px ;)

If you want the text box just to keep going down once the text goes past then height set you could do this:

#div_id_name
{
min-height: 200px;
}

dEcade

#3 rc69

    PHP Master PD

  • P2L Staff
  • PipPipPipPip
  • 3,827 posts
  • Gender:Male
  • Location:Here
  • Interests:Web Development

Posted 06 August 2006 - 01:28 AM

min-height doesn't work in IE, so you would have to put "_height" (without the quotes) after it to correct it (and unfortunately, have invalid CSS).

If your div isn't staying the height you told it to stay, then you may have wrote something wrong, and showing us the code would be the easiest way to sort out the problem.

#4 Matthew.

    Official Spammer .Matt

  • Members
  • PipPipPipPip
  • 2,749 posts
  • Gender:Male
  • Location:England

Posted 06 August 2006 - 07:37 AM

View Postrc69, on Aug 6 2006, 07:27 AM, said:

min-height doesn't work in IE, so you would have to put "_height" (without the quotes) after it to correct it (and unfortunately, have invalid CSS).

That hack doesnt work in IE7 anymore. You can try "*height:* or ...

<!--[if IE]>
<link rel="stylesheet" type="text/css" href="ie.css" />
<![endif]-->


#5 Aussiestinger

    Young Padawan

  • Members
  • Pip
  • 270 posts

Posted 06 August 2006 - 07:57 AM

IE7 will be compatible with min-width height etc, i thought?

#6 Matthew.

    Official Spammer .Matt

  • Members
  • PipPipPipPip
  • 2,749 posts
  • Gender:Male
  • Location:England

Posted 06 August 2006 - 08:46 AM

View PostAussiestinger, on Aug 6 2006, 01:56 PM, said:

IE7 will be compatible with min-width height etc, i thought?

Oo,good point, i do not know.

You could always use this:

<!--[if lt IE 7.0]>  
<link rel="stylesheet" type="text/css" href="ie6.css" />
<![endif]-->

:)

Edited by .Matt, 06 August 2006 - 08:46 AM.


#7 Spyder

    Jedi In Training

  • Members
  • PipPip
  • 438 posts
  • Gender:Male
  • Location:London, UK

Posted 08 August 2006 - 11:26 AM

omg im so sorry i spelt height wrong ^_^ i spelt it heigth in my thing lol





1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users