PDA

View Full Version : Heres the code


Justindukesdesign
12-26-2009, 08:59 PM
Here is the code from my site that I previously requested advice on. I need to get the images centered on the page, but am completely lost on how to do so.


<html>
<head>
<title>mainpagenav</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<style type="text/css">
<!--
body {
background-image: url(Assets/Blue%20Print%201-1.jpg);
}
-->
</style></head>
<body bgcolor="#FFFFFF" leftmargin="0" topmargin="0" marginwidth="0" marginheight="0">
<!-- Save for Web Slices (mainpagenav.psd) -->
<table id="Table_01" width="517" height="642" border="0" cellpadding="0" cellspacing="0">
<tr>
<td colspan="2">
<img src="Assets/mainpagenav_01.png" width="517" height="525" alt=""></td>
</tr>
<tr>
<td>
<img src="Assets/mainpagenav_02.png" width="260" height="117" alt=""></td>
<td>
<img src="Assets/mainpagenav_03.png" width="257" height="117" alt=""></td>
</tr>
</table>
<!-- End Save for Web Slices -->
</body>
</html>

rattlsnak
12-27-2009, 03:13 AM
do you mean you want the pictures centered in your tables, or the whole table centered on the page?

right now, I see three pics in a two row table, aligned to the left of the page.

(which, you should know, you will get blasted for using tables for anything other than tabular data. You should be using CSS divs.)

But, if you want the table centered, use CSS to insert this:

body {
text-align:center;
}

You could also align the table itself to "center", but the just of it is to use CSS.

Justindukesdesign
12-27-2009, 03:55 AM
I know I should be using CSS but I'm just starting to learn literally like just got the lynda videos on CSS for designers for today. I'm def no designer but im learning. Thanks for the advice. I just needed this site done quickly so I went with what I knew I could do, which obviously didnt work. Any advice on how to use css to align these photos like this?

rattlsnak
12-27-2009, 06:56 AM
i understand where you're coming from with the learning, no worries, but again, are you trying to center your 'table' in the page? if you center the table, then everything in that table moves to the center of the page. in your case, the pictures will center in the page. you will still have one on top and two on the bottom though because you have them on two rows in your table. but, if this is the case, then same thing i said before: add this to your page:

body {
text-align:center;
}

or in your case from your example above:

<style type="text/css">
body {
text-align:center;
background-image: url(Assets/Blue%20Print%201-1.jpg);
}
</style>

if you dont want that background image in there, just delete that line..

is that what you're looking for?

Justindukesdesign
12-27-2009, 01:47 PM
I want to keep the BG image, and this is exactly what I was looking for, Thanks alot.

Justindukesdesign
12-27-2009, 01:51 PM
Ok I added the align text tag and it aligned where I wanted but when I look in Live view or preview it in my browser its still all the way left

rattlsnak
12-27-2009, 09:03 PM
post your code again, exactly as it appears, and what browser?