...

View Full Version : spacer.gif vs  



CitznFish
02-05-2003, 11:27 PM
I have been pondering this for a while and I sdon't know the answer.


Whenever I try to code a page I avoid using any type of spacer.gif image or even <spacer type=block width="50bajillion">. What I do is use tables and set blank cells with an &ampnbsp; inside if I need to space objects. I am of the opinion that it's poor coding to use spacer.gifs and the <spacer> tag. Am I wrong, is there a real reason to use all those spacer.gifs? Is ther a benefit to use gifs instead of empty table cells? In my work environemnt everything is tabled that we publish live so maybe this has affected my thinking.... Anyone care to chime in with their own $.02? :thumbsup:

justame
02-06-2003, 12:10 AM
cit...
/me just a uses® the spacer.gif method 'cause thennn /me just a knows® it will/should look the sammme to everyone...

n' just a seems® to think that the & n b s p ; would be variable sized just a ccording® to the viewers font settings??? aka small medium n' large???

/me just a reminds® ya /me stilll isnt programmed to think...lol...


just a ps®...
'cept /me just a knows® thattt /me lovvves your website...hehehe...wherrre was it when /mes boys were small??? lol...

CitznFish
02-06-2003, 12:23 AM
It actually doesn't change the positioning at all depending on platform or font size. This is because I dictate the width of the cell and use &nbsp; only once so IE doesn't see it as an empty cell.


I have viewed the results on Mac's and PC's using IE 5 and NS 4.72 as well as mozilla.


If it is poor coding practice I'll switch to spacer.gif's, but I just hate to use them...

justame
02-06-2003, 01:09 AM
cit...
/me just a started® 'thinkin' just a bout® this sooo /me headed to good ol' google.com n' found these...

http://www.sun.com/smrc/web/specs/graphic.html
Using the dot.gif SPACER
Use the dot.gif SPACER to create precise spacing in your html page.
For more general spacing use & n b s p ; for horizontal spacing and <br> for vertical spacing.
Like any image, try to limit usage in order to conserve the number of server calls--not all browsers download only one instance of an image.

www.student.utc.sk/~matrix/abdesign2.shtml
just a brings® up the point of ...what just a if® the viewer has 'images' turned off???

webmarkart
02-06-2003, 02:55 AM
If a user has images turned off they should not expect to see things normally. A transparent 1x1 pixel gif doesnt take that long to load regardless of how much you need to stretch it to space things. I rarely use & nbsp; because I hate to see code that has twenty of them just to indent a few pixels. With a spacer image it is always easier to control vertical alignment compared to & nbsp; tags. As with anything like this it is a matter of personal preference but I'm stickin with the spacer.gif.

jkd
02-06-2003, 03:56 AM
Use CSS, and do it correctly. Forget about browser hacks, this is the 21st century.

brothercake
02-06-2003, 09:52 AM
I agree - spacer gifs and tables-based presentation are *both* bad practise; CSS is the way.

pardicity3
02-06-2003, 12:53 PM
I would have to agree with brothercake and jkd: Css is the way to go. Try messing around with margins, and padding. If you are worried about your layout getting messed up in old browsers, atleast know this: while it may not look the exact way you want it to, it will still be functional. And plus, how many people using NS4.7 and below do you think don't realize that their browser messes pages up?

CitznFish
02-06-2003, 06:31 PM
Originally posted by brothercake
I agree - spacer gifs and tables-based presentation are *both* bad practise; CSS is the way.

That may be the case, but our proprietary publishing system does not easily or smoothly allow for CSS based layouts. Given this, exact placement of items can be done in tables with just one &ampnbsp; in the cell....

<tr><td width="219">&ampnbsp;</td></tr>



Even our new publishing system that is being developed internally will not allow for CSS based layouts. Maybe I should talk to them about this and shake things up. Cool..more people to get pissed at me in the office. ;)

CitznFish
02-06-2003, 06:33 PM
Originally posted by pardicity3
I would have to agree with brothercake and jkd: Css is the way to go. Try messing around with margins, and padding. If you are worried about your layout getting messed up in old browsers, atleast know this: while it may not look the exact way you want it to, it will still be functional. And plus, how many people using NS4.7 and below do you think don't realize that their browser messes pages up?


