PDA

View Full Version : help with centering


boomshot
09-11-2009, 11:14 PM
I have a page I am doing that is basically one image, sliced in Photoshop.
I can get it into Dreamweaver ok, but for the life of me I dont know why it wont ceter in any of the CSS templates.
I take the CSS and paste it into a template as well as the html, but it seems #Table_01 always brings the image to the left, I want it centered.

Thanks in advance!

Here is the code from Photoshop:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>Last_Scenedraft4</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<!-- Save for Web Styles (Last_Scenedraft4.psd) -->
<style type="text/css">
<!--

#Table_01 {
position:absolute;
left:0px;
top:0px;
width:775px;
height:775px;
}

#ls-top_ {
position:absolute;
left:0px;
top:0px;
width:774px;
height:83px;
}

#Last-Scenedraft4-02_ {
position:absolute;
left:774px;
top:0px;
width:1px;
height:574px;
}

#ls-logo_ {
position:absolute;
left:0px;
top:83px;
width:290px;
height:104px;
}

#ls-face_ {
position:absolute;
left:290px;
top:83px;
width:230px;
height:219px;
}

#ls-quotes_ {
position:absolute;
left:520px;
top:83px;
width:254px;
height:219px;
}

#ls-midleft_ {
position:absolute;
left:0px;
top:187px;
width:290px;
height:115px;
}

#ls-bottomleft_ {
position:absolute;
left:0px;
top:302px;
width:290px;
height:272px;
}

#ls-bottomcenter_ {
position:absolute;
left:290px;
top:302px;
width:325px;
height:272px;
}

#ls-bottomright_ {
position:absolute;
left:615px;
top:302px;
width:159px;
height:272px;
}

#ls-evalink_ {
position:absolute;
left:0px;
top:574px;
width:277px;
height:40px;
}

#ls-findout_ {
position:absolute;
left:277px;
top:574px;
width:254px;
height:40px;
}

#ls-holidaylink_ {
position:absolute;
left:531px;
top:574px;
width:244px;
height:40px;
}

#ls-bottomblackleft_ {
position:absolute;
left:0px;
top:614px;
width:277px;
height:161px;
}

#ls-bottomblackmid_ {
position:absolute;
left:277px;
top:614px;
width:254px;
height:161px;
}

#ls-bottomblackright_ {
position:absolute;
left:531px;
top:614px;
width:243px;
height:161px;
}

#ls-holidaylink016_ {
position:absolute;
left:774px;
top:614px;
width:1px;
height:135px;
}

#Last-Scenedraft4-17_ {
position:absolute;
left:774px;
top:749px;
width:1px;
height:26px;
}

