Jump to content

Min-Width Not respected once Float-Right used


suntracker

Recommended Posts

I've spent about 2 or 3 hours tinkering and trying to figure out how to fix this but I've had it and need help.

I need to put an Adsense ad in a div which hugs the right side of the page. I figured floating it right would do the trick, however once I did that, the min-width of the rest of the website is not respected at all.

 

Here's the page: http://beta2.armyproperty.com

Notice that by shrinking the width of the browser, the Ad is allowed to be drawn on top of the rest of the content (Or drops the content down if using IE) (as opposed to halting it's movement to the right edge of the main layout), and the main layout can compress to nothing (if using firefox).

 

Here's the Index code:

<body>
<!------------------------- AD CONTAINER ---------------------->
<div class="adContainer">
  <?php include ('pageContent/common_googleAds.php'); ?>
</div>
<!---------------------- MAIN SCREEN LAYOUT ------------------->
<div id="screenLayout">        
	<div id="headerContainer">
	  <?php include ('pageContent/common_header.php'); ?>
	</div>

	<div id="sideMenuPanel"> 
	  <?php include ('pageContent/common_sideMenu.php'); ?>
	</div>

	<div id="mainPanel">
	  <?php include ('pageContent/pageContent_home.php'); ?>
	</div>

	<div id="footerContainer" align="center">
	  <strong>©2008 | Inventory Management Solutions Inc.</strong>
	</div>
</div>
</body>

 

Here's the CSS:

 

#screenLayout {
width: 90%;
margin: 10px auto;
min-width: 1000px;
max-width: 1200px;
}
* html .screenLayout {
  height: 100%;
}

.adContainer {
width: 120px;
float: right;
}

 

Any ideas on how to do this elegantly? I want the Ad to hug the right side, not overlap or cause the main content to drop, and not destroy the min-width stuff.

Thanks for any help you can provide!

-Austin

Link to comment
Share on other sites

Okay, I gave up and just put it in the main content div.

If anybody has any thoughts on how to place it to the right of the page layout while still keeping it centered (and without letting it get crushed or overlapped by the ad), I'm all ears.

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.