Since we are a family site and we cater to midwest families as well, our minimum requirements for the site are pretty low. For this business reason CSS is not going to be allowed. Take a look at our minimum requirements:


PC Compatible
Processor: Pentium 166 MHz MMX MMX
Memory: 32 MB RAM
Video: 800x600x16M
Sound: 16Bit SB Compatible
Modem: 33.6KBps
OS: Windows 95
Netscape: V.408
Internet Explorer: V4.01
AOL: V4.0


Apple
Processor: Power PC 132 MHz
Memory: 32 MB RAM
Video: 800x600x16M
Sound: 16Bit SB Compatible
Modem: 33.6KBps
OS: V8.5
Netscape: V4.08
Internet Explorer: V4.01
AOL: V4.0


Plugins
Acrobat Reader V4.0
Shockwave V7.0-8.0
Flash V4.0-5.0
Real Player V7.0/G2
QuickTime V4.0


Pretty outdated I know, but we do get a fair amount of traffic from Netscape 4.* users.

brothercake
02-06-2003, 06:54 PM
With respect, if your major user base is people on low-spec machines, that's *more* of a reason to use CSS, not less.

Despite what is commonly thought, transparent spacer gifs do take up rendering resources (albeit not very much) - a layout which is heavily dependent on them (eg, dozens on each page) may be a problem for people with very low-spec video cards.

Netscape 4 users are not a problem if you plan it carefully - a well made [x]html document should be perfectly useable with no CSS at all; design youre fundamental layout without styling, then use the @import or @media method to block ns4 from reading any CSS at all, and go from there.

If you really insist on rick content for netscape 4, you can use a 'halfway house' technique such as http://www.evolt.org/article/Assigning_browser_specific_styles/17/14732/index.html


<aside>

Don't take my insistence as evidence of puritanicalism - justame has a very good point that, at least, spacer gifs give reliable results. But I had an XHTML epiphany quite recently, and despite what I was expecting, I've found that coding to strict XHTML/CSS without tables or spacers is actually *easier* than the traditional, hacky methods we're used to.

</aside>

Cybertooth Tiger
02-06-2003, 07:43 PM
back to the original question....

I use them for three key reasons...

1) I can postition a image in a cell (set to align="left") to a pixel perfect spot. By having a spacer gif first, then the image to it's right, I can "nudge" the main image pixel by pixel to the exact place I want it.

2) I can set and hold the exact height or width of any cell with a spacer gif