-->
</style>
<!-- End Save for Web Styles -->
</head>
<body style="background-color:#FFFFFF;">
<!-- Save for Web Slices (Last_Scenedraft4.psd) -->
<div id="Table_01">
<div id="ls-top_">
<img id="ls_top" src="images/ls_top.jpg" width="774" height="83" alt="" />
</div>
<div id="Last-Scenedraft4-02_">
<img id="Last_Scenedraft4_02" src="images/Last_Scenedraft4_02.jpg" width="1" height="574" alt="" />
</div>
<div id="ls-logo_">
<a href="http://lastseen.com">
<img id="ls_logo" src="images/ls_logo.jpg" width="290" height="104" border="0" alt="Last Seen a film by Eva Ilona Brzeski and Holiday Reinhorn" /></a>
</div>
<div id="ls-face_">
<img id="ls_face" src="images/ls_face.jpg" width="230" height="219" alt="" />
</div>
<div id="ls-quotes_">
<img id="ls_quotes" src="images/ls_quotes.jpg" width="254" height="219" alt="Ossesive, haunted, beautiful, a must see from Mill Valley Film Festival and Sumptuous, intriguing work from Filmmaker magazine" />
</div>
<div id="ls-midleft_">
<img id="ls_midleft" src="images/ls_midleft.jpg" width="290" height="115" alt="" />
</div>
<div id="ls-bottomleft_">
<img id="ls_bottomleft" src="images/ls_bottomleft.jpg" width="290" height="272" alt="" />
</div>
<div id="ls-bottomcenter_">
<img id="ls_bottomcenter" src="images/ls_bottomcenter.jpg" width="325" height="272" alt="" />
</div>
<div id="ls-bottomright_">
<img id="ls_bottomright" src="images/ls_bottomright.jpg" width="159" height="272" alt="" />
</div>
<div id="ls-evalink_">
<a href="http://evailonabrzeski.com" target="_blank"
onmouseover="window.status='eva ilona brzeski dot com'; return true;"
onmouseout="window.status=''; return true;">
<img id="ls_evalink" src="images/ls_evalink.jpg" width="277" height="40" border="0" alt="http://evailonabrzeski.com" /></a>
</div>
<div id="ls-findout_">
<a href="#"
onmouseover="window.status='find out more'; return true;"
onmouseout="window.status=''; return true;">
<img id="ls_findout" src="images/ls_findout.jpg" width="254" height="40" border="0" alt="" /></a>
</div>
<div id="ls-holidaylink_">
<a href="http://holidayreinhorn.com" target="_blank"
onmouseover="window.status='holiday reinhold dot com'; return true;"
onmouseout="window.status=''; return true;">
<img id="ls_holidaylink" src="images/ls_holidaylink.jpg" width="244" height="40" border="0" alt="http://holidayreinhorn.com" /></a>
</div>
<div id="ls-bottomblackleft_">
<img id="ls_bottomblackleft" src="images/ls_bottomblackleft.jpg" width="277" height="161" alt="" />
</div>
<div id="ls-bottomblackmid_">
<img id="ls_bottomblackmid" src="images/ls_bottomblackmid.jpg" width="254" height="161" alt="" />
</div>
<div id="ls-bottomblackright_">
<img id="ls_bottomblackright" src="images/ls_bottomblackright.jpg" width="243" height="161" alt="" />
</div>
<div id="ls-holidaylink016_">
<a href="http://holidayreinhorn.com" target="_blank"
onmouseover="window.status='holiday reinhold dot com'; return true;"
onmouseout="window.status=''; return true;">
<img id="ls_holidaylink016" src="images/ls_holidaylink-16.jpg" width="1" height="135" border="0" alt="http://holidayreinhorn.com" /></a>
</div>
<div id="Last-Scenedraft4-17_">
<img id="Last_Scenedraft4_17" src="images/Last_Scenedraft4_17.jpg" width="1" height="26" alt="" />
</div>
</div>
<!-- End Save for Web Slices -->
</body>
</html>

DWcourse
09-11-2009, 11:43 PM
The problem is that saving from Photoshop isn't a good way to do it. The absolute positioning causes problems. But this might help: http://dwcourse.com/dreamweaver/centering-page-layout.php

boomshot
09-11-2009, 11:58 PM
thank you, but it only moved one slice, even with all of them selected
thoughts?

DWcourse
09-12-2009, 03:09 AM
did you manage to get teh wrapper div placed around ALL the images?

boomshot
09-12-2009, 04:23 AM
no I have not.....there are about 14 slices of the image and just the bottom right corner slice seemed to move, and ideas why the rest didnt follow?

@charset "UTF-8";
body {
font: 100% Verdana, Arial, Helvetica, sans-serif;
background: #000000;
margin: 0; /* it's good practice to zero the margin and padding of the body element to account for differing browser defaults */
padding: 0;
text-align: center; /* this centers the container in IE 5* browsers. The text is then set to the left aligned default in the #container selector */
color: #000000;
}
.oneColElsCtr #container {
width: 46em;
background: #FFFFFF;
margin: 0 auto; /* the auto margins (in conjunction with a width) center the page */
border: 1px solid #000000;
text-align: left; /* this overrides the text-align: center on the body element. */
}
.oneColElsCtr #mainContent {
padding: 0 20px; /* remember that padding is the space inside the div box and margin is the space outside the div box */
}
<style type="text/css">

