OT - You've gotta love vb6 (HTML subthread)

Tech-Archive recommends: Repair Windows Errors & Optimize Windows Performance



The Question:
If you wanted to center a block element inside another block
element, let's say an image inside a <div>, how would you do
it without using the CSS text-align?

The Answer:
Set the left and right margins to auto, and give the block item
you want to center a specific height and width. I inserted the
text-align:center; to get IE to center it properly. That should
not have been in there. The proper code is below.

What's the matter with the IMG ALIGN attribute?
Or a wrapping table? Or a wrapping DIV? They
both have ALIGN attributes. I guess we're approaching
it differently. I generally write a page with no margins
or padding anywhere (which I think should be the default),
arrange things where I want them, and then adjust the
code where it doesn't work in IE or Mozilla.

It's amazing how many ways there often are to do the
same thing. But this gets back to why I don't use DOCTYPE.
The common browsers do a remarkable job at piecing
together a page, but I think it's safe to say that "webpage
rendering is not, by any means, an exact science". To
use DOCTYPE implies that it is.

We've wandered way off from VB here, though.

: I've also noticed in my server logs that IE6 on XP (especially
: with InfoPath, for some reason) has a nasty habit of requesting
: images, in general, over and over again.

What is InfoPath?

I don't know. I get the impression that it's one of the 15
things that MS tries to sell to anyone who's sucker enough
to buy Office. Whatever it is, they add the name to the
userAgent string. (Microsoft is putting an increasing amount
of unrelated crap in the UA string, including *all* installed
versions of the .Net runtime, whether XP has SP2, etc.)

: It's common to see cases where IE6 has requested an image
: dozens of times within a few seconds. It gets a 304 back but
: just keeps requesting over and over.

I used to think that was someone that turned caching off in
their browser. But I noticed that if I turn caching off and
then try to use Google, Google stops working and presents
a message other than the standard Google webpage.


Turning cache off should only mean that the image
loads again fresh each time. The 304 response is telling
the browser that it already has the image. The server's
not deciding that. It gets it from the browser's inbound
header.

Again, my apologies about posting the wrong HTML.
It now works as I intended.

I think I'm going to take your word on that. I'd have
to boot up a Windows Xtra Problems test system to
try it out. (I'm on Win98SE with IE 5.00.)


.



Relevant Pages

  • Mustard Yellow Mustard and Grapes With Crackers
    ... whose agents know how to distract the public from their lack of ... Report spam ... Google Alerts ...
    (sci.math)
  • Re: innerHTML performance in multimonitor system
    ... The content of the first of these div is ... Also if you literally want to write "Hello" why use innerHTML? ... That could be significant if the browser has to recalculate the position of page elements every second. ... recurrent innerHTML on my simple html page. ...
    (comp.lang.javascript)
  • Re: iWeb3
    ... The expression "the CSS doesn't scale" is not the clearest of ... of the browser window in this example. ... If a DIV is 'floated', and the author does not specify a width, the ...
    (comp.sys.mac.apps)
  • Pure space directly inside div ignored, but pure space directly inside span honored
    ... block element or directly inside an inline element. ... any pure space directly inside a block element is ...
    (alt.html)
  • innerHTML performance in multimonitor system
    ... On each of this monitor I have a IE browser showing the ... This HTML is very simple containing a 2 (640x480 for one and the ... The content of the first of these div is ... recurrent innerHTML on my simple html page. ...
    (comp.lang.javascript)