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,495
    Mentioned
    2 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
    SitePoint Award Recipient ralph.m's Avatar
    Join Date
    Mar 2009
    Location
    Melbourne, Australia
    Posts
    20,308
    Mentioned
    225 Post(s)
    Tagged
    3 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>
    Facebook | Google+ | Twitter | Web Design Tips | Free Contact Form

    Try your hand at the new JavaScript Challenge!

    If you don't like getting your feet stuck in a bog, avoid Twitter BootsTrap.

  3. #3
    billycundiff{float:left;} silver trophybronze trophy RyanReese's Avatar
    Join Date
    Oct 2008
    Location
    Whiteford, Maryland, United States
    Posts
    13,564
    Mentioned
    5 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
    Twitter-@Ryan_Reese09
    http://www.ryanreese.us -Always looking for web design/development work

  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,564
    Mentioned
    5 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
    Twitter-@Ryan_Reese09
    http://www.ryanreese.us -Always looking for web design/development work

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
  •