Welcome!

And don't forget to edit your signature & profile.

 

Icon

Statistics

  • Total posts 23318
  • Total topics 4049
  • Total members 5574
  • Our newest member
    ALF5583

TOP POSTERS

centering #container?

All problems and developments related to (X)HTML-markup and stylesheets are discussed and resolved here.
   

centering #container?

Postby threedash » Sun Nov 01, 2009 3:10 pm

Hey,

so the process of threedash is moving along, but here comes the headache. :twisted:

threedash.com (trying to center the picture but it's not working) (please visit the website, the css tag doesn't seem right)

_threedash.com
User avatar
threedash
Smashing <frame>
 
Posts: 12
Joined: Tue Oct 27, 2009 8:12 pm
   

   

Re: centering #container?

Postby Andy » Sun Nov 01, 2009 4:41 pm

remove the width on body and TADA.
Andy
Smashing <h5>
 
Posts: 1023
Joined: Tue Sep 30, 2008 6:42 pm
Location: Sweden
   

   

Re: centering #container?

Postby jigar1984 » Mon Nov 02, 2009 3:06 am

Hi,

Here is the code..

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Untitled Document</title>
<style type="text/css">
body {
font: 14px "Georgia", Times New Roman, Times, serif;
background: url(http://threedash.com/images/bg.jpg);
display: table;
background-repeat: no-repeat;
background-color: #000;
margin: 0px;
}

#container {
width: 1015px;
height: 1000px;
margin: 0 auto;
}

#header {
width: 1015px;
height: 233px;
}

#leftnav {
float: left;
width: 300px;
height: 623px;
}

#welcome {
float: right;
width: 715px;
height: 623px;
background-image: url(http://threedash.com/images/welcome.jpg);
}
</style>
</head>

<body>

<div id="container">

<div id="header"> </div>
<div id="leftnav"> </div>

<div id="welcome"> </div>

</div>


</body>
</html>
User avatar
jigar1984
 
Posts: 1
Joined: Mon Nov 02, 2009 2:09 am
Location: India
   

   

Re: centering #container?

Postby hero-master » Mon Nov 02, 2009 1:18 pm

Hi there,

Code: Select all
body {
font: 14px "Georgia", Times New Roman, Times, serif;
background: url(http://threedash.com/images/bg.jpg);
display: table;
background-repeat: no-repeat;
background-color: #000;
margin: 0px;
}

Delete "display: table;". There is no reason to put it there anyway.

btw: Dont forget about Opera and reset the padding for the body-tag, as well. Even better: Go for a global reset.
hero-master
 
Posts: 4
Joined: Sun Nov 01, 2009 1:24 pm
Location: Hamburg, Germany
   

   

Re: centering #container?

Postby Andy » Mon Nov 02, 2009 7:17 pm

hero-master wrote:btw: Dont forget about Opera and reset the padding for the body-tag, as well.


Opera has no padding to the body.

I have no idea where you got that idea from.
Andy
Smashing <h5>
 
Posts: 1023
Joined: Tue Sep 30, 2008 6:42 pm
Location: Sweden
   

   

Re: centering #container?

Postby hero-master » Tue Nov 03, 2009 10:16 am

Andy wrote:Opera has no padding to the body.

I have no idea where you got that idea from.


My bad, but I remember that there was a problem width padding and body though, maybe in early versions or was it Netscape?
hero-master
 
Posts: 4
Joined: Sun Nov 01, 2009 1:24 pm
Location: Hamburg, Germany
   

   

Re: centering #container?

Postby Andy » Tue Nov 03, 2009 11:39 am

hero-master wrote:My bad, but I remember that there was a problem width padding and body though, maybe in early versions or was it Netscape?


This hasn't been an issue for 4 years (Opera version 8 and below). There's no point in accommodating dead browsers, is there?
Andy
Smashing <h5>
 
Posts: 1023
Joined: Tue Sep 30, 2008 6:42 pm
Location: Sweden
   

   

Re: centering #container?

Postby hero-master » Tue Nov 03, 2009 12:56 pm

Andy wrote:This hasn't been an issue for 4 years (Opera version 8 and below). There's no point in accommodating dead browsers, is there?

I just wanted to point out, that I wasnt THAT wrong ;)
Of course, there is no need in accommodating opera 8, but I havent realized they fixed it.
hero-master
 
Posts: 4
Joined: Sun Nov 01, 2009 1:24 pm
Location: Hamburg, Germany
   

   

Re: centering #container?

Postby Andy » Tue Nov 03, 2009 1:08 pm

hero-master wrote:I just wanted to point out, that I wasnt THAT wrong ;)
Of course, there is no need in accommodating opera 8, but I havent realized they fixed it.


Indeed, you weren't that wrong. Only slightly :P

Anyway, it's fine to reset the padding on the body if you suspect that other browsers might suffer from the same issue. Just as long as you don't do it under the premise of "fixing opera". We should all work to reduce the payload sent to the visitor, correct? :)
Andy
Smashing <h5>
 
Posts: 1023
Joined: Tue Sep 30, 2008 6:42 pm
Location: Sweden
   


Return to CSS and (X)HTML



Who is online

Users browsing this forum: No registered users and 1 guest