Go Back   CodingForums.com > :: Client side development > HTML & CSS

Before you post, read our: Rules & Posting Guidelines

Reply
 
Thread Tools Rate Thread
Enjoy an ad free experience by logging in. Not a member yet? Register.
Old 01-26-2013, 10:51 AM   PM User | #1
Zamboni
New to the CF scene

 
Join Date: Jan 2013
Posts: 3
Thanks: 0
Thanked 0 Times in 0 Posts
Zamboni is an unknown quantity at this point
How to center my footer?

This certainly shouldn't be a problem but here I am. The attached file shows the basics for a website with a header and footer and a centered swf. Everything works apart from*footer2 (marked as blue). footer2 is supposed to be centered and aligned with the swf (the blue square). I thought it was as simple as "text-align:center;" but that doesn't work. I've tried everything I can think of and I'm getting nowhere.

#footer2 { position:absolute; text-align:center; bottom:0; width:1250px; height:26px; background:#0066CC; z-index: 5; }

Seen above is the problematic footer. Context is in the html.
Attached Thumbnails
Click image for larger version

Name:	Screenshot.png
Views:	25
Size:	11.8 KB
ID:	11894  
Attached Files
File Type: zip square.zip (2.1 KB, 14 views)
Zamboni is offline   Reply With Quote
Old 01-26-2013, 02:48 PM   PM User | #2
Frankie
Regular Coder

 
Join Date: Sep 2011
Posts: 286
Thanks: 3
Thanked 33 Times in 33 Posts
Frankie is an unknown quantity at this point
Hey dude,

Try
Code:
margin: 0 auto;
If that doesn't work, try the CSS centering tutorial that is linked from my signature page.
__________________
Frank

How to: Target IE in, Position in, Center in, Create a Fixed ('Sticky') Footer with, and Create a Drop-Down/Fly-Out Menu with CSS: Website Laten Maken Amsterdam.
Frankie is offline   Reply With Quote
Old 01-26-2013, 07:30 PM   PM User | #3
njfail
Regular Coder

 
Join Date: Aug 2010
Posts: 125
Thanks: 2
Thanked 0 Times in 0 Posts
njfail is an unknown quantity at this point
Here is an example of my footer. Its a pretty simple bar of links at the bottom that is centered. The margins in the HTML spaces out the links a little so its not all bunched together.

HTML:
Code:
		<div class="footerx">
			<a href="/privacypolicy/">Privacy Policy</a>
			<a style="margin-left:60px;margin-right:60px;" href="/termsofservice/">Terms of Service</a>
			<a href="/contactus/">Contact Us</a>
			<a style="margin-left:60px;margin-right:60px;" href="/ourphilosophy/">Our Philosophy</a>
		</div>
CSS:
Code:
.footerx {
	margin-top: 50px;
	margin-bottom: 50px;
	clear: both;
	display: block;
	text-align: center;
	font-size: 12px;
}

/* you can style your links here. These styles will only affect the footer links, so they can look different than other links on your page */
.footerx a:link {
	color: #505050;
}

.footerx a:visited {
	color: #909090;
}

.footerx a:hover {
	color: #000000;
}
.footerx a:active {
	color: #909090;
}
njfail is offline   Reply With Quote
Old 01-28-2013, 09:42 AM   PM User | #4
nayansrr
New to the CF scene

 
Join Date: Jan 2013
Posts: 3
Thanks: 0
Thanked 0 Times in 0 Posts
nayansrr is an unknown quantity at this point
Quote:
Originally Posted by Frankie View Post
Hey dude,

Try
Code:
margin: 0 auto;
If that doesn't work, try the CSS centering tutorial that is linked from my signature page.
I think its definitely work with every specification, margin:0 Auto - make a website compatible with all browser.
nayansrr is offline   Reply With Quote
Old 01-28-2013, 04:02 PM   PM User | #5
jerry62704
Senior Coder

 
jerry62704's Avatar
 
Join Date: Oct 2007
Location: Springfield, IL
Posts: 1,049
Thanks: 9
Thanked 81 Times in 81 Posts
jerry62704 is on a distinguished road
Just off the top of my head, I changed it to id rather than class and it worked for me in a little test file. I don't see any errors in the css. Post the entire HTML.
__________________
.
.
...and gladly would he learn and gladly teach

Visit www.LiberalsWin.com for humor and the unique Bush/Obama Approval Polls
jerry62704 is offline   Reply With Quote
Old 01-28-2013, 05:35 PM   PM User | #6
Zamboni
New to the CF scene

 
Join Date: Jan 2013
Posts: 3
Thanks: 0
Thanked 0 Times in 0 Posts
Zamboni is an unknown quantity at this point
It works if I add this:

left:0; right:0; margin: 0 auto;

Some other coder told me.
Zamboni is offline   Reply With Quote
Old 01-28-2013, 05:38 PM   PM User | #7
Zamboni
New to the CF scene

 
Join Date: Jan 2013
Posts: 3
Thanks: 0
Thanked 0 Times in 0 Posts
Zamboni is an unknown quantity at this point
The html is in the zip attached with the first post. But anyway I found a way that works. Specified in my response to "Frankie".
Zamboni is offline   Reply With Quote
Reply

Bookmarks

Jump To Top of Thread


Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +1. The time now is 10:32 PM.


Advertisement
Log in to turn off these ads.