Welcome guest. Before posting on our computer help forum, you must register. Click here it's easy and free.

Author Topic: Center a website problem  (Read 11976 times)

0 Members and 1 Guest are viewing this topic.

Typhoon

  • Guest
Center a website problem
« on: November 12, 2010, 11:22:51 AM »
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

kpac

  • Web moderator
  • Moderator


  • Hacker

  • kpac®
  • Thanked: 184
    • Yes
    • Yes
    • Yes
  • Certifications: List
  • Computer: Specs
  • Experience: Expert
  • OS: Windows 7
Re: Center a website problem
« Reply #1 on: November 12, 2010, 12:32:36 PM »
Code?

Typhoon

  • Guest
Re: Center a website problem
« Reply #2 on: November 12, 2010, 02:39:15 PM »
CSS and HTML

kpac

  • Web moderator
  • Moderator


  • Hacker

  • kpac®
  • Thanked: 184
    • Yes
    • Yes
    • Yes
  • Certifications: List
  • Computer: Specs
  • Experience: Expert
  • OS: Windows 7
Re: Center a website problem
« Reply #3 on: November 12, 2010, 02:46:23 PM »
Arghhhhh..... ;D

What code are you using at the minute? I assume you're using <div align="center"> etc.?

Here's the proper way: http://www.webdesigntuts.net/css-tutorials/how-to-center-a-website-with-css.html

reddevilggg



    Expert

    Thanked: 69
  • Experience: Beginner
  • OS: Windows 7
Re: Center a website problem
« Reply #4 on: November 12, 2010, 03:00:00 PM »
11 cheers for binary !

kpac

  • Web moderator
  • Moderator


  • Hacker

  • kpac®
  • Thanked: 184
    • Yes
    • Yes
    • Yes
  • Certifications: List
  • Computer: Specs
  • Experience: Expert
  • OS: Windows 7
Re: Center a website problem
« Reply #5 on: November 12, 2010, 03:39:17 PM »
Don't worry, I had that same urge.

Typhoon

  • Guest
Re: Center a website problem
« Reply #6 on: November 12, 2010, 03:54:43 PM »
yeah im useing the proper way :)  haha didn't know what i was thinking oh i know i was eating food lol

kpac

  • Web moderator
  • Moderator


  • Hacker

  • kpac®
  • Thanked: 184
    • Yes
    • Yes
    • Yes
  • Certifications: List
  • Computer: Specs
  • Experience: Expert
  • OS: Windows 7
Re: Center a website problem
« Reply #7 on: November 12, 2010, 04:11:15 PM »
Okay....so post the code you're using now.

Typhoon

  • Guest
Re: Center a website problem
« Reply #8 on: November 12, 2010, 04:39:04 PM »
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;
}

BC_Programmer


    Mastermind
  • Typing is no substitute for thinking.
  • Thanked: 1140
    • Yes
    • Yes
    • BC-Programming.com
  • Certifications: List
  • Computer: Specs
  • Experience: Beginner
  • OS: Windows 11
Re: Center a website problem
« Reply #9 on: November 12, 2010, 10:59:51 PM »
And...

the HTML?

(the CSS has nothing in it that would indicate centering...)
I was trying to dereference Null Pointers before it was cool.

Typhoon

  • Guest
