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
Solved

responsive DIV columns

Posted on 2014-03-30
1
308 Views
Last Modified: 2014-05-02
i am building a new site and a sample page with the issue at hand on the dev url is http://serv7wkdcxic.sn.sourcedns.com/~yacht/wpsite/listings/royal-princess.

The site overall is responsive, but I put in a DIV with two columns and the second column, when it shrinks down, doesn't drop below the first but moves on top of it.  In this case it is text running over a picture.

What do I do so the text would drop below the image?

The css is below.

.yacht-details {

	background-color: #f5f5f5;

	font-size: 16px; 
	
	line-height: 2em ; 

	overflow: hidden;

	margin: 0 0 30px;

	padding: 15px 20px 0;

}



.yacht-details-col1,
.yacht-details-col2{

	float: left;

	margin: 0;

	padding: 0 0 15px;

	width: 50%;

}

Open in new window

0
Comment
Question by:dougfosterNYC
1 Comment
 
LVL 5

Accepted Solution

by:
Neil_Bradley earned 500 total points
ID: 39965441
Hi Doug,
you could simply write a media query to counteract the floating nature of your 2 divs when the screen soze drops below a certain size. Something like this
@media only screen and (max-width: 960px)
.yacht-details-col1, .yacht-details-col2 {
float: none;
width: 100%;
}
}
0

Featured Post

Master Your Team's Linux and Cloud Stack

Come see why top tech companies like Mailchimp and Media Temple use Linux Academy to build their employee training programs.

Question has a verified solution.

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

Although it can be difficult to imagine, someday your child will have a career of his or her own. He or she will likely start a family, buy a home and start having their own children. So, while being a kid is still extremely important, it’s also …
Today, the web development industry is booming, and many people consider it to be their vocation. The question you may be asking yourself is – how do I become a web developer?
In this tutorial viewers will learn how to style a decorative dropcap for the first letter in a paragraph using CSS. In CSS, create a new paragraph class by typing "p.fancy": Then, to style only the first letter of the first sentence, include the ps…
Video by: Mark
This lesson goes over how to construct ordered and unordered lists and how to create hyperlinks.

837 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