3) I attach a copy of the key words (from the meta tags to 1 x 1 Spacer gifs at the bottom of the page. Search engines read alt tags. this helps with searcgh engine optimisation.

having said that, I use & N B S P ; to ensure a cell has content, I really try to avoid the situation where I need to fill an otherwise empty cell by planing my layout carefully..

I am very interested in the overall outcome of this discussion.


Tonz

brothercake
02-06-2003, 08:49 PM
The overall outcome? - here's IMO:

The notion of pixel perfect accuracy in HTML has got to go; webpages are not online DTP, they are semantic logical entities, of which their visual output is merely one possible example. As little as possible of your design scheme should be hard-coded into your HTML - preferably none at all.

Remember, anyone can reformat any page they're viewing with their own style sheet, making it look and behave any way they want.

But ... well it's obvious what the anti-argument to that is - it's about style and design; you want your website to look and feel the way you want it; your client wants their webpage to look like the brochure; exactly like the brochure.

Well fine - that's what CSS is for

:thumbsup:

Tails
02-07-2003, 08:24 PM
Spacer tag? How long has that been around? Most of all the tags I know in HTML 4.0 I got from a adendum file in the Arachne 1.70 package (I got lost at w3.org again as usual). Is this a generic tag or is it actually standard?

winwintoo
02-10-2003, 09:16 PM
Are you saying that CSS works in v4 Browsers??

I made a page using divs and it didn't work in v4.

divs and CSS seem to always be talked about together - so it's confusing.


Thanks, Margaret

Tails
02-10-2003, 09:34 PM
Is this supposed to be a joke? There is no spacer tag.
<spacer type=block width="50bajillion">. (the first person posting talked about) is not real. It is not supported by any browsers, and the w3 is probably just as peeved as I am. Then my reply goes ignored. Lovely.

Roy Sinclair
02-10-2003, 09:41 PM
Originally posted by Tails
Is this supposed to be a joke? There is no spacer tag.
<spacer type=block width="50bajillion">. (the first person posting talked about) is not real. It is not supported by any browsers, and the w3 is probably just as peeved as I am. Then my reply goes ignored. Lovely.

Actually Netscape 4 supports a <spacer> tag, it was one of the proprietary enhancements to HTML which the W3C committee rejected instead of adding it to the standards. It should never be used in a new page and any existing page using it should have it removed the next time it's worked on.

Tails
02-10-2003, 09:44 PM
Well, I'm sure it wasn't the first Netscape thing rejected by the W3 either. I make my site compatible with IE 5.0 and have developed a bit of dislike against Netscape's incompatibilities. For a browser to have custom tags, that's something they should keep to themselves. Arachne 1.70 has a custom tag and they keep it to themselves without spreading it all over the net, it's mainly for offline purposes or it's NetDOS support. The lack of publicity is a good thing.

jkd
02-10-2003, 10:33 PM
Originally posted by Tails
I make my site compatible with IE 5.0 and have developed a bit of dislike against Netscape's incompatibilities.

Really? I find IE's incompatibilites more frustrating. Netscape 7 is perhaps the most standards-compliant, commercial (branded - really just based on Mozilla) browser you can find (taking into account, XML, CSS, DOM, etc). Opera 7 and Konqueror/Safari are up there too.

brothercake
02-10-2003, 10:53 PM
Originally posted by Tails
Arachne 1.70 has a custom tag and they keep it to themselves without spreading it all over the net, it's mainly for offline purposes or it's NetDOS support. The lack of publicity is a good thing.

Anyone can make their own tag - a browser vendor can arbitrarily support anything they want; publicity is not really an issue - proprietary tags only become widely used if the browser which implements them is also widely used - and there was a time when netscape 4 was, like, three quarters of all internet users.



Making a site which is dependent on CSS does rather mean that you can't expect it to look the same in 4 version browsers; the rub of that is expectations - the fact that x% of people still use 4-version browsers leads a lot of people to conclude that they should continue developing rich content for these browsers - ie, that the site should look as near as exactly the same.

I believe this is the wrong mindstate; what matters is usability. Using CSS allows you to design your site exactly how you want it to be (pixel perfect accurate - CSS can do all of that, no problem) but you also accept that it's not going to look exactly the same x-browser. It doesn't have to - it only has to be useable - ie, you can read the text, click the links, interact with forms; the core stuff. This is what XHTML does - get rid of presentational and physical HTML, and focus on semantics and logical structure.

So I'm almost echoing jkd - with a fundamental philosphy that says design to the standards, and test using a standards-compliant browser. I promise - this really is the best of both worlds; you end up with a site which is *significantly more* cross-browser functional than it would be if you'd relied on tables, spacers and other HTML hard-coded layout elements.

But I will throw a proviso in - while jkd's central point is correct, it belies most people's reality. Most people design, build and test in IE, then check in other browsers after the fact. If you've done of all of this in IE - got it looking how you want it in IE - it's easy to get from that the perception that what IE does is right - because what IE does is what you wanted.

... this belief is endemic ....

... but incorrect - IE's CSS2 implementation is so badly broken that it's a joke. The best way to appreciate this is to turn the tables - next time you design a page, do it entirely in a gecko browser (Phoenix is my favourite) - do it all, and only then test in IE.

Chances are, it won't look right - your perception then will be the opposite - that mozilla is right and IE is wrong.

I'm not gonna get into the debate about that - whether IE's pragmatic forgiveness is better or worse than Gecko bad-*** strictness - they're just different. Gecko complies with the proscribed standards - standards which are important because they give us a common framework for interoperability; IE complies with the de-facto standards of what people actually do, so that all the existing [badly or otherwise coded] sites on the internet continue to work. Both have their obvious benefits and drawbacks.

I think the easiest thing to do is keep testing in both as you go along.

Graeme Hackston
02-11-2003, 10:36 PM
Well put brothercake.

IMO it's measurably easier to code for Mozilla and Opera while checking IE periodically.

There is no gray area with these browsers. They won't try and guess what you're doing. In my experience it's too easy to head down a dead end trail using IE as a primary reference.

Catman
02-11-2003, 10:54 PM
I'll add a third to cheering brothercake's remarks, though I would have said functionality rather than usability.



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum