The scope of this section is limited by the number of different browsers and versions of those browsers available for testing. My personal collection is limited. I test on Netscape versions 7+, Mozilla versions 1.7 +, MS IE versions 5.0+ IE 5.5, IE 6, Opera Version 7.21, and Konqueror 3.2.3. Time to acquire and test other browsers and versions isn't justified for my purposes. And, I don't have a Mac, but welcome feedback from anyone who has different browsers and comments from anyone else.

The following comments are intended only for the context of this how-to's topic. It assumes that there is a parent element that is positioned either relative or absolute; all of the examples were relative. And there is a child element that is being right justified within the parent with one of the three methods presented: floating, calculating a relative position, or using absolute positioning within the parent element.

  Konqueror and KHTML

The example pages had hiden code...well not actually hidden...code that was not commented on in the text. This code was needed to make the examples work in IE, Opera, or Konqueror. The code for IE was covered in some detail in Handling IE, and the comments are repeated along with additional notes below. There are also notes below covering my experiences with Opera, and this should be sufficient given Opera's limited use. The Konqueror code, which has not been discussed, needs more coverage as it represents a class of browsers.

Konqueror use the KHTML engine just as Mozilla, Netscape, and FireFox use the Gecko engine, and other browers have their rendering engines. I mention this because just as one can expect the browsers based on the Gecko engine to perform similarly that is reasonable to expect browsers based on the KHTML engine to perform similarly. This includes the popular Safari browser on Apple's Mac.

When floating an inline object like the images in Floating the Element Right, the image had to be raised a line for IE and Gecko browsers. This is not needed in Konqueror or Opera. They put the inline object on the line and not below it. The following code was used to adjust for this.

<script type="text/javascript">
    if (browser.isOpera || browser.isKHTML) {
        document.write(
            '<style type="text/css">.float-class {margin-top: 0;}<\/style>'
        );
    }
</script>

For details on the browser.isOpera || browser.isKHTML test, see the JavaScript How-to Browser Sniffing

That code simply overrides the top margin value used for other browsers.

Konqueror doesn't recognized the IE proprietary position-static or handle auto to properly position the absolute element vertically. Since this element is always on the last line (for headings it is also on the first line: the only line) it can be positioned from the bottom, which Konqueror handles correctly unlike IE. The following code sets the bottom value to 1px. Sometimes 2 or 3px was better. It depends on the positioned element's size and font size.

<script type="text/javascript">
    if (browser.isKHTML)
        document.write(
            '<style type="text/css">.right-elem{bottom: 1px;}<\/style>'
        );
</script">

  Issues with MS IE

There are several issues and work-a-rounds needed for IE.

  Opera 7.21

  Konqueror 3.2.3