Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

responsive DIV columns

Posted on 2014-03-30
1
Medium Priority
?
324 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 2000 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

Vote for the Most Valuable Expert

It’s time to recognize experts that go above and beyond with helpful solutions and engagement on site. Choose from the top experts in the Hall of Fame or on the right rail of your favorite topic page. Look for the blue “Nominate” button on their profile to vote.

Question has a verified solution.

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

Australian government abolished Visa 457 earlier this April and this article describes how this decision might affect Australian IT scene and IT experts.
When it comes to security, close monitoring is a must. According to WhiteHat Security annual report, a substantial number of all web applications are vulnerable always. Monitis offers a new product - fully-featured Website security monitoring and pr…
This tutorial walks through the best practices in adding a local business to Google Maps including how to properly search for duplicates, marker placement, and inputing business details. Login to your Google Account, then search for "Google Mapmaker…
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

877 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