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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 21, 20262026-05-21T21:11:08+00:00 2026-05-21T21:11:08+00:00

Pretty simple set-up here, I’m just trying to get two divs to sit side-by-side.

  • 0

Pretty simple set-up here, I’m just trying to get two divs to sit side-by-side. Image on the left, text on the right. For some reason, if the text is too long, it pushes the div down. I’d like to just make the cs-summary div understand that it should wrap the text in order to NOT jump down like it is:

http://jsfiddle.net/csaltyj/5Huau/

Code:

<div class="container">
    <div class="cs-image">
        <img src="http://www.electroniccampus.org/school_logos/CFNC/Wake_Forest_University/Wake_Forest_University2.jpg" />
    </div>
    <div class="cs-summary">
        <p>Texty text text McTexterson likes to text. Why is div getting shoved down?</p>
    </div>
</div>
<div class="container">
    <div class="cs-image">
        <img src="http://www.electroniccampus.org/school_logos/CFNC/Wake_Forest_University/Wake_Forest_University2.jpg" />
    </div>
    <div class="cs-summary">
        <p>Super short text behaves.</p>
    </div>
</div>

CSS:

.container {
    overflow: hidden;
    border: 2px solid #0f0;
    width: 400px;
    margin-bottom: 1em;
}

.cs-image {
    float: left;
    border: 2px solid red;
}

.cs-summary {
    font-size: 0.8em;
    border: 2px solid blue;
    float: left;
    margin-left: 1em;
}

As you can see from the second container below, the short text works just fine. I don’t want to hardcode any pixel or em values for how wide the text is, I just want it to conform and “know” its bounds.

Thanks in advance.

  • 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-21T21:11:09+00:00Added an answer on May 21, 2026 at 9:11 pm

    If your div.cs-summary doesn’t have a set width it will take up as much space as it can

    http://jsfiddle.net/hunter/5Huau/7/

    .cs-summary {
        width: 180px;
        ...
    }
    

    or you could remove the wrapping inner div elements and just do this:

    http://jsfiddle.net/hunter/5Huau/11/

    HTML

    <div class="container">
        <img src="http://www.electroniccampus.org/school_logos/CFNC/Wake_Forest_University/Wake_Forest_University2.jpg" />   
        <p>Texty text text McTexterson likes to text. Why is div getting shoved down?</p>        
    </div>
    <div class="container">
        <img src="http://www.electroniccampus.org/school_logos/CFNC/Wake_Forest_University/Wake_Forest_University2.jpg" />
        <p>Super short text behaves.</p>
    </div>
    

    CSS

    .container {
        overflow: hidden;
        border: 2px solid #0f0;
        width: 400px;
        margin-bottom: 1em;
    }
    
    .container img {
        float: left;
        border: 2px solid red;
    }
    
    .container p {
        font-size: 0.8em;
        border: 2px solid blue;
        margin-left: 1em;
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm trying to set validation for an image alternate text, and here's what I
I've got a pretty simple issue here which I can't get to work. SELECT
It's pretty simple what I'm trying to accomplish here. Say you put down 320
I'm trying to do something pretty simple: an <a> tag with a background image.
Pretty simple question. I have a few ASP RequiredFieldValdators checking some text boxes. Out
This is pretty simple, I come from a swing/awt background. I'm just wondering what
I'm doing pretty simple thing here: getting Facebook news feed using their graph API.
I'm trying to do some pretty simple stuff in Jython within Java. My Python
Here is my code, pretty simple really. Its not homework, I'm teaching myself java
I'm trying to create a pretty simple graphing component that consists of a series

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.