Register

If this is your first visit, please click the Sign Up now button to begin the process of creating your account so you can begin posting on our forums! The Sign Up process will only take up about a minute of two of your time.

Results 1 to 2 of 2
  1. #1
    Member
    Join Date
    Aug 2005
    Posts
    87
    Member #
    10945
    Hi, I have created a series of CSS boxes on my website and they are all the same size. Text will be placed inside the boxes, however when I type too much text, the box expands. I'm interested to know if there is an attribute that I could put on the DIV that restricts it from expanding.

    So far, I've tried a method where another box is directly underneath the first one with the text. The box is set at a different level, and it has the same color as the website's background in order to conceal it. When I type away on the first CSS box, the text expands the height of the box, however no one knows because the bottom box "conceals" it. But there has to be a quicker way to do this without putting a box underneath everything.

    Here is my code for the expanding text box:


    #text {
    PADDING-RIGHT: 12px;
    PADDING-LEFT: 8px;
    PADDING-BOTTOM: 12px;
    PADDING-TOP: 12px;
    COLOR: #FFFFFF;
    MARGIN-TOP: 0px;
    MARGIN-BOTTOM: 12px;
    Float Left: 11px;
    top: 20px;
    WIDTH: 100px;
    HEIGHT: 10px;
    position: absolute;
    border-width: 1px;
    BACKGROUND-COLOR: #000000;
    BORDER-LEFT: #660000 1px solid;
    BORDER-RIGHT: #660000 1px solid;
    BORDER-BOTTOM: #660000 1px solid;
    }

    <DIV id=text>
    Blah blah blah blah blah blah blah blah blah
    </DIV>

  2.  

  3. #2
    Member
    Join Date
    Aug 2005
    Posts
    87
    Member #
    10945


    WHOOPS, NEVER MIND!


    I have a choice of using the clip property or overflow (hidden) property.

    w3schools


Remove Ads

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  

Search tags for this page

css keep text inside box

Click on a term to search for related topics.
All times are GMT -6. The time now is 04:17 PM.
Powered by vBulletin® Version 4.2.3
Copyright © 2019 vBulletin Solutions, Inc. All rights reserved.
vBulletin Skin By: PurevB.com