0

I'm looking at a simple web page layout but I want to fix the 3 centred columns to an absolute maximum height.

I've created this FIDDLE, which is missing the images, but as you can see the first column is longer than the others as there more text in it.

This appears to be the css that is being used, but I'm not sure what to change.

.home_section_left{
width:270px;
height:auto;
float:left;
margin:0 14px 0 14px;
padding:0 10px 20px 10px;
background:url(images/home_block_bg.gif) no-repeat center bottom;
}

How do I fix the length of the columns regardless of the length of data/text entered ?

2 Answers 2

1

You can add a max-height and overflow: auto; to the tags you want to limit the height like this:

.home_section_left {
    max-height: 300px;
    overflow: auto;
}

This will limit the div height and apply scrollbars to it when necessary

Sign up to request clarification or add additional context in comments.

3 Comments

Thanks and If I don't want scroll bars ? Just limit the height and truncate any extra text ?
you can set overflow to hidden, that will remove all scrollbars
The left column is 500px high on my computer, so I think you'll need at least that if you want them all to be the same. Or 42em if you want to be independent of font size.
1

Hope this will help as your needs,

.home_section_left 
{
width: 270px;
height: 200px;
float: left;
margin: 0 14px 0 14px;
padding: 0 10px 20px 10px;
overflow: hidden;
background: url(images/home_block_bg.gif) no-repeat center bottom;
}

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.