Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 830593
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 15, 20262026-05-15T04:04:09+00:00 2026-05-15T04:04:09+00:00

Trying to create a box that contains sentences (with spaces) and can have a

  • 0

Trying to create a box that contains sentences (with spaces) and can have a maximum width of 300px. When the text is too long, it will autowrap without a scroll bar.

EDIT:

Actually, I should have mentioned that I will need to float the box left. I’m putting it in a widget like so:

<div>
    <div>left control</div>
    <div>text</div>
    <div>right control</div>
</div>

It works, except when I try to place a background like so:

.rounded-reason {
    -moz-border-radius: 5px;
    -webkit-border-radius: 5px;
    -khtml-border-radius: 5px;
    border-radius: 5px;
    background-color:#ffffff;
    padding:10px;
    border: 2px solid red;
    margin-top:7px;
    margin-bottom:20px;
}

The background is too small. It works if I don’t float the ‘left control’ and ‘right control’, but I want these to appear at the top of the box, not at the bottom.

  • 1 1 Answer
  • 1 View
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-15T04:04:10+00:00Added an answer on May 15, 2026 at 4:04 am

    It should do that.

    <div style="width: 300px;">
    <p>
    Quisque faucibus commodo diam, ut vehicula risus ultrices at? Curabitur tempus eros in velit malesuada sodales? Maecenas auctor nisl quis libero lobortis eget varius eros porta. Nunc mauris lacus, pretium eget viverra semper, rutrum et turpis! Integer viverra sem at odio faucibus at gravida neque consequat. Aenean viverra tellus id felis dapibus bibendum. Integer eget mattis nisl. Nunc nec turpis nec lacus varius sagittis non et sapien! Vestibulum porta ultricies rutrum. Vivamus lorem elit, luctus ac viverra a, porta et nibh. Praesent quam neque, scelerisque non pretium at, suscipit ac quam. Mauris varius ipsum sit amet massa tempus facilisis interdum eros rhoncus. In ac enim et ipsum convallis lacinia.
    </p>
    
    </div>
    

    The CSS height property should be auto by default. So, if you don’t explicitly define the height, it will grow in height to fill its contents (provided the contents do not have position: absolute or float, which will change this behaviour somewhat).

    Update

    Sounds like you might be experiencing auto collapsing parent with floated children.

    You can fix that like so… each one has their own pros and cons.

    • Add overflow: hidden to the parent. This will however chop off all overflow.
    • Add <span style="clear: both;"></span> or similar beneath the floats. This adds an extra unsemantic element.
    • Float the parent. This is not compatible with all layouts
    • Use JavaScript or :after CSS pseudo selector to add the clearing element (not supported without JavaScript, and not supported by IE 6/7 respectively)
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm trying create a box in my Django app that displays text (and possibly
I am trying to create an application that contains a StyledText box displayed within
I am trying to create a list box that displays a set of data
I'm trying to create a flexible box layout that fills the entire viewport, and
Question I'm trying to create a basic wxWidgets program with a text entry box,
I'm trying to create a view that contains a list of checkboxes that is
I have a WPF application where I'm trying to create a diagnostics panel that's
I'm trying to create a drop down box that is populated by an array.
I am trying to create a dialog box that will appear only if the
I'm trying to create a nib that contains a view that will be embedded

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.