#Table_01 {
position:absolute;
left:0px;
top:0px;
width:775px;
height:775px;
}

#ls-top_ {
position:absolute;
left:0px;
top:0px;
width:774px;
height:83px;
}

#Last-Scenedraft4-02_ {
position:absolute;
left:774px;
top:0px;
width:1px;
height:574px;
}

#ls-logo_ {
position:absolute;
left:0px;
top:83px;
width:290px;
height:104px;
}

#ls-face_ {
position:absolute;
left:290px;
top:83px;
width:230px;
height:219px;
}

#ls-quotes_ {
position:absolute;
left:520px;
top:83px;
width:254px;
height:219px;
}

#ls-midleft_ {
position:absolute;
left:0px;
top:187px;
width:290px;
height:115px;
}

#ls-bottomleft_ {
position:absolute;
left:0px;
top:302px;
width:290px;
height:272px;
}

#ls-bottomcenter_ {
position:absolute;
left:290px;
top:302px;
width:325px;
height:272px;
}

#ls-bottomright_ {
position:absolute;
left:615px;
top:302px;
width:159px;
height:272px;
}

#ls-evalink_ {
position:absolute;
left:0px;
top:574px;
width:277px;
height:40px;
}

#ls-findout_ {
position:absolute;
left:277px;
top:574px;
width:254px;
height:40px;
}

#ls-holidaylink_ {
position:absolute;
left:531px;
top:574px;
width:244px;
height:40px;
}

#ls-bottomblackleft_ {
position:absolute;
left:0px;
top:614px;
width:277px;
height:161px;
}

#ls-bottomblackmid_ {
position:absolute;
left:277px;
top:614px;
width:254px;
height:161px;
}

#ls-bottomblackright_ {
position:absolute;
left:531px;
top:614px;
width:243px;
height:161px;
}

#ls-holidaylink016_ {
position:absolute;
left:774px;
top:614px;
width:1px;
height:135px;
}

#Last-Scenedraft4-17_ {
position:absolute;
left:774px;
top:749px;
width:1px;
height:26px;
}

#wrapper {
text-align: left;
width: 775px;
margin-right: auto;
margin-left: auto;
position: relative;
}

</style>

boomshot
09-12-2009, 04:33 AM
ahhh I got it, I had to move the div for the wrapper up at the beggining, but now I have this weird white square showing up on the top left corner

boomshot
09-12-2009, 04:40 AM
ok, blasted out the container and the white square issue is dealt with, now I just have some image details

thanks so much!

Corrosive
09-12-2009, 06:52 AM
If you display code in the forum, please wrap in code tags. It makes it easier to read. Thanks

boomshot
09-12-2009, 07:03 AM
if you don't mind, I am not sure why this vertical hairline shows up on the outside of either image (or div), see bottom left please.
The image I know is all black aside from the text, why would this line be showing up?

http://quinnmedia.net/testeva/lastseen/index.html

cheers!

ps sorry for not wrapping in code tags, I will look into that

Corrosive
09-12-2009, 07:10 AM
What browser are you checking in? Looks fine in Chrome. No problem about the tags. You'll know for next time :)

Corrosive
09-12-2009, 07:15 AM
I've looked again and am struggling to understand why this image is broken into many pieces. If that is the make-up of your page then why not just one image in a div?

boomshot
09-12-2009, 02:03 PM
Firefox 3.5.3 Mac, weird....hmmm

boomshot
09-12-2009, 02:07 PM
lol....I guess that's a good question. I thought it would be best to optimize. Do you think not? Basically it was my first attempt in doing a page in Photoshop. Also, the initial concept for the page was to have hotspots in the image, which at this point there would only be two. The "logo" area (name of the film) and her face which would be to trigger a lightbox.

