www.webdeveloper.com
Results 1 to 2 of 2

Thread: Centering question

Hybrid View

  1. #1
    Join Date
    Feb 2012
    Posts
    4

    Centering question

    The website pages at this testing server are liquid. The menu buttons are centered with a margin:0 auto; attribute. How can I make the flash stay centered under the menu buttons as the browser width is changed? Here is the div containing the flash:
    #content {
    background-color:#FFFFFF;
    margin: 0 auto;
    float: left;
    width: 100%;
    padding-top: 0px;
    padding-right: 0px;
    padding-bottom: 10px;
    padding-left: 0px;
    }

  2. #2
    Join Date
    May 2005
    Location
    Gold Coast (MS)
    Posts
    2,198
    Floating an element will prevent any centering. Centering an element requires setting a width that is less than 100%, using a proper document type and using the CSS property: margin: 0 auto; This is done in the CSS that styles the element. Example:

    Example as an ID:

    #selector_name{
    width: 90%;
    height: 600px; /* optional */
    margin: 0 auto;
    background: #fff url(path to non-tiled image) no-repeat center scroll;
    }

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
HTML5 Development Center



Recent Articles