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

Author Topic: Can't get centering to work in all browsers  (Read 5736 times)

0 Members and 1 Guest are viewing this topic.

Wuai Bel Ree

    Topic Starter


    Beginner

    Can't get centering to work in all browsers
    « on: May 14, 2012, 12:55:09 PM »
    I'm trying to make a website, but there's a bit of a problem.



    In Internet Explorer, the navbar and main content get centered like I want them to be, but in Chrome & Firefox they stick to the left. Apparently there is a CSS attribute somewhere that Chrome and Firefox won't read like Internet Explorer. Anyone know what attribute I need to change so the centering will be universally recognized?

    Thanks.

    Geek-9pm


      Mastermind
    • Geek After Dark
    • Thanked: 1026
      • Gekk9pm bnlog
    • Certifications: List
    • Computer: Specs
    • Experience: Expert
    • OS: Windows 10
    Re: Can't get centering to work in all browsers
    « Reply #1 on: May 14, 2012, 02:01:39 PM »
    Are you hand coding the HTML?
    Or are you using a generator? Like maybe Dreamweaver.

    soybean



      Genius
    • The first soybean ever to learn the computer.
    • Thanked: 469
    • Computer: Specs
    • Experience: Experienced
    • OS: Windows 10
    Re: Can't get centering to work in all browsers
    « Reply #2 on: May 14, 2012, 02:17:35 PM »
    Can you post your CSS code here?

    Rob Pomeroy



      Prodigy

    • Systems Architect
    • Thanked: 124
      • Me
    • Experience: Expert
    • OS: Other
    Re: Can't get centering to work in all browsers
    « Reply #3 on: May 15, 2012, 07:51:34 AM »
    Or a URL to the site?
    Only able to visit the forums sporadically, sorry.

    Geek & Dummy - honest news, reviews and howtos

    Wuai Bel Ree

      Topic Starter


      Beginner

      Re: Can't get centering to work in all browsers
      « Reply #4 on: May 15, 2012, 10:38:51 AM »
      I'm using Dreamweaver CS3.

      Code: [Select]
      @charset "utf-8";
      .headerLinks {
      background-repeat: no-repeat;
      background-position: center center;
      height: 50px;
      width: 100%;
      font-family: Candara, Corbel, "Monotype Corsiva", Verdana;
      font-size: 20px;
      line-height: 45px;
      text-align: center;
      }
      .container {
      text-align: center;
      font-family: Candara, Corbel, "Monotype Corsiva", Verdana;
      background-position: center center;
      vertical-align: middle;
      }
      .mainContHome {
      background-image: url(Images/border_bg_home_maincont.png);
      background-repeat: no-repeat;
      background-position: center center;
      height: 360px;
      width: 1000px;
      text-align: center;
      }
      .mainContHomeText {
      width: 850px;
      height: 236px;
      margin-top: 53px;
      }
      .mainContGuidesMinigames {
      background-image: url(Images/border_bg_guides_minigames.png);
      background-repeat: no-repeat;
      background-position: center center;
      height: 500px;
      width: 1000px;
      text-align: center;
      }
      .mainContQuestsBorder {
      background-image: url(Images/border_bg_quests_table.png);
      background-repeat: no-repeat;
      height: 4400px;
      width: 1000px;
      background-position: center center;
      text-align: center;
      }
      .monstersubmission {
      background-image: url(Images/border_bg_monstersub.png);
      background-repeat: no-repeat;
      height: 800px;
      width: 1000px;
      }

      Geek-9pm


        Mastermind
      • Geek After Dark
      • Thanked: 1026
        • Gekk9pm bnlog
      • Certifications: List
      • Computer: Specs
      • Experience: Expert
      • OS: Windows 10
      Re: Can't get centering to work in all browsers
      « Reply #5 on: May 15, 2012, 02:36:41 PM »
      Here are videos for Dreamweaver tutorials.
      Videos of dreamweaver cs3 tutorials

      soybean



        Genius
      • The first soybean ever to learn the computer.
      • Thanked: 469
      • Computer: Specs
      • Experience: Experienced
      • OS: Windows 10
      Re: Can't get centering to work in all browsers
      « Reply #6 on: May 15, 2012, 04:05:50 PM »
      I think you'll find this helpful: http://www.maxdesign.com.au/articles/center/

      Rob Pomeroy



        Prodigy

      • Systems Architect
      • Thanked: 124
        • Me
      • Experience: Expert
      • OS: Other
      Re: Can't get centering to work in all browsers
      « Reply #7 on: May 16, 2012, 03:04:24 AM »
      You're missing:

      Code: [Select]
      margin-left: auto;
      margin-right: auto;

      Works in more places than text-align: center which is, well, for aligning text.
      Only able to visit the forums sporadically, sorry.

      Geek & Dummy - honest news, reviews and howtos

      Wuai Bel Ree

        Topic Starter


        Beginner

        Re: Can't get centering to work in all browsers
        « Reply #8 on: May 16, 2012, 12:52:11 PM »
        Ah, thanks Rob! That fixed it.

        Rob Pomeroy



          Prodigy

        • Systems Architect
        • Thanked: 124
          • Me
        • Experience: Expert
        • OS: Other
        Re: Can't get centering to work in all browsers
        « Reply #9 on: May 17, 2012, 03:41:49 AM »
        Cool.
        Only able to visit the forums sporadically, sorry.

        Geek & Dummy - honest news, reviews and howtos