icon Get the most out of Surmunity, read our tips here! Need an interesting blog to read? You've got to read the Surpass Blog! | Welcome! Please register to access all of our features.
Old December 17th, 2006, 10:16 PM   #1 (permalink)
Surpass Fan
Comfy Contributor
 
Joined in Dec 2004
224 posts
Gave thanks: 6
Thanked 19 times
HTML/CSS Centering

http://www.out-burst.org/outbursttry2/

In Firefox, the centering of the header and footer images works fine in all resolutions.

In IE7, the centering of the header and footer images works under a certain window size but then gets messed up...

Any ideas?

HTML for header
Code:
<div id="header"></div>
css for header

Code:
#header {
	position:absolute;
	top:0px;
	width: 900px;
	height: 133px;
	left:50%;
	margin-left: -450px;
	background: transparent url(../images/header.jpg) no-repeat top;
}

Last edited by lonelydreamer; December 17th, 2006 at 10:18 PM..
lonelydreamer is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Old December 17th, 2006, 10:35 PM   #2 (permalink)
pineapples are sharp
Super #1
 
Brandonnn's Avatar
 
Joined in Dec 2005
5,777 posts
Gave thanks: 147
Thanked 151 times
I don't know if this would be causing problems but: Padding is spelt incorrectly

Code:
body {
	background: #363942 url(../images/bg.jpg) repeat-y top center;
	margin: 0;
	paddign: 0;
	text-align:left;
}
and I would remove only the following in red and leave the rest:
(why? transparent urls generally tell browsers to resize an image based on screen resolution... which isn't a good thing since websites are generally created with raster images, and any modification will create ragged edges)

Code:
body {
	background: #363942 url(../images/bg.jpg) repeat-y top center;
	margin: 0;
	paddign: 0;
	text-align:left;
}

#header {
	position:absolute;
	top:0px;
	width: 900px;
	height: 133px;
	left:50%;
	margin-left: -450px;
	background: transparent url(../images/header.jpg) no-repeat top;
}

#bottom {
	position:absolute;
	left: 50%;
	width: 900px;
	bottom: 0px;
	margin-left: -450px;
	height: 64px;
	background: transparent url(../images/bottom.jpg) no-repeat top;
}

Since the header and footer are the same size I would change both lines that say:

Code:
margin-left: -450px;
into:

Code:
margin: auto;
__________________
poof
Brandonnn is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Old December 17th, 2006, 10:49 PM   #3 (permalink)
Surpass Fan
Comfy Contributor
 
Joined in Dec 2004
224 posts
Gave thanks: 6
Thanked 19 times
I changed the transparencies (thanks for the tip =) )

The margin thing threw off the whole template.

But those changes still didn't fix the IE problem =(

EDIT:
I fixed it, I'm coding for joomla, so I was expecting to put in the doctype when I put it into the Joomla format, adding
Quote:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<?xml version="1.0" encoding="iso-8859-1"?>
<html xmlns="http://www.w3.org/1999/xhtml">

<head>

<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
Fixed it. Can you guys check to make sure it works in your browsers and tell me any errors please =D

Last edited by lonelydreamer; December 17th, 2006 at 10:59 PM..
lonelydreamer is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Old December 17th, 2006, 11:07 PM   #4 (permalink)
Surpass Fan
Comfy Contributor
 
Joined in Dec 2004
224 posts
Gave thanks: 6
Thanked 19 times
Bah! I just checked in IE6 and it doesn't align properly =(
lonelydreamer is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Old December 17th, 2006, 11:08 PM   #5 (permalink)
pineapples are sharp
Super #1
 
Brandonnn's Avatar
 
Joined in Dec 2005
5,777 posts
Gave thanks: 147
Thanked 151 times
eh I was reading your markup incorrectly so I didn't give the margin:auto; advice correctly... anyways it looks fine in FF1.5 IE7... IE6 the alignment is off but based on your post I don't think you are coding for Legacy IE.
__________________
poof
Brandonnn is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Old December 17th, 2006, 11:14 PM   #6 (permalink)
Surpass Fan
Comfy Contributor
 
Joined in Dec 2004
224 posts
Gave thanks: 6
Thanked 19 times
Meh I'll leave it alone for now, but, I know there are still people out there who haven't/can't upgrade because of its incompatibility with some sites.
lonelydreamer is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Old December 21st, 2006, 8:56 PM   #7 (permalink)
Surpass Fan
Comfy Contributor
 
Joined in Dec 2004
224 posts
Gave thanks: 6
Thanked 19 times
Didn't want to create a new thread, but i have a new question. What would make:
Code:
<script type="Javascript"> 

startHover = function() {
    if (document.all&&document.getElementById) {
        hover = document.getElementsByTagName("div");
            for (var i = 0; i < hover.length ; i++) {
                if (hover[i].className == " item") {
                hover[i].onmouseover = function() {
                this.className = " over";
                }
                hover[i].onmouseout = function() {
                this.className=this.className.replace(" over", " item");
                }
            }
        }
    }
}
window.onload=startHover;

</script>

Not work in IE6?

The HTML is only

Code:
<div class="item">I love hovers</div>

Last edited by lonelydreamer; December 21st, 2006 at 8:59 PM..
lonelydreamer is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Old December 21st, 2006, 9:15 PM   #8 (permalink)
Surpass Fan
Comfy Contributor
 
Joined in Dec 2004
224 posts
Gave thanks: 6
Thanked 19 times
Fixed it... I had to delete a space.
lonelydreamer is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Reply


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
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 edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On