The issue that we run across when trying to apply the One True Layout concept in design is that the browser compatibility isn’t quite at the same level of development. When I say browser compatibility I usually mean Internet Explorer. With Microsoft now into its 8th iteration of Internet Explorer, the compatibility is almost completely there. However with the majority of people making their way around the web, Internet Explorer 7 is still their primary browser, and it still has its quirks.
The One True Layout, which is one of the primary tenets of web development to completely separate content from design, looks at rendering the content before any other element in the code. The Internet, being a content driven media, is concerned with supplying content to the user first. To that end the content in the code should be rendered first. This enhances a site’s Search Engine placement and accessibility by rendering relevant information first rather than the other elements of the site.
So the rendering of the code to do the One True Layout would be roughly like this.
- Content renders first
- Header display renders
- Navigation renders
- Footer renders
Normally when building web pages we render elements in the order we want to see them appear in the browser. By using CSS and taking advantage of modern browsers we can shift the elements to where we need them to display while behind the scenes the order can be focused on providing the content first. This works perfectly with compliant browsers like Firefox, Safari and Internet Explorer 8. The difficulty comes when we try to use Internet Explorer 7. One of the quirks of IE and rendering absolutely positioned block items is they seem to disappear. For instance the header renders after the content in the code, but the header needs to appear first. In IE 7 the header disappears using the standards compliant css.
To fix this, with some experimentation, I set the header style to display inline. This caused the header to reappear. Then by setting the absolute positioning of the header to top: 0; positioned the header at the top. Setting the left positioning to 0 brought the header to the correct spot aligning the header with the content area.
These adjustments work for a fixed width layout. I still have to do some experimentation with a flexible width layout, but generally the One True Layout works very well and allows for greater flexibility to site design while maintaining the focus on content.
These adjustments unfortunately do not cover IE 6, however as IE 6 is now a ten year old browser, the stylesheets that we are starting to provide for this browser are reflecting its obsolescence.