Forum Moderators: open
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:
There's also a "Pick Color" button but this doesn't seem to do anything yet?
Caution: extreme care should be taken in editing it. If you mess up like I just have, every web page you visit can be altered! Yet it's a great way to learn how CSS has been used by Mozilla to govern HTML.
From the DI you can see the HEAD tag always has {display:none;} set. Try changing it to {display:block;} and see what happens!
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.
>>You can now edit a live web page!
Damn! Now I gotta go explore that, maybe I can put temptation off till tonight, I dunno though, sounds pretty cool. I know drbrain has been raving about the DOM Inspector for a little while now....
Thanks for posting such a neat summary of the features, you make it a must! ;)
Nick