Forum Moderators: open

Message Too Old, No Replies

layout of the html tags

         

Cosmin

4:26 pm on Oct 27, 2003 (gmt 0)

10+ Year Member



When I look at the html code, all tags are placed in a certain way (like a wave) from the left margin of the page.

After I make a modification sometimes the "layout" of the tags changes. It's not that wave anymore and some tags are completely to the left. I also see sites where the html tags are in a mess but the page looks fine.

Does the left space (from the margin of the page to the tag) really matter, is there a rule?

benihana

5:00 pm on Oct 27, 2003 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



if the tags are spaced evenly its easier to read, and therefore easier to update. removing a lot of the whiutespace as this site does will save bandwidth.
generally it doesnt make any difference to how pages are displayed

lorax

5:04 pm on Oct 27, 2003 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



The only 'rule' I go by is that opening and closing tags for an element should be at the same indent position. But it's certainly not a requirement and everyone has their own particular style.

<table>
<tr>
</tr>
</table>

Cosmin

5:42 pm on Oct 27, 2003 (gmt 0)

10+ Year Member



Do you know if the Absolute HTML Compressor software it's good?

After applying it all html code is in one line or two. (even the meta tags and anyything else)

It reduces the file size considerably dough. The original file is 38 Kb reduced to 23 Kb

lorax

6:12 pm on Oct 27, 2003 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



HTML compressors are fine for the final release of the file - ie after you're done editing. They can reduce file size but they also make editing a nightmare.

g1smd

12:22 am on Oct 29, 2003 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



If you compress the code, removing whitespace, then you save server bandwidth, and speed page loading for your users. Just remember to keep the uncompressed versions for when you next edit the code again.

fyodor

8:21 pm on Oct 30, 2003 (gmt 0)

10+ Year Member



In Internet Explorer, a simple carriage return has given me headaches more than once.

For exampple:

<DIV style="background-color: blue;">
<IMG src="100pxhighimage.gif">
</DIV>

will give a DIV that is 102 pixels high. For some ridiculous reason (using latest IE6, WinXP). However, remove the carriage return between the image tag and the ending div...

<DIV style="background-color: blue;">
<IMG src="100pxhighimage.gif"></DIV>

and all is well.

Anyone know why this is the case? I've been unable to find any CSS (or "old style") stuff to reverse the extra couple of pixels. The extra pixels are in addition to whatever border you might have on your IMG, btw.

Of course, it looks perfect in any other browser.

-fyodor