www.webdeveloper.com
Results 1 to 6 of 6

Thread: Need help with a layout problem

  1. #1
    Join Date
    Jul 2012
    Posts
    10

    Need help with a layout problem

    Hi,

    I'm here because i need help with a problem i have been struggling with for the past month.

    I don't know how to explain it so here's my competitor's website : http://www.eroticasensation.com/erot...ion-usuel.html

    When you make your browser bigger, the table stay centered no matter what and it keeps it's original size. When you make it smaller it pushes it to the side and doesn't shrink it.

    How do you do that?

    Thanks

  2. #2
    Join Date
    Sep 2008
    Location
    Akron, OH
    Posts
    1,125
    Set the following style your whatever is wrapping your content:

    Code:
    margin: 0 auto;
    I'm always up for networking with fellow web professionals. Connect with me on LinkedIn if you like!

  3. #3
    Join Date
    Jul 2012
    Posts
    10
    Quote Originally Posted by cbVision View Post
    Set the following style your whatever is wrapping your content:

    Code:
    margin: 0 auto;
    Alright, now my table stay centered but it still shrinks.

    What am i doing wrong?

    Code:
    <!DOCTYPE html>
    <html>
    <head>
    	<style>
    		#table_skeleton {width:70&#37;;margin:0 auto;}
    		#menu {padding-left:0%;list-style-type:none;text-align:center;}
    		li {border-bottom:2px solid black;}
    	</style>
    </head>
    <body style="background-color:black;">
    
    <table id="table_skeleton" cellpadding="5" cellspacing="2">
    <tr>
    <td colspan="2" style="background-color:blue;color:white;text-align:center;">
    <h1>Title</h1>
    </td>
    </tr>
    
    <tr valign="top">
    <td style="background-color:white;width:120px;">
    	<ul id="menu">
    		<li>Dildos</li>
            <li>Lubrifiants</li>
            <li>Straps</li>
            <li>Condoms</li>     
    	</ul>
    </td>
    <td style="background-color:white;">
    	<div style="padding-left:auto;border:2px solid black;width:190px;>
        	<a href="http://www.google.ca/"><img src="test.png" height="150px"/></a>
        </div>
    </td>
    </tr>
    
    <tr>
    <td colspan="2" style="background-color:blue;text-align:center;color:white;">
    Copyright &#169; </td>
    </tr>
    </table>
    
    </body>
    </html>

  4. #4
    Join Date
    Jun 2006
    Location
    Boston, MA
    Posts
    383
    its set to a &#37;... '#table_skeleton {width:70%;margin:0 auto;}'. make it a fixed size if you don't want it to resize.
    "Problems cannot be solved by the same level of thinking that created them.

  5. #5
    Join Date
    Jul 2012
    Posts
    10
    Quote Originally Posted by absolutmgd13 View Post
    its set to a %... '#table_skeleton {width:70%;margin:0 auto;}'. make it a fixed size if you don't want it to resize.
    Thanks guys.

  6. #6
    Join Date
    Jun 2006
    Location
    Boston, MA
    Posts
    383
    no prob!
    "Problems cannot be solved by the same level of thinking that created them.

Thread Information

Users Browsing this Thread

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

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