Information
Whilst looking at A List Apart's Sliding Doors of CSS, Part II I had an idea how to remove all styling of background images from the list item and use just the link to hold BOTH background images, and all with no extra markup.
The idea was to use the :first-letter pseudo element to hold the left fixed image and the link itself to hold the right sliding image.
The :first-letter pseudo element can be styled with 'background', 'padding', 'margin' and 'border' and is supported by IE5, IE6, IE7, Opera, Firefox, Mozilla, Netscape etc. so in theory it can be used to hold and position the fixed background image.
But theory is far from fact and the only browsers to get the styling right are Opera, Netscape and Mozilla. So here it is for all you Opera, Netscape and Mozilla users, sliding doors with both the background images in the link and NO extra markup.
Perhaps Firefox can have a look at their implementation and copy the three working browsers with their next release. They almost make it, but fail to get the padding right. IE5, IE6 and even IE7 fail miserably with this and cannot handle the negative margin or the padding, IE even fails on the :hover for some unknown reason.
Oh well back to the drawing board.
Copyright
You may use this method on your personal 'non-profit' web site without seeking my permission. A link back to CSSplay is always appreciated.
Commercial usage is also permitted without seeking approval, but I would ask that a donation is considered to support my work on CSSPlay.
If you are having problems integrating any of my demonstrations into your website then I now offer a service to fault find and correct any errors that you may have introduced. Please email me for more information.
Recommended Sites
- VPS Hosting
Virtuozzo VPS Hosting - $19.95/mo - SEO
First Rate - Australian SEO Company - SEO Company
SEO company based in Manchester - Web design in Dorset
Bournmouth based web design agency - web hosting, dedicated servers
web reseller, managed servers
"The
web site uses
CSS Play code for the site drop down menus.
This code works seamlessly in IE 6 & 7, and is an excellent solution to the Creative requirements of the site."
Damon Clark - Brandwidth
CSS play pages



