skip to content rich footer

stevenclark.com.au

subscibe to the StevenClark.com.au rss feed

Using the HTML Selector to Skin a Design Cat

The recent article on Web Designer Wall titled How to: CSS Large Background proposes a few ways to achieve large background designs for your website using Cascading Stylesheets (CSS). There is a paticularly good tip in Example 1 for single image backgrounds where the body selector is given values of width: 100%; and display: table; to prevent background shifting on browser resizes in Firefox.

In Example 3 Sky Background a second image is required in the design. The second image was originally achieved by using a #wrapper div, and I agree this is not an ideal situation because this extra div sitting in the Hypertext Markup Language (HTML) is a direct cost of the design strategy. If it could be avoided then that would be great. The div is a generic container and we should trim them out wherever we can’t justify their presence.

The updated solution for Example 3 Sky Background uses a HTML Selector in the CSS, rather than the #wrapper div in the HTML. If that makes sense. It’s a simple enough idea. One image is called into the html selector, and the other is called into the body selector – your CSS file now handles multiple backgrounds and you have leaner HTML markup. It’s important to think laterally when you’re working on design decisions, and the simple solutions work best. Lesson learned.

Comments are closed.

Social Networking

Keep an eye out for me on Twitter

About the Author

Steven Clark Steven Clark - the stand up guy on this site

My name is Steven Clark (aka nortypig) and my passions are business, web development, photography and writing. I have an MBA (Specialisation) and a Bachelor of Computing from the University of Tasmania. I am working as a business management consultant.

Photography

My photography is at Steven Clark Studio and my regular photo blog presents an ongoing stream of latest images at Walk a Mile in my Shoes and I'm working on a long-term photography project called the King Island Project.

Recently Reviewed Books

Site Supporters

Hosted by Brett Drinkwater at Tashosting who is always there at the other end of my every inconvenient question and technical crisis. Brett's local community support for us over the last five years is greatly appreciated.

skip to top of page

Currently Reading

Ansel Adams: The Camera

As the first of three parts of Ansel Adams Photography Series, Ansel Adams: The Camera begins by discussing the idea of visualisation in relation to photography. Ansel Adams is a master of his craft; this series has sat on my backburner for some time. Book 2 in this series is The Negative and it's followed up by The Print. In them Ansel outlines his philosophy of photography rather than trying to lay down a set of rules. This first instalment is a technical book that explains the good old fashion film camera.