how to style a 2-column?

Posted on 2014-10-29
Medium Priority
Last Modified: 2014-10-29
Please see the attached jpg file.  The small div on the left is a fixed size image, 42X40,.  the larger div on the right will contain text that could grow longer if needed.  the space between the 2 div area will be 10px.

I tried putting a outer div to enclose these 2 div but still doesn't work right.  Appreciate some help here.   Because it's Intranet, I'm not able to provide url here.
Question by:lapucca
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
  • 2
LVL 58

Accepted Solution

Gary earned 2000 total points
ID: 40411593

    <div style="width:42px;height:40px;margin-right:10px"></div>
    <div>Lorem ipsum
        <br>Lorem ipsum
        <br>Lorem ipsum

Open in new window

div {
div div {
    border:1px solid gray;

Open in new window


Author Comment

ID: 40411674
Hi, I don't need borders.  The box is intended to show as div area.  What is your 2nd example code for?

I currently uses the same as your 1st example.  However, I have style sheet classes as follow.
.evnts-image {
    margin-right: 10px; float: left;
.events-text {


            <div class="evnts-image">
               <img src="/PublishingImages/Portal/Calendar%20icons/img1.png" alt=""/>
            <div class="events-text">
               <strong>This is a title</strong><br/> Some text about this event that should be able to grow. </div>
LVL 58

Expert Comment

ID: 40411690
The border is so you can see the divs.
There is only one code sample - the HTML and the CSS - look at the fiddle

Author Closing Comment

ID: 40411738
Very cool.  Thank you.

Featured Post

Video: Liquid Web Managed WordPress Comparisons

If you run run a WordPress, you understand the potential headaches you may face when updating your plugins and themes. Do you choose to update on the fly and risk taking down your site; or do you set up a staging, keep it in sync with your live site and use that to test updates?

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

When it comes to write a Context Sensitive Help (an online help that is obtained from a specific point in state of software to provide help with that state) ,  first we need to make the file that contains all topics, which are given exclusive IDs. …
This article discusses how to create an extensible mechanism for linked drop downs.
In this tutorial viewers will learn how to style different bullet points for unordered lists in CSS. Begin with a normal unordered list; the default bullet point is a solid circle: In the CSS, create a defined class of unordered list by typing "ul.S…
In this tutorial viewers will learn how to embed custom externally-hosted Google Fonts using the Google Font API in CSS Go to the Google Fonts website at google.com/fonts: Browse or search based on font properties or name to find a suitable font for…
Suggested Courses

765 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question