proud Posted March 1, 2007 Share Posted March 1, 2007 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... Quote Link to comment https://forums.phpfreaks.com/topic/40688-solved-fixing-the-area-of-a-content-in-css/ Share on other sites More sharing options...
jcombs_31 Posted March 1, 2007 Share Posted March 1, 2007 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? Quote Link to comment https://forums.phpfreaks.com/topic/40688-solved-fixing-the-area-of-a-content-in-css/#findComment-197053 Share on other sites More sharing options...
proud Posted March 1, 2007 Author Share Posted March 1, 2007 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. Quote Link to comment https://forums.phpfreaks.com/topic/40688-solved-fixing-the-area-of-a-content-in-css/#findComment-197137 Share on other sites More sharing options...
obsidian Posted March 1, 2007 Share Posted March 1, 2007 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. Quote Link to comment https://forums.phpfreaks.com/topic/40688-solved-fixing-the-area-of-a-content-in-css/#findComment-197140 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.