suntracker Posted May 17, 2008 Share Posted May 17, 2008 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 Quote Link to comment https://forums.phpfreaks.com/topic/106105-min-width-not-respected-once-float-right-used/ Share on other sites More sharing options...
suntracker Posted May 18, 2008 Author Share Posted May 18, 2008 I'm beginning to think that the ad container needs to be inside the contentContainer div....... OR I have to wrap the contentContainer and the AdContainer in a new 'super' container? Ugh. Quote Link to comment https://forums.phpfreaks.com/topic/106105-min-width-not-respected-once-float-right-used/#findComment-543936 Share on other sites More sharing options...
suntracker Posted May 18, 2008 Author Share Posted May 18, 2008 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. Quote Link to comment https://forums.phpfreaks.com/topic/106105-min-width-not-respected-once-float-right-used/#findComment-543944 Share on other sites More sharing options...
allistera Posted May 18, 2008 Share Posted May 18, 2008 I have the same problem, and don't want to resort to tables... Quote Link to comment https://forums.phpfreaks.com/topic/106105-min-width-not-respected-once-float-right-used/#findComment-544184 Share on other sites More sharing options...
LooieENG Posted May 18, 2008 Share Posted May 18, 2008 For the div on the left of where the ad should be, use margin: 0 120px 0 0; Looks like you've worked it out from your link though Quote Link to comment https://forums.phpfreaks.com/topic/106105-min-width-not-respected-once-float-right-used/#findComment-544412 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.