SitePoint Sponsor

User Tag List

Results 1 to 5 of 5

Thread: centering?

  1. #1
    SitePoint Wizard lukeurtnowski's Avatar
    Join Date
    Mar 2003
    Location
    Coronado
    Posts
    1,666
    Mentioned
    3 Post(s)
    Tagged
    0 Thread(s)

    centering?

    How do I center the 3 elements (in the black boxes both horizontally and vertically
    Thanks....
    http://www.fixmysite.us/jim/
    "Oh, and Jenkins--apparently your mother died this morning."

  2. #2
    It's all Geek to me silver trophybronze trophy
    ralph.m's Avatar
    Join Date
    Mar 2009
    Location
    Melbourne, AU
    Posts
    24,319
    Mentioned
    462 Post(s)
    Tagged
    8 Thread(s)
    Firstly, you'd really need those back areas to be actual divs, I'd suggest.

    You could try something like this, although it's not very flexible and would have to be different for each example if the images are all of different sizes:

    Code:
    <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
    <html lang="en">
    
    <head>
    
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
    
    <title>Experiment</title>
    	
    <style type="text/css" media="all">
    .outer {width: 300px; height:300px; background: red; margin: 100px auto 0; position:relative}
    .inner {width: 200px; height:200px; background: blue; margin:-100px 0 0 -100px; top: 50%; left:50%; position:absolute;}
    </style>
    	
    </head>
    
    
    <body>
    <div class="outer">
      <div class="inner">
      </div>
    </div>
    
    </body>
    
    </html>

  3. #3
    billycundiff{float:left;} silver trophybronze trophy RyanReese's Avatar
    Join Date
    Oct 2008
    Location
    Whiteford, Maryland, United States
    Posts
    13,750
    Mentioned
    11 Post(s)
    Tagged
    0 Thread(s)
    Just worked a double shift at DQ..so unless I'm mistaken he could make it more flexible by changing the margins to percentages (50&#37 .

    Look at Pauls site for vertical alignment examples

    http://pmob.co.uk
    Always looking for web design/development work.
    http://www.CodeFundamentals.com

  4. #4
    SitePoint Enthusiast
    Join Date
    Mar 2010
    Posts
    43
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    - ... people still use marques?! I'm guessing blinking is back to haunt, too, hmmm?

  5. #5
    billycundiff{float:left;} silver trophybronze trophy RyanReese's Avatar
    Join Date
    Oct 2008
    Location
    Whiteford, Maryland, United States
    Posts
    13,750
    Mentioned
    11 Post(s)
    Tagged
    0 Thread(s)
    Well I must admit, marquees are rarely rarely ever used anymore, because they are deprecated in HTML 4.01 strict.

    Marquees are annoying and should be avoided, but if your client absolutely must have them for some reason, then Javascript should be used instead
    Always looking for web design/development work.
    http://www.CodeFundamentals.com


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
  •