Re: Center a website problem
« Reply #10 on: November 13, 2010, 10:37:20 AM »
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<title></title>
<link rel="stylesheet" href="emx_nav_left.css" type="text/css" />
<style type="text/css">
<!--
.style3 {font-size: 8pt}
.style4 {font-size: 12px}
.style9 {font-size: 11px}
.style10 {font-size: 10px}
.style13 {color: #FF0000; font-weight: bold; font-size: 10pt; }
.style14 {color: #999999}
.style15 {color: #0099FF}
.style16 {color: #000000}
-->
</style>
</head>
<body>
<div id="masthead">
  <div align="center"><img src="header.jpg" width="822" height="172"></div>
</div>
<div id="pagecell1">
  <div id="pageNav">

    </div>
</div>
<!--end pagecell1-->



</body>
</html>

kpac

  • Web moderator
  • Moderator


  • Hacker

  • kpac®
  • Thanked: 184
    • Yes
    • Yes
    • Yes
  • Certifications: List
  • Computer: Specs
  • Experience: Expert
  • OS: Windows 7
Re: Center a website problem
« Reply #11 on: November 13, 2010, 10:52:31 AM »
What are you using to create your site?

Typhoon

  • Guest
Re: Center a website problem
« Reply #12 on: November 13, 2010, 10:53:39 AM »
dreamwever

kpac

  • Web moderator
  • Moderator


  • Hacker

  • kpac®
  • Thanked: 184
    • Yes
    • Yes
    • Yes
  • Certifications: List
  • Computer: Specs
  • Experience: Expert
  • OS: Windows 7
Re: Center a website problem
« Reply #13 on: November 13, 2010, 11:36:36 AM »
Okay. 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?

Typhoon

  • Guest
Re: Center a website problem
« Reply #14 on: November 13, 2010, 11:46:37 AM »
yes im manually, ok do you know any tuts that would help me :)

TechFixOrg



    Rookie
    • Yes
    • TechFix.org
  • Certifications: List
  • Experience: Guru
  • OS: Windows 7
Re: Center a website problem
« Reply #15 on: November 20, 2010, 01:29:43 AM »

TechFixOrg



    Rookie
    • Yes
    • TechFix.org
  • Certifications: List
  • Experience: Guru
  • OS: Windows 7
Re: Center a website problem
« Reply #16 on: November 20, 2010, 02:19:50 AM »
Use css instead of html to center it.

example:
Code: [Select]
.center
{
   margin-left:auto;
   margin-right:auto;
   width:75%;
}

TechFixOrg



    Rookie
    • Yes
    • TechFix.org
  • Certifications: List
  • Experience: Guru
  • OS: Windows 7
Re: Center a website problem
« Reply #17 on: November 20, 2010, 02:22:52 AM »
also... you have this:
Code: [Select]
<div id="masthead">
  <div align="center"><img src="header.jpg" width="822" height="172"></div>
</div>

you left out a / in your image tag, it should be:
Code: [Select]
<div id="masthead">
  <div align="center"><img src="header.jpg" width="822" height="172" /></div>
</div>


Typhoon

  • Guest
Re: Center a website problem
« Reply #18 on: November 20, 2010, 01:56:48 PM »
ok ill try that thanks

jim345

  • Guest
Re: Center a website problem
« Reply #19 on: November 22, 2010, 05:21:47 AM »
I am having the same  problem. It is annoying wit IE.

Quantos



    Guru
  • Veni, Vidi, Vici
  • Thanked: 170
    • Yes
    • Yes
  • Computer: Specs
  • Experience: Guru
  • OS: Linux variant
Re: Center a website problem
« Reply #20 on: November 23, 2010, 12:25:11 AM »
I am having the same  problem. It is annoying wit IE.
Start a new thread, we will assist you there.
Evil is an exact science.

TechFixOrg



    Rookie
    • Yes
    • TechFix.org
  • Certifications: List
  • Experience: Guru
  • OS: Windows 7
Re: Center a website problem
« Reply #21 on: November 23, 2010, 07:05:17 AM »
Try This...

Code: [Select]
<div id="masthead">
    <div style="text-align:-moz-center; text-align:center; ">
        <img src="header.jpg" width="822" height="172" />
    </div>
</div>

Typhoon

  • Guest
Re: Center a website problem
« Reply #22 on: December 02, 2010, 11:34:23 AM »
Try This...

Code: [Select]
<div id="masthead">
    <div style="text-align:-moz-center; text-align:center; ">
        <img src="header.jpg" width="822" height="172" />
    </div>
</div>


No that doesn'r work

shpgrl



    Starter

    • Experience: Beginner
    • OS: Unknown
    Re: Center a website problem
    « Reply #23 on: December 10, 2010, 06:38:06 PM »

    What happened to just using
    <center > before your body and
    </center > after

    or one right after your opening head tag and one right before the ending head tag, depending on how your page is set up.

    Has always worked for me.

     

    BC_Programmer


      Mastermind
    • Typing is no substitute for thinking.
    • Thanked: 1140
      • Yes
      • Yes
      • BC-Programming.com
    • Certifications: List
    • Computer: Specs
    • Experience: Beginner
    • OS: Windows 11
    Re: Center a website problem
    « Reply #24 on: December 10, 2010, 06:40:55 PM »
    What happened to just using
    <center > before your body and
    </center > after

    or one right after your opening head tag and one right before the ending head tag, depending on how your page is set up.

    Has always worked for me.


    yeah that was a great solution,

    in 1996.
    I was trying to dereference Null Pointers before it was cool.

    shpgrl



      Starter

      • Experience: Beginner
      • OS: Unknown
      Re: Center a website problem
      « Reply #25 on: December 10, 2010, 06:49:58 PM »

      yeah that was a great solution,

      in 1996.


      So you're saying that doesn't work anymore?

      Worked for me as of....um....last week?

      BC_Programmer


        Mastermind
      • Typing is no substitute for thinking.
      • Thanked: 1140
        • Yes
        • Yes
        • BC-Programming.com
      • Certifications: List
      • Computer: Specs
      • Experience: Beginner
      • OS: Windows 11
      Re: Center a website problem
      « Reply #26 on: December 10, 2010, 06:52:01 PM »
      So you're saying that doesn't work anymore?
      Never said that.

      But you know what else works? Netscape navigator 4.
      I was trying to dereference Null Pointers before it was cool.

      kpac

      • Web moderator
      • Moderator


      • Hacker

      • kpac®
      • Thanked: 184
        • Yes
        • Yes
        • Yes
      • Certifications: List
      • Computer: Specs
      • Experience: Expert
      • OS: Windows 7
      Re: Center a website problem
      « Reply #27 on: December 12, 2010, 02:59:35 PM »