Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

!!!!HELP!!! PS 6 Is Bloating My Graphics!

Status
Not open for further replies.

Kampher

Technical User
Apr 21, 2001
5
0
0
US
I am using Photoshop 6 to build my web page dummies, then I cut them up and import them to Dreamweaver. When I do this, no matter how meticulous I've been about cell and table size, the cells are usually aligned crookedly, the table usually ends up about 6 or seven pixles larger than I planned and the spacing looks like HELL in Netscape (no problem in IE).

I have been using Dreamweaver for months and this problem has continued to perplex me. I noticed the problem got worst depending on how many slices were in my web pages. Then this morning I decided to zoom in on my guides in Photoshop as I selected my slices. What did I find? The damned selection tool is inacurate by about 1 pixel!!!![mad] Is there any way for me to fix this problem? Have any of you also noiced this before? HELP, I'm on deadline!!!!!!
 
If this problem only occurs in Netscape but not in IE using the same image files, then I suspect that the problem is browser interpretation of the html code.

Make sure that cellspacing and cellpadding is set to 0, if not specified, then specify them and set it to 0.

 
If you have line-breaks between your tags, e.g. (underscore signifies a line-break)

<td>_
<img src=&quot;foo.gif&quot; cellpadding=0 cellspacing=0>_
</td>

you'll get unwanted spaces in your browser display. If you must have line breaks, put them before the close bracket e.g.

<td_
><img src=&quot;foo.gif&quot;_
></td>

Raw HTML baby! BTW, the slice tool snaps to pixel boundaries so you shouldn't have a problem there.
 
Hi,

greensweater,

You will also get line breaks sometimes with the code you've posted.

Always put the closing </TD>'s directly after the last portion of cell data on the same line.


<td>_
<img src=&quot;foo.gif&quot;>_</td>

And why do you have cellpadding and cellspacing within the image tag, that belongs in the table tag.

Hope this helps!
relax.gif

 
Oops, that's what you get when you don't check your code. I meant:

<html
><body
><table border=0 cellpadding=0 cellspacing=0
><tr
><td
><img src=&quot;foo.gif&quot; border=0 width=100 height=100
></td
></tr
></table
></body
></html>

Replace width and height with appropriate values.

In this way there are no stray linebreaks floating around. Kinda funny looking but it's the only way to be sure.
 
greensweater

[hammer] Why why why would you ever want to code like that? Coding of that type is never necessary.

What is the difference in output from your code to the sample below?

Code:
<html>
<body>
<table border=0 cellpadding=0 cellspacing=0>
<tr>
<td><img src=&quot;foo.gif&quot; border=0 width=100 height=100></td>
</tr>
</table>
</body>
</html>

All you need to do is keep the cells tags without any breaks between them, adding the closing bracket to the next line is never required and makes your code a mess.

Hope this helps Wullie


The pessimist complains about the wind. The optimist expects it to change.
The leader adjusts the sails. - John Maxwell
 
Do what you want; I'm just saying in my code all of the line breaks are inside brackets so none get rendered in the browser. When you're under deadline it's easier than hunting down a bunch of stray invisible characters.
 
Hi mate,

First things first, making your code harder to read wastes money, it does not save any. The next person to work on that code will take longer to make changes than if the code was laid out decently.

As for deadlines, this would not speed up the creation of a site in any way. In the following 2 examples, you will see that none of them would break onto a new line.

Your Example:

<html
><body
><table border=0 cellpadding=0 cellspacing=0
><tr
><td
><img src=&quot;foo.gif&quot; border=0 width=100 height=100
></td
></tr
></table
></body
></html>

My Example:

<html>
<body>
<table border=0 cellpadding=0 cellspacing=0>
<tr>
<td><img src=&quot;foo.gif&quot; border=0 width=100 height=100></td>
</tr>
</table>
</body>
</html>

As I have already explained, as long as you close the cell with a </td> tag on the same line as the end of the cell content, you will not have any side-effects from line breaks.

Your code above prevents any line breaks throughout the whole document, when you go back to make a change to the 1000 line page that you have just written, I wish you well in your search for a particular section of that code. If it is someone else who has to edit it, then I pray for them and the situation that they would be in.

You are under the impression that line breaks anywhere in your code result in formatting problems, this could not be further from the truth. As I have already stated above, only the cells need to be closed without any line breaks, not the html, body, table and tr tags.

As for taking ages to hunt down invisible characters, I suggest they you purchase a decent text editor that can be configured to display tabs, spaces and line breaks. Editors of this type are not expensive and are very easy to find. Editplus is one example of such an editor.
Hope this helps Wullie


The pessimist complains about the wind. The optimist expects it to change.
The leader adjusts the sails. - John Maxwell
 
First thanks to everyone for their imput. Its much appreciated. (by the way, just to clarify, the code posted above wasn't mine, but posted by someone else as an example.)

So I found the easy answer to my problem right under my nose...IMAGEREADY (DOH!!!)

I've had PS 6 for abot 7 months but I only glanced at IR once, decided I wasn't too impressed, and went back to to PS. Today I popped it back open to fool around and low and behold??? I found I could import my PS file into IR, convert my guides into perfect, clean slices, and my webpages match the dummy perfectly!

...yesssssssss...today is a good day ;-)

thanks again

-K

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top