twilitegxa Posted February 27, 2011 Share Posted February 27, 2011 For some reason I cannot get this image at the bottom to align with the rest of the page. The image is part of the footer (it's named bottom.png and located in the footer class at the bottom of the CSS). Here is a link to the page so you can see what I mean: http://midwestcreativeconsulting.com/jhrevell/ And here is the CSS: /* Theme Name: Twenty Ten Theme URI: http://wordpress.org/ Description: The 2010 theme for WordPress is stylish, customizable, simple, and readable -- make it yours with a custom menu, header image, and background. Twenty Ten supports six widgetized areas (two in the sidebar, four in the footer) and featured images (thumbnails for gallery posts and custom header images for posts and pages). It includes stylesheets for print and the admin Visual Editor, special styles for posts in the "Asides" and "Gallery" categories, and has an optional one-column page template that removes the sidebar. Author: the WordPress team Version: 1.1 Tags: black, blue, white, two-columns, fixed-width, custom-header, custom-background, threaded-comments, sticky-post, translation-ready, microformats, rtl-language-support, editor-style */ /* =Reset default browser CSS. Based on work by Eric Meyer: http://meyerweb.com/eric/tools/css/reset/index.html -------------------------------------------------------------- */ body,div,dl,dt,dd,ul,ol,li,h1,h2,h3,h4,h5,h6,pre,form,fieldset,input,textarea,p,blockquote,th,td{ padding:0px; margin:0px; color: #ffffff; } fieldset,input,textarea{ padding:0px 0px 0px 0px; margin:0px 0px 0px 0px; border:1px solid #ccc; color:#666; } input.contact { width: 16em; height: 1.5em; } img {border:0px;} font{ font-family:Arial, Helvetica, sans-serif; font-size:14px; color:#000; outline:none; } a:link { text-decoration: none; } a:visited { text-decoration: none; } a:hover { text-decoration: none; } a:active { text-decoration: none; } .under{ font-style:italic; text-decoration:underline; padding-top:15px;} .submit{ width:61px; height:22px; color:#b4dde3; background:url(images/submit.jpg) top center no-repeat; border:0px; } body{ margin:0; padding:0px; background:url(images/bg.png) no-repeat; background-size: 100%; background-color:#000000; border:none; color:#ffffff; font-size:12px; font-family:Times New Roman; } #mainwrapper{ margin:auto; padding:0px; width:1020px; vertical-align:top; height:auto; border:none; } .mainwrapper{ margin:auto; padding:0px; width:100%; vertical-align:top; height:auto; border:none; } #mainheader{ width:100%; height:auto; float:left; } #logo{ width:374px; height:177px; float:left; } .bolded { font-weight: bold; } .questions { font-weight: bold; font-style: italic; color: #2da89a; font-size: 16px; } .questionList a { font-size: 14px; font-weight: bold; font-style: italic; color: #2da89a; } .questionList a: hover { color: #f8bcd4; } div#form { width: 589px; color: #2da89a; font-weight: bold; font-style:italic; } div#form td { padding-right: 50px; } div#form td.formRight { vertical-align: top; } .testimonial { font-weight: bold; } .footer_italics { font-style: italic; } div.topsubtitle p span.tips { color: #2da89a; font-weight: bold; } .article_italics { font-style: italic; } .article_bold { font-weight: bold; } .article_green { color: #2da89a; } a { color: #999999; } a:hover { color: #FFFF00; } /* ============================================== Navigation Start Here ============================================= */ /*.nav_n{float:left; width:auto; height:auto; margin:0px; padding:0px;} .nav{float:left; width:615px; height:38px; font-family:Arial, Helvetica, sans-serif; font-size:12px; margin-top:150px; margin-left:-5px;} .nav ul { margin:0; padding:0px 0px 0px 0px; list-style:none;} .nav li {display:inline; float:left; padding:0; margin: auto 3px; } */ .nav { FONT-WEIGHT: bold; FLOAT: right; MARGIN:4px 0px 0px 0px; LINE-HEIGHT: 1; LIST-STYLE-TYPE: none; font-family:Arial, Helvetica, sans-serif; } .nav ul {PADDING-RIGHT: 0px; PADDING-LEFT: 0px; FONT-WEIGHT: bold; FLOAT: left; PADDING-BOTTOM: 0px; MARGIN: -4px 0px 0px 0px; WIDTH:475px; LINE-HEIGHT: 1; LIST-STYLE-TYPE: none } .nav a { PADDING-RIGHT:19px; DISPLAY: block; PADDING-LEFT:19px; PADDING-BOTTOM: 7px; COLOR: #000; PADDING-TOP: 7px; TEXT-DECORATION: none } .nav a.daddy { BACKGROUND: url(rightarrow2.gif) no-repeat right center } .nav li { PADDING-RIGHT: 0px; PADDING-LEFT: 0px; FLOAT: left; PADDING-BOTTOM: 0px; PADDING-TOP: 0px; margin-top:0px; } .nav li ul { BORDER-TOP-WIDTH: 0.25em; FONT-WEIGHT: normal; BORDER-LEFT-WIDTH: 0.25em; LEFT: -999em; BORDER-BOTTOM-WIDTH: 0.25em; MARGIN: 0px; WIDTH: 10em; POSITION: absolute; HEIGHT: auto; BORDER-RIGHT-WIDTH: 0.25em; margin-top:38px; } .nav li li {width:auto; padding:8px 0px 8px 0px; text-align:center; border-top:dashed 1px #227583; background:#B2DFDA; color:#CCC;} .nav li ul a {WIDTH: 9em} .nav li ul ul {MARGIN: -1.75em 0px 0px 14em} .nav li:hover ul ul {LEFT: -999em} .nav li:hover ul ul ul {LEFT: -999em} .nav li.sfhover ul ul {LEFT: -999em} .nav li.sfhover ul ul ul {LEFT: -999em} .nav li:hover ul {LEFT: auto} .nav li li:hover ul {LEFT: auto} .nav li li li:hover ul {LEFT: auto} .nav li.sfhover ul {LEFT: auto} .nav li li.sfhover ul { LEFT: auto} .nav li li:hover{width:auto; text-align:center; border-top:dashed 1px #B2DFDA; background:url(images/menubg.png) repeat top left;} .nav li li li.sfhover ul {LEFT: auto} .nav li:hover { BACKGROUND:none; color:#666; } .nav li.sfhover {BACKGROUND: #eda} .nav a {float:left; background:url(images/nav-left1.png) no-repeat left top; color:#2DA89A; margin:0; padding:0; text-decoration:none; font-weight:bold;} .nav a span {float:left; display:block; background:url(images/nav-right1.png) no-repeat right top; padding:0px; color:#fff;} .nav a span {float:none; color:#3f6f1c;} h1{font-family:Arial, Helvetica, sans-serif; font-size:18px; color:#2da89a; padding-top:10px; } h6{font-family:Arial, Helvetica, sans-serif; font-size:14px; color:#2da89a; padding-top:10px; text-decoration:underline; font-style:italic; } h5{font-family:Arial, Helvetica, sans-serif; font-size:14px; color:#888; padding-top:10px; padding-bottom:10px; font-style:italic; } .bolded { color: #cc98ae; } #repeating {background-image: url(images/top-repeat.png); background-repeat: repeat-x; height: 90px; } #topnav { text-transform: uppercase; font-size: 10px; } table td { color: #999999; } /* ============================================== Navigation End Here ============================================= */ /* ============================================== body Start Here ============================================= */ .bodywrapper{float:left; margin:-75px 0 0 7px; padding:0; font-family:Arial, Helvetica, sans-serif; background:url(images/midbg.png) repeat-y top center; text-decoration:none; font-weight:12px; width:988px; } .bodynner{ margin:auto; width:942px;} .bodytopbg{background:url(images/bgtopbot.png) no-repeat top left; float:left; width:100%; height:22px;} .bodymidbg{float:left; width:988px; height:auto;} .bodybotbg{background:url(images/bgtopbot.png) no-repeat; background-position: 0% -23px; float:left; width:100%; height:22px;} .contentwrpper{margin:auto; width:942px; margin-top:20px;} .contentleft{float:left; width:610px; height:auto; margin-left: 25px; margin-top: -5px;} .toptitle{font-family: "Times New Roman", Times, serif; font-size:24px; color: #FFFF00; font-weight:600; background:url(images/bot.png) bottom left repeat-x; width: 650px; height:34px; margin-bottom: 25px;} .s3{ float:left; width:589px; border:1px dashed #2da89a; padding:10px 10px;} .s4{ float:left; width:589px; padding:10px 10px;} .s5 {text-align: right;} .s6 {font-size: 18px; vertical-align: top;} .facebooklike{float:left; text-align:right; width:99%; margin:10px 0 0 250px;*margin:10px 0 0 248px; height:auto;} .topsubtitle{font-family:Arial, Helvetica, sans-serif; font-size:14px; line-height:22px; color:#3f3f3f; padding-top:5px; font-weight:100;width: 700px;} .contentright{float:left; width:195px; height:auto; margin-left:120px;} .righttab{float:left; width:100%; height:12px;} .righttab_a{float:left; width:100%; height:auto; background:#227583; padding:10px auto;} .topsubff{font-family:Arial, Helvetica, sans-serif; text-align:center; font-size:14px; line-height:22px; padding-bottom:6px; color:#fff; font-weight:600;} .righttab_se{float:left; width:311px; height:auto; background:#ffe3d1; padding:5px auto;} .righttab_se_img{float:left; width:97px; height:121px; background:#ffe3d1; padding:0px auto; margin:8px 8px 8px 8px;} .righttab_se_txt{float:left; width:180px; height:150px; background:#ffe3d1; line-height:22px; padding:0px auto; margin:8px 8px 8px 5px;} .righttab_se_txtfield{float:right; background:url(images/txtfield.jpg) repeat-x top left; border:1px solid #333; width:206px; height:20px;} .righttab_se_txtfieldiv{float:right; width:206px; height:20px; margin:0px 20px 10px 0px;} .righttab_next{float:left; text-align:left; width:311px; height:auto; height:42px;} .righttab_blogs{float:left; margin:5px} .righttab_blogtxt{float:left; margin:8px; font-size:20px; font-family:Arial, Helvetica, sans-serif; color:#fff; font-weight:600;} .righttab_se_tittxt{float:left; font-weight:600; width:60px; padding-left:18px; padding-top:2px;} .righttab_center{width:100%; margin:auto; text-align:center; background:#ffe3d1; margin:0px auto; padding-bottom:10px;} .nextab{float:left; font-weight:100; padding:10px auto; width:311px;} .nextab p{float:left; font-weight:600; width:100%; padding:8px; font-size:14px; color:#424242} .nextab ul{float:left; font-weight:100; width:100%; padding-left:25px; color:#212121} .nextab ul li{float:left; font-weight:100; width:100%; display:marker; height:22px;} .nextab_a{float:left; font-weight:100; padding:0 8px; width:292px; line-height:21px; } .nextab_b{float:left; text-align:right; font-weight:600; color:#424242; width:292px; padding-bottom:20px;} .facbook{float:left; font-weight:100; width:311px; background:#ffe3d1; height: 500px;} .facbook div{float:left; font-weight:100; width:58px; height:58px; margin:9px;} .frmfield2{ border:1px solid #ccc; height:16px; width:175px;} .frmfield_bi{ border:1px solid #ccc; height:80px; width:300px;} .aboutprofileimg{ float:left; padding:2px; border:1px solid #000; margin-right:10px; margin-top:7px;} .heading { color: #FFFF00; font-family:"Times New Roman", Times, serif; font-style:italic; font-size: 16px; } table#jewelry td, table#jewelry input#submit, table#jewelry input#reset { font-size: 16px; font-weight: bold; color: #040617; padding: 5px; } table#jewelry { background-color: #ffffff; padding: 10px; margin-top: 25px; border: 2px dashed #040617; margin-bottom: 25px; } table#jewelry input#submit, table#jewelry input#reset { padding: 5px; background-color: #040617; color: #FFFF00; } /* ============================================== body End Here ============================================= */ /* ============================================== footer Start Here ============================================= */ .footer{float:left; width:100%; background-image: url(images/bottom.png); background-repeat: no-repeat; height:10px; } .footertxt{margin:auto; width:988px; color:#35838f;} .footerme{float:left; width:530px; } .footerme ul{float:left; width:180px; padding-left:35px; padding-top:12px; color:#35838f; font-family:Arial, Helvetica, sans-serif;} .footerme ul li{float:left; width:100%; height:24px; padding-top:10px; display:block; border-bottom:dashed 1px #35838f;} .footerme ul li a{float:left; color:#35838f; font-family:Arial, Helvetica, sans-serif;} .footerright{float:right; width:450px;} .footercopyleft{float:left; width:720px; color:#35838f; padding:22px 10px 10px 10px;} .footercopyright{float:right; width:150px; color:#35838f; padding:10px;} .footercopyright div{float:left; padding:10px;} .footerimgmail{float:right; padding:10px; width:408px; height:76px; margin-top:60px; margin-right:25px;} /* ============================================== footer End Here ============================================= */ Can anyone tell me how to get it centered with the rest of the content? I have tried using margin: 0px auto, but that isn't working, and if I set the left-margin, it is changed if the browser is resizsed, etc. Can anyone please help? It's driving me crazy, and I know it must be something simple I'm missing. Thanks for any help! Quote Link to comment https://forums.phpfreaks.com/topic/229030-centering-footer/ Share on other sites More sharing options...
sunfighter Posted March 2, 2011 Share Posted March 2, 2011 You have nothing in your footer. What footers do you need help with - Some do need work. <div class="footer" can find nor see the image. Please put it on the site <div class="footerme" and <div class="footerright" appear to be on the same level - do you need them formated and how - Please put something in the divs so we can see. <div class="footerimgmail" Looks out of place - it needs content div class="footercopyleft" and <div class="footercopyright" look messed up but again nothing in the div so we can see. Put stuff in the divs and name the divs you need work on. Quote Link to comment https://forums.phpfreaks.com/topic/229030-centering-footer/#findComment-1181688 Share on other sites More sharing options...
dbrimlow Posted March 2, 2011 Share Posted March 2, 2011 The layout structure has major flaws and is not cross-browser compatible (it totally blows up in IE6). However, the quick fix for what you have is twofold: 1. add 7px left margin to the footer, position the img to "top" "center" and remove the height, like so: .footer{float:left; margin:0 0 0 7px; background: url(images/bottom.png) top center no-repeat} The footer will now become the main footer wrap for all footer content. 2. because of the way you are using non-float wrappers and floated sections, all content needs to be contained within the global wrappers: This is a prime example of why you should not design an HTML markup layout grid without having any content! Design is created AROUND the content, not trying to fit content into an existing design. I. Anyway, move the closing of both mainwraper divs to the bottom of the page (above closing body tag) to INCLUDE the footer tags. II. Wrap the footer div around the other footer divs. The page bottom now should be: </div><!-- closes bodywrapper --> <div class="footer"> <div class="footertxt"> <div class="footerme"> </div> <div class="footerright"></div> <div class="footerimgmail"></div> <div class="footercopyleft"></div> <div class="footercopyright"> <div class=" "></div> </div> </div> <!-- closes footertext --> </div> <!-- closes footer --> </div> <!-- closes .mainwrapper --> </div> <!-- closes #mainwrapper --> </body> </html> It should work fine in Firefox, Chrome and Safari Quote Link to comment https://forums.phpfreaks.com/topic/229030-centering-footer/#findComment-1182037 Share on other sites More sharing options...
twilitegxa Posted March 3, 2011 Author Share Posted March 3, 2011 Thank you sooo much for your suggestions. I will work on these right away! I actually took over on the development of this layout from another designer, so that is why some of it seems flawed. Thank you so much for pointing all of that stuff out, so that I may learn from their mistakes as well as my own :-) UPDATE: I made the changes you suggested dbrimlow but the footer image is still not showing up properly. You can check the link to see what I mean. What am I doing wrong now? Quote Link to comment https://forums.phpfreaks.com/topic/229030-centering-footer/#findComment-1182415 Share on other sites More sharing options...
twilitegxa Posted March 3, 2011 Author Share Posted March 3, 2011 You have nothing in your footer. What footers do you need help with - Some do need work. <div class="footer" can find nor see the image. Please put it on the site <div class="footerme" and <div class="footerright" appear to be on the same level - do you need them formated and how - Please put something in the divs so we can see. <div class="footerimgmail" Looks out of place - it needs content div class="footercopyleft" and <div class="footercopyright" look messed up but again nothing in the div so we can see. Put stuff in the divs and name the divs you need work on. The only footers I think I am going to be using are footer and footertxt, so I may end up removing the others. Thanks for pointing that out! Quote Link to comment https://forums.phpfreaks.com/topic/229030-centering-footer/#findComment-1182421 Share on other sites More sharing options...
dbrimlow Posted March 7, 2011 Share Posted March 7, 2011 You have two extra closing divs BEFORE the footer AND after the footer. Remove the two closing divs BEFORE the footer. id="mainwrapper" and class="mainwrapper" should close AFTER footer. You need to wrap the footer within those two divs. You did that according to my instructions, but then forgot to remove the old closing divs. change this: </div> <br> </div> </div> </div> <!-- closes bodywrapper --> to this: </div> <br> </div> <!-- closes bodywrapper --> Quote Link to comment https://forums.phpfreaks.com/topic/229030-centering-footer/#findComment-1184084 Share on other sites More sharing options...
twilitegxa Posted March 7, 2011 Author Share Posted March 7, 2011 I don't see that code in my actual footer. Are you sure I did what I was supposed to do? Here is what I have in my footer now: <?php /** * The template for displaying the footer. * * Contains the closing of the id=main div and all content * after. Calls sidebar-footer.php for bottom widgets. * * @package WordPress * @subpackage Twenty_Ten * @since Twenty Ten 1.0 */ wp_footer(); ?> <><!-- closes bodywrapper --> <div class="footer"> <div class="footertxt"> <div class="footerme"> <> <div class="footerright"><> <div class="footerimgmail"><> <div class="footercopyleft"><> <div class="footercopyright"> <div class=" "><> <> <> <!-- closes footertext --> <> <!-- closes footer --> <> <!-- closes .mainwrapper --> <> <!-- closes #mainwrapper --> </body> </html> How should I be changing this? Quote Link to comment https://forums.phpfreaks.com/topic/229030-centering-footer/#findComment-1184114 Share on other sites More sharing options...
cssfreakie Posted March 8, 2011 Share Posted March 8, 2011 Hi there, the code you posted is pretty much invalid. I would recommend to use a nice editor that tells you this. a good editor i use myself is netbeans its free also. now back to your code: you are doing this : <> that doesn't mean anything really. All* elements in html require an end-tag so for a div-element the start-tag is <div> the end-tag is </div> and for a p-element the start-tag is <p> the end-tag is </p> See the / in the end-tag? all* end-tags have that. So in your situation you are using a div in a div (nested elements) so it could look like this: <div id="outer-div"> <div id="inner-div"></div> </div> By using indentation you can easily view which start-tag is the "partner" of which end-tag. Any-time an element is a nested child, you make an extra indentation. <div class="footer"> <div class="footertxt"> <div class="footerme"> </div> <div class="footerright"></div> <div class="footerimgmail"></div> <div class="footercopyleft"></div> <div class="footercopyright"> <div class=" "></div> </div> </div> <!-- closes footertext --> </div> <!-- closes footer --> Quote Link to comment https://forums.phpfreaks.com/topic/229030-centering-footer/#findComment-1184363 Share on other sites More sharing options...
twilitegxa Posted March 8, 2011 Author Share Posted March 8, 2011 I don't know why it did that, but the < > was actually supposed to be a closed div tag. I will copy and paste what I have again and see if it shows properly this time: <?php /** * The template for displaying the footer. * * Contains the closing of the id=main div and all content * after. Calls sidebar-footer.php for bottom widgets. * * @package WordPress * @subpackage Twenty_Ten * @since Twenty Ten 1.0 */ wp_footer(); ?> <><!-- closes bodywrapper --> <div class="footer"> <div class="footertxt"> <div class="footerme"> <> <div class="footerright"><> <div class="footerimgmail"><> <div class="footercopyleft"><> <div class="footercopyright"> <div class=" "><> <> <> <!-- closes footertext --> <> <!-- closes footer --> <> <!-- closes .mainwrapper --> <> <!-- closes #mainwrapper --> </body> </html> Anyway, my tags were nested in my php page. The problem is that I took over this code from another developer and apparently there may have been some errors along the way. I was trying to get the image for the bottom of the main content section to display at the top of the footer. It IS displaying, just not lining up correctly. :-( UPDATE: And it keeps messing up that tag for some reason, even when I manually change it. But it IS a closing div tag in my code. Viewing the source of my page should show you the code I guess though. Quote Link to comment https://forums.phpfreaks.com/topic/229030-centering-footer/#findComment-1184603 Share on other sites More sharing options...
cssfreakie Posted March 8, 2011 Share Posted March 8, 2011 Ah well any way, Your site is bad aligned the top part is 18 pixels or so aligned from the middle. We usually use margin: 0 auto for that; Now i changed your code to the following. Notice the clear that is used! .footer { background: url("images/bottom.png") no-repeat scroll center top transparent; clear: both; display: block; height: 10px; margin: 0 auto 0 -18px; } good luck! Quote Link to comment https://forums.phpfreaks.com/topic/229030-centering-footer/#findComment-1184647 Share on other sites More sharing options...
dbrimlow Posted March 10, 2011 Share Posted March 10, 2011 The main issue is that you are closing your "mainwrapper" divs too soon, THEN ALSO adding two EXTRA closing divs after the footer. You want your footer to be enclosed WITHIN those two divs, so you need to remove the two closing divs BEFORE you begin the footer. Quote Link to comment https://forums.phpfreaks.com/topic/229030-centering-footer/#findComment-1185863 Share on other sites More sharing options...
twilitegxa Posted March 11, 2011 Author Share Posted March 11, 2011 Ah well any way, Your site is bad aligned the top part is 18 pixels or so aligned from the middle. We usually use margin: 0 auto for that; Now i changed your code to the following. Notice the clear that is used! .footer { background: url("images/bottom.png") no-repeat scroll center top transparent; clear: both; display: block; height: 10px; margin: 0 auto 0 -18px; } good luck! Thank you so much for the help! It's difficult when taking over someone else's work like that! Thank you so much! Got it taken care of! Quote Link to comment https://forums.phpfreaks.com/topic/229030-centering-footer/#findComment-1185923 Share on other sites More sharing options...
cssfreakie Posted March 11, 2011 Share Posted March 11, 2011 good to hear it worked! Note though the solution brimlow offered was a possible solution too, but i though let's do it this way Quote Link to comment https://forums.phpfreaks.com/topic/229030-centering-footer/#findComment-1185938 Share on other sites More sharing options...
twilitegxa Posted March 11, 2011 Author Share Posted March 11, 2011 As long as it worked :-) Quote Link to comment https://forums.phpfreaks.com/topic/229030-centering-footer/#findComment-1185942 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.