View Full Version : CSS Layouts --> Height


kitty_cat
12-11-2004, 12:17 AM
How do you specify a height for a certain area of text in a CSS layout?

kittycat
12-11-2004, 01:21 AM
You could stick the text in a div width specified height...
<div style="height: 100px;">
your text
</div>

The div will keep expanding if you go over the 100px height though, you can make it scroll by adding overflow: auto; between the style=".." bit.

kitty_cat
12-11-2004, 01:25 AM
OK. Thanks so much. I was wondering if you could do it in the CSS part though. But that still works. Thanks!

kittycat
12-11-2004, 01:30 AM
You can make an id for it if you don't want to use the inline style...

#text { height: 100px; }

<div id="text"> text </div>

Monkey Bizzle
12-11-2004, 01:32 AM
then in your CSS add a class like this:

.column (you can name it whatever you want)
{height: 100px;
overflow: auto;}

you can also put specific font sizes, types, colors, etc... basically anything you can do in CSS you can put in the div. and tehn in the actual code of your page, put:

<div class="column">
your text or wahtever here...
</div>

EDIT
KittyCat beat me... but... the difference between class and id is that you can only use an ID once whereas you can use that class over and over in different parts of your page.