The DOM Inspector

4 July 2003 · Last updated: 11 December 2006

Comments


Mozilla has something called the DOM Inspector which you can turn on via the Preferences. It shows up in the sidebar (press F9). I've used it before, only after upgrading to Mozilla 1.4 I'm pretty sure it's been beefed up. Now it ranks as an incredible tool for designers. You can now edit a live web page! And a lot more...

Once into the DOM Inspector ('DI') you can see it lists the HTML elements on any page you visit. Click on an element and it flashes a red border around it on your page. Clicking on the arrow next to any element's name expands it to show the nested elements used. The DI allows you to directly edit the attributes for these which effect the page on screen. So instead of working on a file, uploading it, then refreshing the page, you can change the page instantly. Choose different colours or fonts, even hide and show items!

In the DI there are two tabs - Document and Object. The Document tab window lists elements, id, class, along with others available from a menu button. Or it can list the stylesheets and number of CSS rules, or detail the properties and values of any Javascript. You can even enter new expressions based on the selected script.

Choosing the Object tab opens up a separate window with a world of possibilities. From there you can insert new attributes for the elements on the page! Wondering what your table would look like with a border? Insert the border attribute (via the left-click menu on a PC) and enter a value such as 1px.

The Object tab window also has a drop-down menu button offering the following:

Mozilla's Generic Stylesheets

Look In the directory "C:\Program Files\mozilla.org\Mozilla\res\". There is the generic stylesheet the DI refers to called html.css. Open it in Notepad and study the CSS built in to the browser. Too much padding on headers? Find out why. This file is ideal for editing (but make a backup first). You might create a disabled friendly browser with enlarged text and enhanced contrast. Or highlight key tags, make all tables have borders, or all links display their address afterwards.

There are also several other key stylesheets listed in the directory. One governs forms, while another deals with quirks found in old pages. Luckily many styles are commented so you can see why they are there. It's quite an education!

Coupled with the DI, these user-editable stylesheets make Mozilla a great tool for the website designer. Geeks have new toys to play with! So get playing and see what you can learn.


Follow comments on this article in a Webmaster World forum discussion. Or post your own here.


Comments (2)

Comments are locked on this topic. Thanks to everyone who posted a comment.

  1. Rob:
    This is all very nice, however, if you do a google for DOM, all you get are pages about where it is, how to inport one for MS/IE and how to use the tool set.

    What the blue blazes does DOM stand for? Is it an acronym? Is there some part of a webpage called a 'DOM'?

    It seems to have just dropped into the language after Mozilla used it for their inspector tool set, but, I for one, would like to know what the name/initials DOM stand for.

    BTW, it is very powerful, and I have used it to good effect, but that doesn't answer my question about what DOM stands for.

    Posted on 5 September 2004 at 2:54 am
  2. Chris Hester:
    DOM stands for "Document Object Model". If you hover over the acronym 'DOM' in the first line of the article I wrote you'll see the definition is there.

    Posted on 5 September 2004 at 8:18 pm

Useful Info

EMAIL: www.designdetector.com (replace the 1st dot with "@")

NEWSFEED: Subscribe to news of fresh posts and site updates. (RSS 2.0 compatible newsreader required.)

Disclaimer

Some links on this website lead to information provided by external services not under my control, therefore I am not responsible for the content or accuracy of the linked information.

All code examples are not guaranteed 100% free from bugs and/or mistakes. Use them at your own risk. I do not take any blame should a problem occur relating to use of code on this site given as an example for your own use. Such code has been tested and found to work for me, but I cannot vouch for other computer systems (existing now, or in the future) which it may be used on, or changes you introduce yourself based on my code.

This website is © 2008 Christopher Hester, except where separate authors are named. No part of this website may be reproduced or re-used in any way without my prior permission, except content added from separate authors (who retain the copyright on their material), examples of code, and any other content I explicity state is free to copy and make use of.

This page was last updated on 11 December 2006.

What's New

Recent Finds


View previous finds


Current Reading

The Suspicions Of Mr Whicher (Or The Murder At Road Hill House) by Kate Summerscale
5%
Genesis: Chapter & Verse by Tony Banks, Phil Collins, Peter Gabriel, Steve Hackett & Mike Rutherford
70%
Digital Photographer's Handbook by Tom Ang
70%