Monday, August 25, 2008
Build Your Own Web Gallery
A step-by-step guide with screenshots for building your first website
STEP 6c: Centering The Content Table
I prefer websites that are centered in the browser window no matter how big the window is. To do this, I aligned the entire table to the center of the page, by adding the align="center" attribute to the <table> tag on line 34.
STEP 6d: Adding A Border To The Content Table
I also thought a subtle border would help the design. So, I added the attribute style="border" to the <table> tag. The syntax for this attribute first specifies that the border is solid (other options include dotted and dashed); that it is 1 pixel thick and that its color is black. The value #999999 is the hexadecimal color code for black. When working with colors, use hexadecimal codes.
Here's our page in Safari with the centering and border changes. Pretty slick, but I'm going to make a few more tweaks to the padding.
Here's the code with additional padding at the top of the title (line 37), and a little on the right of the navigation title to give it some space from the buttons (line 53). Yes, you can add padding and other styles directly to an <img> tag if you don't want to affect the whole cell.
Page 17 of 19