SitePoint Sponsor

User Tag List

Results 1 to 2 of 2
  1. #1
    SitePoint Enthusiast jlgarcia's Avatar
    Join Date
    Sep 2001
    Location
    Baja California, México
    Posts
    95
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Centering everything on the browser

    Hi, I'm here asking again about centering things.
    This is the case:
    My client, specifically wants all the contents in the web page to be centered no matter the size of the actual browser window the the user has at the moment of view.

    I have done this before, but getting all the contents arranged in tables and surrounding this inside another table that centers everything.

    I don't want to use tables, just DIV's and CSS but I don't know how to reproduce the same effect I use to do with tables.

    Somebody in another trhead directed me to this link (http://www.dynamicsitesolutions.com/...nd_vertically/)
    but I can't get this to work in my web site.

    I think it has to do in the way I positioned the divs in the page, but im not sure..

    In order to put this site to work I just positioned the contents where they are right now, but I need to center everything on the page.

    Thanks for any help.

    The web site is http://www.adobeguadalupe.com/
    Use the source, Luke...

  2. #2
    Non-Member
    Join Date
    Jan 2005
    Location
    Netherlands
    Posts
    4,300
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Hello

    wrap a relative positioned container around your absolute containers and try again

    with margin 0 auto

    Code:
    <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
    <html>
    
    <head>
    <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
    <title>Adobe Guadalupe</title>
    
    <style type="text/css">
    <!--
    body {
    	background-color: #4c483d;
    }
    
    
    #caballos {
    	position:absolute;
    	left:0px;
    	top:0px;
    	width:700px;
    	height:380px;
    	z-index:5;
    }
    .x{position:relative;margin:0 auto;width:700px;top:91px;}
    -->
    </style></head>
    
    <body>
    <div class="x">
    
    <div id="caballos">
    <object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=7,0,19,0" width="700" height="380">
      <param name="movie" value="intro_00.swf">
      <param name="quality" value="high"><param name="BGCOLOR" value="#4C483D">
      <embed src="intro_00.swf" width="700" height="380" quality="high" pluginspage="http://www.macromedia.com/go/getflashplayer" type="application/x-shockwave-flash" bgcolor="#4C483D"></embed>
    </object>
    </div>
    
    </div>
    
    </body>
    
    </html>
    Last edited by all4nerds; Jan 9, 2006 at 11:45.


Bookmarks

Posting Permissions

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