Can you check my basic, basic code?

Discussion in 'CSS' started by Hecky, May 29, 2008.

  1. #1
    Hey,

    I started doing a bit of CSS, trying to convert my PSD to an HTML.

    I sliced it, saved as HTML and now I'm trying to center it with CSS.

    Here's what I have (HTML) :

    <body>
    <div id="pagewrap">
    <p class="navigation">
    <a href="#">Home page</a></p>
    <table id="Table_01" width="700" height="500" border="0" cellpadding="0" cellspacing="0">
    	<tr>
    		<td colspan="3">
    			<img src="images/PSD_01.png" width="700" height="18" alt=""></td>
    	</tr>
    	<tr>
    		<td rowspan="4">
    			<img src="images/PSD_02.png" width="17" height="482" alt=""></td>
    		<td>
    			<img src="images/PSD_03.png" width="666" height="63" alt=""></td>
    		<td rowspan="4">
    			<img src="images/PSD_04.png" width="17" height="482" alt=""></td>
    	</tr>
    	<tr>
    		<td>
    			<img src="images/PSD_05.png" width="666" height="368" alt=""></td>
    	</tr>
    	<tr>
    		<td>
    			<img src="images/PSD_06.gif" width="666" height="29" alt=""></td>
    	</tr>
    	<tr>
    		<td>
    			<img src="images/PSD_07.png" width="666" height="22" alt=""></td>
    	</tr>
    </table>
    </div>
    Code (markup):
    Heres what I have in my CSS file :

    div#pagewrap{
    margin: 0 auto
    }
    Code (markup):
    I appreciate you looking this far, It's probably a really stupid mistake :)

    Thanks,
    -Hecky.
     
    Hecky, May 29, 2008 IP
  2. Hecky

    Hecky Like a Dungeon Dragon!

    Messages:
    5,656
    Likes Received:
    284
    Best Answers:
    1
    Trophy Points:
    0
    #2
    Ahh forget it. I found this problem but there are countless more problems I can't solve.
     
    Hecky, May 29, 2008 IP
  3. kk5st

    kk5st Prominent Member

    Messages:
    3,497
    Likes Received:
    376
    Best Answers:
    29
    Trophy Points:
    335
    #3
    A div is a block element and as wide as its parent. The table is its child and is as wide as it needs to be, or in this case 700px. Either give the div a width, or make the table {margin: 0 auto;}.

    cheers,

    gary
     
    kk5st, May 29, 2008 IP
    Hecky likes this.