1.

Solve : Center a website problem?

Answer»

I have made a website and i have made it center for every browser but it nevers gets center for IE anyone know a way to get around it Code?CSS and HTMLArghhhhh.....

What code are you using at the minute? I assume you're using etc.?

Here's the proper way: http://www.webdesigntuts.net/css-tutorials/how-to-center-a-website-with-css.html
Quote from: kpac on November 12, 2010, 12:32:36 PM

Code?
Quote from: Typhoon on November 12, 2010, 02:39:15 PM
CSS and HTML

Sorry, but had to laughDon't worry, I had that same urge.yeah im useing the proper way   haha didn't know what i was thinking oh i know i was eating food lolOkay....so post the code you're using now.This may be wrong lol im new to this website that im doing plus im a beginner to website design lol
but here it is

body{
   font-family: Arial,sans-serif;
   color: #333333;
   line-height: 1.166;   
   margin: 0px;
   padding: 0px;
   background: #ffffff url(bg_grad.jpg) fixed;
}



a:link, a:visited{
   color: #005FA9;
   text-decoration: none;
}

a:hover{
   text-decoration: underline;
}



h1{
 font: bold 120% Arial,sans-serif;
 color: #334d55;
 margin: 0px;
 padding: 0px;
}

h2{
 font: bold 114% Arial,sans-serif;
 color: #006699;
 margin: 0px;
 padding: 0px;
}

h3{
 font: bold 100% Arial,sans-serif;
 color: #334d55;
 margin: 0px;
 padding: 0px;
}

h4{
 font: 100% Arial,sans-serif;
 color: #333333;
 margin: 0px;
 padding: 0px;
}

h5{
 font: 100% Arial,sans-serif;
 color: #334d55;
 margin: 0px;
 padding: 0px;
}



ul{
 list-style-type: square;
}

ul ul{
 list-style-type: disc;
}

ul ul ul{
 list-style-type: none;
}



form {
   margin: 0;
   padding: 0;
}

label{
 font: bold 1em Arial,sans-serif;
 color: #334d55;
}
            
input{
font-family: Arial,sans-serif;
}


#pagecell1{
   margin:0 AUTO;
   top: 197px;
   left: 99px;
   right: 99px;
   width:822px;
   background-color: #ffffff;
}

#tl {
   margin:0 auto;
   top: -1px;
   left: -1px;
   margin: 0px;
   padding: 0px;
   z-index: 100;
}

#tr {
   margin:0 auto;
   top: -1px;
   right: -1px;
   margin: 0px;
   padding: 0px;
   z-index: 100;
}

#masthead{
   margin:0 auto;
   padding:15px 0 0 0;
   top: 25px;
   height:172px;
   left: 99px;
   right: 99px;
   width:822px;
      
}

#pageNav{
   margin:0 auto;
   float: left;
   width:178px;
   padding: 0px;
   background-color: #F5f7f7;
   border-right: 1px SOLID #cccccc;
   border-bottom: 1px solid #cccccc;
   font: small Verdana,sans-serif;
}

#content{
   margin:0 auto;
   padding: 0px 10px 0px 0px;
   margin:0px 0px 0px 178px;
   border-left: 1px solid #ccd2d2;
}
And...

the HTML?

(the CSS has nothing in it that would indicate CENTERING...)










 


 

   







What are you using to create your site?dreamweverOkay. Your CSS styles are using what's called absolute positioning. You are telling them exactly where to be on the page, i.e. "top: 55px; left: 195px" etc. etc. This is a very bad way of doing it, because 1) not everyone has the same size screen as you, 2) not everyone uses the same browser as you, 3) toolbars and the height of the browser window affect it.

Are you manually typing the code into DW or are you letting the software do it? yes im manually, ok do you know any tuts that would help me


Discussion

No Comment Found