803andy Posted November 3, 2009 Report Share Posted November 3, 2009 (edited) Hello, I have two adjacent divs that are placed throughout a few pages. The text is too close to the neighboring div. What is the best way to put a small buffer b/w these two? Thanks Edited November 3, 2009 by 803andy Quote Link to comment Share on other sites More sharing options...
falkencreative Posted November 3, 2009 Report Share Posted November 3, 2009 In most cases, adding a bit of margins or padding is the way to go about this. Sorta depends on how your site is currently coded.... You have a link to one of the pages (and specify which are the two divs that are "too close")? Quote Link to comment Share on other sites More sharing options...
803andy Posted November 3, 2009 Author Report Share Posted November 3, 2009 Thanks Ben, I've been trying to use padding and margin, but the side text then flys off the page. Below is my file (bare minimum): http://www.sendspace.com/file/4kv863 Please let me know where I'm wrong. Thnx Quote Link to comment Share on other sites More sharing options...
803andy Posted November 3, 2009 Author Report Share Posted November 3, 2009 //The right div will contain text and sometimes contain an image. Quote Link to comment Share on other sites More sharing options...
falkencreative Posted November 3, 2009 Report Share Posted November 3, 2009 Can you clarify -- in the HTML file, which are the two divs that you are talking about, and how exactly are you hoping to change what is there? Where are you wanting to add spacing? Quote Link to comment Share on other sites More sharing options...
803andy Posted November 4, 2009 Author Report Share Posted November 4, 2009 The solo_text & solo_left divs are too close. I would like some more space b/w the two. Depending on the words or the sentence the text and the two divs nearly touch in some instances. I've tried padding and margin, but the results have always pushed one div completely out of focus. Quote Link to comment Share on other sites More sharing options...
falkencreative Posted November 4, 2009 Report Share Posted November 4, 2009 In general, I try to stay away from setting both a height and top/bottom margins/padding on the same element (or similarly, setting a width and a left/right margins or padding). This avoids some potential browser compatibility issues. Your best bet here is to add a wrapper div within one of the two that will give it the padding you need. For example: content here... And then the css: .left_wrapper { padding-right: 40px; } Quote Link to comment Share on other sites More sharing options...
803andy Posted November 4, 2009 Author Report Share Posted November 4, 2009 Thanks a lot, that idea is very slick.......... Quote Link to comment Share on other sites More sharing options...
803andy Posted November 4, 2009 Author Report Share Posted November 4, 2009 Hmmmm... now the only problem is IE or IE6, I'm using: .left_wrapper { padding-right: 15px; } I'm using the left_wrapper div right under the main_left div. It works well in Firefox but it's going off the page in IE6 Quote Link to comment Share on other sites More sharing options...
falkencreative Posted November 5, 2009 Report Share Posted November 5, 2009 I took a look at your code again... Check the "images/right_line.jpg" images which is within the .solo_text div. You have given them a width of 540px, but the .solo_text div is only 532px wide. That may be causing the issue you are experiencing. Quote Link to comment Share on other sites More sharing options...
803andy Posted November 5, 2009 Author Report Share Posted November 5, 2009 Validate your business, while reaching a global audience. Text, text, text, text, text, text Text, text, text, text, text, text Text, text, text, text, text, text Text, text, text, text, text, text Text, text, text, text, text, text Text, text, text, text, text, text Text, text, text, text, text, text Text, text, text, text, text, text: - Text Text - Text Text - Text Text - Text Text - Text Text - Text Text - Text Text - Text Text - Text Text - Text Text Text, text, text, text, text, text Text, text, text, text, text, text Text, text, text, text, text, text Text, text, text, text, text, text Text, text, text, text, text, text Text, text, text, text, text, text Text, text, text, text, text, text Text, text, text, text, text, text Creative Web Designs Left left left left left left left left left left Left left left left left left left left left left Left left left left left left left left left left Affordable Pricing ALeft left left left left left left left left left Left left left left left left left left left left Left left left left left left left left left left Quote Link to comment Share on other sites More sharing options...
803andy Posted November 5, 2009 Author Report Share Posted November 5, 2009 Could it be the doctype?? Quote Link to comment Share on other sites More sharing options...
falkencreative Posted November 5, 2009 Report Share Posted November 5, 2009 here is one way that I have tested and know that it works... -- I've added a wrapper div surrounding the two columns, giving that the specific width and margin: 0 auto (margin top and bottom 0, margin left and right auto). I also added "overflow:auto" so it would correctly wrap around the two text columns -- I also added a background color on both the body and the wrapper div to show where the columns were Changing the doctype shouldn't affect the positioning of the columns, though I always use the strict doctype rather than transitional. css: body { margin:0; background: #ffff00; } .wrapper { width: 780px; margin:0 auto; background: #fff; overflow: auto; } .solo_text { width: 540px; float: right; color: #999999; font-size: 14px; font-family: Verdana, Arial, Helvetica, sans-serif; } .solo_left { width: 240px; float: left; font-family: Verdana, Arial, Helvetica, sans-serif; font-size: 14px; } .left_wrapper { padding-right: 30px; } html: br /> "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> Validate your business, while reaching a global audience. Text, text, text, text, text, text Text, text, text, text, text, text Text, text, text, text, text, text Text, text, text, text, text, text Text, text, text, text, text, text Text, text, text, text, text, text Text, text, text, text, text, text Text, text, text, text, text, text: - Text Text - Text Text - Text Text - Text Text - Text Text - Text Text - Text Text - Text Text - Text Text - Text Text Text, text, text, text, text, text Text, text, text, text, text, text Text, text, text, text, text, text Text, text, text, text, text, text Text, text, text, text, text, text Text, text, text, text, text, text Text, text, text, text, text, text Text, text, text, text, text, text Creative Web Designs Left left left left left left left left left left Left left left left left left left left left left Left left left left left left left left left left Affordable Pricing ALeft left left left left left left left left left Left left left left left left left left left left Left left left left left left left left left left Quote Link to comment Share on other sites More sharing options...
803andy Posted November 5, 2009 Author Report Share Posted November 5, 2009 I hate to sound greedy.... The above code does work; however, when I try and implement it into the entire page, I am still getting an issue in IE6. I believe there is something small I'm missing: I have attached the "full-webpage" with the wrapper class implemented. Its fine in fireworks but still acts up IE6. http://www.sendspace.com/file/ac6u38 I appreciate your time in helping me troubleshoot this matter greatly!! Quote Link to comment 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.
Note: Your post will require moderator approval before it will be visible.