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...

Link to comment
Share on other sites

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?

Link to comment
Share on other sites

 

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.

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.