Register

If this is your first visit, please click the Sign Up now button to begin the process of creating your account so you can begin posting on our forums! The Sign Up process will only take up about a minute of two of your time.

Results 1 to 8 of 8
  1. #1
    Junior Member jennilynn6's Avatar
    Join Date
    Feb 2013
    Posts
    25
    Member #
    35169

    CSS border/spacing issue

    Hello all - working on a HTML email for a client and am having some basic layout issues that are driving me crazy!


    You can see the test page here: http://jennilynn.net/NewYearRes/NYresolution.html
    The section I am having issues with is at the bottom, "A new You for the New Year". I have a div (#bottom) with 2 nested divs inside it (#article and #links). First off - I have the background of the #bottom div set to be white, yet it isn't white all the way down (it cuts off on the #links div). I also set borders on the right and left side which aren't showing up. And lastly, there is a weird space between the bottom of the #bottom div and the top of the #footer div that I can't seem to get to go away. Please help.

    Thanks!
    Jenni



    Code:
     <div id="bottom">        	<div id="article">
                <h3>A New You for the New Year</h3>
                <img style="float:right; padding-left:11px" src="http://intechrahealth.com/newsletter/resolutionarticle.jpg" />
                <p align="justify">A new year is here! This is an exciting time when many of us take a look at our lives and decide where we would like to make positive changes. Perhaps you only have one big resolution this year, or perhaps you have numerous, but one thing is for certain - becoming healthier and happier should be a big part of everything you wish to achieve.            
                <p align="justify">If you have decided that part of the positive changes you want to make in 2014 is to lose weight, then you are in good company because this is THE most common resolution people make as the clock strikes midnight.            
                <p align="justify">Although how you achieve this and the journey you take to reach your goals will be as individual as you are, here are some helpful tips that may help you along the way:<br>
                  <ul class="noindent">
                  <li>Focus on Overall Health - Losing weight is not the only means of becoming healthier. For the best success, combine your weight loss program with positive changes that improve your overall health, such as eating more nutritional foods and getting a good night's sleep.<br />
                    <br />
                  </li>
                  <li>Don't Bully Yourself - Losing weight often takes making not just one, but many changes in how we live every day. If you falter sometimes, don't be too hard on yourself and think negatively. Instead, keep going and do the best you can each and every day.<br />
                    <br />
                  </li>
                  <li>Set Smaller Goals and Celebrate Lots - Losing weight and living healthier take time and effort. By setting smaller goals for diet and exercise you will be able to reach them faster and have more to celebrate.</li>
                  </ul>
                <center>We at Intechra Health would like to wish a very Happy New Year to everyone! May you have much happiness and great health and amazing success in 2014.</center>
           	  </p></div><!--/article-->
                
              <div id="links">
                	<center><a href="http://feedback.ebay.com/ws/eBayISAPI.dll?ViewFeedback2&userid=intechra&ftab=AllFeedback&myworld=true&rt=nc" target="_blank"><img src="http://intechrahealth.com/newsletter/ebay.jpg"></a></center><br>
                	<center><h3>WEIGHT LOSS SUPPORT</h3></center>
                    <ul class="noindent">
                    <li><a href="https://intechrahealth.com/product/fenfast-375/" target="_blank">FenFast 375 Tablets</a></li>
    				<li><a href="https://intechrahealth.com/product/phenblue/" target="_blank">PhenBlue Capsules</a></li>
                    <li><a href="https://intechrahealth.com/product/trimthin-sr/" target="_blank">TrimThin SR Tablets</a></li>
                    <li><a href="https://intechrahealth.com/weight-loss-tools/" target="_blank">Weight Loss Tools</a></li>
                    <li><a href="https://www.intechrahealth.com/articles/" target="_blank">Health & Wellness Articles</a></li>
                    <li><a href="http://intechrahealth.com/forums/" target="_blank">Weight Loss Forum</a></li>
                    <li><a href="https://intechrahealth.com/contact-us/" target="_blank">24/7 Customer Service</a></li>
                    </ul>
              </div><!--/links-->
          </div><!--/bottom-->
          
                    <div id="clear"></div>

    Code:
    #bottom {	width: 638px;
    	background-color: #fff;
    	color: #333;
    	font-family: Verdana, Geneva, sans-serif;
    	font-size: 12px;
    	margin: 0 auto;
    	border-left: solid #70cbf7 1px;
    	border-right: solid #70cbf7 1px;
    }
    
    
    #article {
    	width: 430px;
    	float: left;
    	background-color: #fff;
    	padding-left: 10px;
    	padding-right: 10px;
    	margin: 0  auto;
    	border-right: solid #70cbf7 1px;
    }
    
    
    #links {
    	width: 184px;
    	float: right;
    	background-color: #fff;
    	padding-top: 55px;
    	padding-left: 3px;
    }
    
    
    #links li {
    	list-style-type: none;
    	margin-top: 4px;
    }
    
    
    ul.noindent {
        margin-left: 5px;
        margin-right: 0px;
        padding-left: 10px;
        padding-right: 0px;
    }
    
    
    #footer {
    	width: 640px;
    	font-size: 10px;
    	text-align: center;
    	margin: 0 auto;
    	background-color: #004296;
    	color: #fff;
    }

  2.  

  3. #2
    Unpaid WDF Intern TheGAME1264's Avatar
    Join Date
    Dec 2002
    Location
    Not from USA
    Posts
    14,483
    Member #
    425
    Liked
    2783 times
    It's time, once again, for TheGAME1264's Immutable Law of Floats: when you float, you must clear.

    You have a clearing div (by the way, you should be using a class rather than an id since you're using it once), but it's not a sibling of the links/article divs...it's outside of them both. Put it just after the close </div> tag for the links div and you should see what you're expecting to. I see the white going all the way down, but that's just me. This may solve your other issue as well (can't see it either).
    Last edited by TheGAME1264; Dec 28th, 2013 at 01:06 PM. Reason: Mixed up a div.
    If I've helped you out in any way, please pay it forward. My wife and I are walking for Autism Speaks. Please donate, and thanks.

    If someone helped you out, be sure to "Like" their post and/or help them in kind. The "Like" link is on the bottom right of each post, beside the "Share" link.

    My stuff (well, some of it): My bowling alley site | Canadian Postal Code Info (beta)

  4. #3
    Junior Member jennilynn6's Avatar
    Join Date
    Feb 2013
    Posts
    25
    Member #
    35169
    thanks GAME - before this thread actually was approved and posted, I saw in another thread to add overflow:hidden to the holding divs, which I did for both #bottom and #footer - and it fixed my issue. I don't actually understand why/how, but it worked. Should have edited the post sooner.

    I use the clearing div in another area of the site also - so since i use it more than once, should I leave it as an id? I appreciate your Law of Floats I'm semi-new to coding so any words of wisdom are helpful

  5. #4
    Senior Member Ronald Roe's Avatar
    Join Date
    Mar 2011
    Location
    Oklahoma City
    Posts
    3,141
    Member #
    27197
    Liked
    959 times
    Ah, the old overflow:hidden hack. It's the oddest thing, but there is a reason it works.
    Ron Roe
    Web Developer
    "If every app were designed using the same design template, oh wait...Bootstrap."

  6. #5
    Unpaid WDF Intern TheGAME1264's Avatar
    Join Date
    Dec 2002
    Location
    Not from USA
    Posts
    14,483
    Member #
    425
    Liked
    2783 times
    That's exactly why you shouldn't leave it as an ID, Jenni. IDs are for one and only one element. They're unique IDentifiers. Classes are for two or more of the same thing.
    If I've helped you out in any way, please pay it forward. My wife and I are walking for Autism Speaks. Please donate, and thanks.

    If someone helped you out, be sure to "Like" their post and/or help them in kind. The "Like" link is on the bottom right of each post, beside the "Share" link.

    My stuff (well, some of it): My bowling alley site | Canadian Postal Code Info (beta)

  7. #6
    Senior Member Ronald Roe's Avatar
    Join Date
    Mar 2011
    Location
    Oklahoma City
    Posts
    3,141
    Member #
    27197
    Liked
    959 times
    Pseudo-elements are better:
    Code:
    .parent-of-floated-stuff::after{
    clear:both;
    content:"";
    display:block;
    height:0;
    width:0;
    }
    Ron Roe
    Web Developer
    "If every app were designed using the same design template, oh wait...Bootstrap."

  8. #7
    Unpaid WDF Intern TheGAME1264's Avatar
    Join Date
    Dec 2002
    Location
    Not from USA
    Posts
    14,483
    Member #
    425
    Liked
    2783 times
    I've never been a fan of pseudo-elements, since older versions of IE don't handle them well. Granted, with IE8 and below being rendered obsolete as of April 8, it'll be a whole lot less of an issue, but the only thing I've ever seen perform correctly across the board are div classes.
    If I've helped you out in any way, please pay it forward. My wife and I are walking for Autism Speaks. Please donate, and thanks.

    If someone helped you out, be sure to "Like" their post and/or help them in kind. The "Like" link is on the bottom right of each post, beside the "Share" link.

    My stuff (well, some of it): My bowling alley site | Canadian Postal Code Info (beta)

  9. #8
    Senior Member Ronald Roe's Avatar
    Join Date
    Mar 2011
    Location
    Oklahoma City
    Posts
    3,141
    Member #
    27197
    Liked
    959 times
    Quote Originally Posted by TheGAME1264 View Post
    I've never been a fan of pseudo-elements, since older versions of IE don't handle them well. Granted, with IE8 and below being rendered obsolete as of April 8, it'll be a whole lot less of an issue, but the only thing I've ever seen perform correctly across the board are div classes.
    IE8 supports pseudo-elements, so long as you use the old single colon syntax, so really only IE7 and below.

    I prefer the pseudo-element approach because I don't like adding in a stray element just to clear floats.
    Ron Roe
    Web Developer
    "If every app were designed using the same design template, oh wait...Bootstrap."


Remove Ads

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  

Search tags for this page

fenfast 375 forum

Click on a term to search for related topics.
All times are GMT -6. The time now is 09:45 AM.
Powered by vBulletin® Version 4.2.3
Copyright © 2019 vBulletin Solutions, Inc. All rights reserved.
vBulletin Skin By: PurevB.com