Solved

how to style a 2-column?

Posted on 2014-10-29
4
75 Views
Last Modified: 2014-10-29
Hi,
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.
style.jpg
0
Comment
Question by:lapucca
[X]
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
4 Comments
 
LVL 58

Accepted Solution

by:
Gary earned 500 total points
ID: 40411593
http://jsfiddle.net/mae9s6km/1/

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

Open in new window


div {
    clear:both
}
div div {
    float:left;
    clear:none;
    border:1px solid gray;
}

Open in new window

0
 

Author Comment

by:lapucca
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 {
    width:42px;
    margin-right: 10px; float: left;
}
.events-text {
    margin-left:52px;
    float:right;

}


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

Expert Comment

by:Gary
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
0
 

Author Closing Comment

by:lapucca
ID: 40411738
Very cool.  Thank you.
0

Featured Post

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Sending ASP to server side 8 32
Timer on div 5 25
Can't get cursor to change 3 16
Popup write two lines 3 22
This article demonstrates how to create a simple responsive confirmation dialog with Ok and Cancel buttons using HTML, CSS, jQuery and Promises
Find out what you should include to make the best professional email signature for your organization.
The viewer will learn the basics of jQuery including how to code hide show and toggles. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery…
Video by: Mark
This lesson goes over how to construct ordered and unordered lists and how to create hyperlinks.

726 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