Tag Archives: Web

CSS position attribute

I didn't fully understand it from w3schools description, so here's a simpler (IMO) explanation after digging the issue a little bit:

  • static (the default!): The browser decides where to put the element, and it's not movable (i.e. one cannot change the position attributes (top, left, bottom, right) )
  • relative: Position attributes can be changed, relatively to the 'where-the-browser-decided' position (i.e. for having an element like the static above, but 5 pixels upper, one can put top: -5px)
  • absolute: One can specify a specific position inside the document, which should be measured from the beginning of the document. (i.e. top: 100px; left: 500px) will be on the x=500, y=100 location from the document's start point (top-left in most cases).
    I've noticed that IE6 sometimes measured the location relatively to the parent element in some cases, but it seems to be fixed in IE7.
  • fixed: Similar to absolute, only that the position is relative to the WINDOW and not the DOCUMENT, thus scrolling doesn't change the position. someone said it's like a watermark.

Ajax Parallelism

I've been asked to run few ajax requests in parallel.
Apparently the "A" in ajax stands for "Asynchronous", so each HTTP request made is non-blocking and unlimited HTTP requests should be made in parallel.

However, the browser limits the number of connections to a specific HTTP server. This is not a bad browser design: it's according to HTTP 1.1.

This can be tweaked (and thus breaking HTTP 1.1 compatibility):

FF: about:config -> network.http.max-persistent-connections-per-server

MSIE: HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Internet Settings\MaxConnectionsPerServer (create it even if it doesn't exist, DWORD value)

Refs: http://support.microsoft.com/kb/183110