Jump to content

[SOLVED] Fixing the area of a content in CSS?


proud

Recommended Posts

 

I was wondering whether there is someway to fix the area of a content in CSS so that it wont expand if too much text was entered, just similar to the html code that fixes the area of the table.

 

i.e.

 

<table style="table-layout: fixed;">

 

 

This code lets the table stay in a fixed size no matter how much text is entered...

declare the overflow, if you set it to auto then you will get scroll bars when the text doesn't fit, or you can set it to hidden and you won't see the text that doesn't fit at all. You need to specifiy a width and height for overflow to work properly. What exactly do you want to accomplish and why?

 

I'm trying to design a chatroom in which the messages are displayed in the CSS content because when the text becomes too much a scrollbar appears allowing the content to remain in it's original size and allowing the user to read the long message at the same time.

 

By the way I tried your advise about the (overflow:auto;) and it was the right solution for the problem,

so thanks very much and I appreciate your help.

Just a suggestion: because you're using a chatroom, I would recommend using overflow: scroll instead of auto. The only reason is that this way, the scrollbar is always there, and it makes a chatroom user interface a little more uniform with what you might expect. Either way is great, but that's just a personal preference.

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.