+ Reply to Thread
Results 1 to 5 of 5

Thread: html/css centering problem

  1. #1
    Firenova is offline x10Hosting Member Firenova is an unknown quantity at this point
    Join Date
    Mar 2008
    Posts
    19

    html/css centering problem

    my current website, http://www.radicalflame.com, will stay in the center of the browser nicely, but there is one problem.

    here is the css code involved:

    position: absolute;
    width: 1000px;
    margin-left: -500px;
    left:50%;

    however, if you resize the browser window to a size smaller than 1000 pixels, you will notice that the left side of the page gets chopped off so that you cannot scroll all the way left. That's not good.

    http://www.wincustomize.com is an example of a site that behaves exactly how I want. The content is set within absolute boundaries, but the whole thing remains centered AND intact regardless of how you resize the browser.

  2. #2
    sourfacedcyclop's Avatar
    sourfacedcyclop is offline x10 Sophmore sourfacedcyclop is an unknown quantity at this point
    Join Date
    Sep 2007
    Posts
    221

    Re: html/css centering problem

    I think its because you gave it a position:absolute; value. Have you tried using margin:0 auto;? That should center it to the middle of the page.

  3. #3
    diabolo's Avatar
    diabolo is offline Community Advocate diabolo is on a distinguished road
    Join Date
    Nov 2007
    Location
    Jersey Shore
    Posts
    1,683

    Re: html/css centering problem

    yes that will fix that problem, but another problem will arise when you set it to margin: 0 auto

    your text "Welcome Guest" and "Home" will become misaligned

  4. #4
    leafypiggy's Avatar
    leafypiggy is offline Community Advocate leafypiggy is on a distinguished road
    Join Date
    Aug 2007
    Location
    Massachusetts
    Posts
    2,228

    Re: html/css centering problem

    or just simply align:center
    Neil Hanlon | x10Hosting Support Representative
    Neil[at]x10hosting.com
    █ I'm always happy to help. Just ask a question in Free Hosting
    Terms of Service IRC

  5. #5
    diabolo's Avatar
    diabolo is offline Community Advocate diabolo is on a distinguished road
    Join Date
    Nov 2007
    Location
    Jersey Shore
    Posts
    1,683

    Re: html/css centering problem

    Quote Originally Posted by leafypiggy View Post
    or just simply align:center
    "align: center" will only center child elements of that div, not the div itself

+ Reply to Thread

Similar Threads

  1. Another Problem
    By beast474 in forum Free Hosting
    Replies: 1
    Last Post: 08-27-2008, 07:22 PM
  2. Slight Problem
    By rmb1993 in forum Free Hosting
    Replies: 2
    Last Post: 08-14-2008, 06:04 AM
  3. A problem with certificate
    By eon01 in forum Free Hosting
    Replies: 1
    Last Post: 07-31-2008, 01:27 PM
  4. DB number problem
    By lionheart8 in forum Free Hosting
    Replies: 5
    Last Post: 04-08-2008, 08:26 AM
  5. Ad code problem!
    By Akkarin in forum Free Hosting
    Replies: 8
    Last Post: 08-29-2005, 10:39 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
x10hosting free hosting for the masses
dedicated servers