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 7558393
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 30, 20262026-05-30T12:21:39+00:00 2026-05-30T12:21:39+00:00

I am new to Css. I don’t know whether this question had answer or

  • 0

I am new to Css. I don’t know whether this question had answer or not. Actually i have a page

<body>
    <div id="confirm">
        <img src="images/help.png" alt="Help Icon">
        <div id="message">
            Are you sure you want to  deletesadcasdsaduasudashdhasdoiasnidosanidoasyduiasnduasnoidnasidonasiodashydioasndoiasndioasdhioasydoiasndioashydasiodsaoidasd

        </div>

        <button>Ok</button>               
    </div>

</body>

I am setting his style. Here is my css

#confirm {

    background-color: #ddd;
    display:block;
    width:400px;
    min-height:120px;
    position:absolute;
    border:1px solid #ccc;
    border-radius: 15px;
    -moz-border-radius: 15px;              /*FireFox*/
    -webkit-border-radius: 15px;           /*Opera, safari*/
    behavior: url(css/border-radius.htc);  /*IE*/
}

#confirm img {
    border:1px solid #ccc;
    margin:20px 20px 0 20px;
    float:left;
    width:64px;
}

#message {
    width: 280px;
    border:1px solid #ccc;
    float: left;
    white-space: normal;
    margin:20px 0 0 0;
    overflow: hidden;
}

#confirm button {
    position: relative;
    width:68px;
    margin:20px 180px 0 0;
    float:right;
}

Right now when i run my code it produses output like this

enter image description here

Now i want that no matter how large the text of the “message div” is. The “confirm div” automatically adjust their size and as well as positions all the elements inside it.
Like right now i have set “confirm div” “min-height = 120”. As you see the text is cropping. The text should not be cropped, The size of message div should increase automatically depending on the size of text. As message div size increase, the confirm div also increase in height, confirm div adjust the image and button in it. Finally all the elements should be inside the confirm Div. Or you can say that the message and image should always be remain in the center of the div.
How can i do it?

Thanks

Thanks

  • 1 1 Answer
  • 0 Views
  • 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-30T12:21:41+00:00Added an answer on May 30, 2026 at 12:21 pm

    your message text has no white space and has a verrrry long word in it, you need to all that word to be broken to auto size the div

    Add

    word-wrap: break-word;
    

    to the CSS for #messsage

    JSFiddle

    Update

    Ok that proved difficult but does this work for you JSFiddle2, I’ve added another div and put the image in that one, its positioned absolute not float so can centre the image. Also had to add another div thats floated as the image was to force the message to be in the right place.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Why doesn't this work? I'm new to CSS, and I don't know why the
I'm new to jquery and I kinda don't get around this. So I have
This is a new understanding of a question I posted previously: I have a
I'm pretty new to CSS and have found a nuance that I don't understand.
I am new in CSS so please help me in this problem. I hope
First off, I apologize if this doesn't make sense. I'm new to XHTML, CSS
First of I am new to CSS and don't seem to understand how classes
i'm very new at css/html, i'm trying to use an image on my page,
Here's a puzzle. Basic page, one element: http://jsfiddle.net/PZj6t/ HTML: <div id=container></div>​ CSS: body, html
I have a css class pause . This is applied in various pages. Only

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.