DWcourse
09-12-2009, 02:08 PM
Looks ok to me as well on Safari and Firefox mac. Could be one of those issues from using a photoshop export. But why did you need to slice that image anyway? I don't see that it actually accomplishes anything.

boomshot
09-12-2009, 02:14 PM
yeah, I see both your points. I guess my take was, since I was doing it in Pshop, the image is fairly big, and again, it was supposed to have my hot spots - which in fact it may still later on. Do you think I should do the hotspots in FW instead? - buut regardless, I am not sure why those little vertical lines show up at the bottom in the black area.

DWcourse
09-12-2009, 08:02 PM
You can add hot spots (image maps) without slicing the image and it can be done in Dreamweaver?

boomshot
09-18-2009, 01:28 PM
another (probably very basic) question.
I am trying to get the bottom two items to appear side by side directly under the image. They both have their own div. (as that right?)
what am I doing wrong that they don't line up side by side?

I want the contact form on the right.
http://quinnmedia.net/testeva/lastseen/

@charset "UTF-8";
body {
font: 100% Verdana, Arial, Helvetica, sans-serif;
background: #000000;
margin: 0; /* it's good practice to zero the margin and padding of the body element to account for differing browser defaults */
padding: 0;
text-align: center; /* this centers the container in IE 5* browsers. The text is then set to the left aligned default in the #container selector */
color: #000000;
}

/* Tips for Elastic layouts
1. Since the elastic layouts overall sizing is based on the user's default fonts size, they are more unpredictable. Used correctly, they are also more accessible for those that need larger fonts size since the line length remains proportionate.
2. Sizing of divs in this layout are based on the 100% font size in the body element. If you decrease the text size overall by using a font-size: 80% on the body element or the #container, remember that the entire layout will downsize proportionately. You may want to increase the widths of the various divs to compensate for this.
3. If font sizing is changed in differing amounts on each div instead of on the overall design (ie: #sidebar1 is given a 70% font size and #mainContent is given an 85% font size), this will proportionately change each of the divs overall size. You may want to adjust based on your final font sizing.
*/
.oneColElsCtrHdr #container {
width: 773px; /* this width will create a container that will fit in an 800px browser window if text is left at browser default font sizes */
background: #000000;
margin: 0 auto; /* the auto margins (in conjunction with a width) center the page */
border: 1px solid #000000;
text-align: left; /* this overrides the text-align: center on the body element. */
}
.oneColElsCtrHdr #header {
background: #000000;
/* this padding matches the left alignment of the elements in the divs that appear beneath it. If an image is used in the #header instead of text, you may want to remove the padding. */
}
.oneColElsCtrHdr #header h1 {
margin: 0; /* zeroing the margin of the last element in the #header div will avoid margin collapse - an unexplainable space between divs. If the div has a border around it, this is not necessary as that also avoids the margin collapse */
padding: 5px 0; /* using padding instead of margin will allow you to keep the element away from the edges of the div */
}
.oneColElsCtrHdr #mainContent {
padding: 0 0px; /* remember that padding is the space inside the div box and margin is the space outside the div box */
background: #000000;
text-align: center;
padding-left: 0px;
}
.oneColElsCtrHdr #footer {
padding: 0 10px; /* this padding matches the left alignment of the elements in the divs that appear above it. */
background:#000000;
}
.oneColElsCtrHdr #footer p {
margin: 0; /* zeroing the margins of the first element in the footer will avoid the possibility of margin collapse - a space between divs */
padding: 10px 0; /* padding on this element will create space, just as the the margin would have, without the margin collapse issue */
}#footer {
color: #CCC;
}
#form {
text-align: justify;
padding-left: 600px;
}
.oneColElsCtrHdr #container #footer p #footer {
font-size: xx-small;
}
#contact {
text-align: left;
position: relative;
}
a {
font-family: Verdana, Geneva, sans-serif;
color: #CCC;
}