Site icon David Lozzi

A Non-Developer’s intro to the Developer Toolbar: Element Inspection

Advertisements

If you’re a beginner in the world of customizing SharePoint, you should get to know the developer toolbar. Even if you’re only copying and pasting code from blog posts, knowing about, and using, the developer toolbar can save you a few cycles of banging your head on the keyboard.

The developer toolbar is key. Any SharePoint developer who is doing anything on the front end (JavaScript, jQuery, CSS, HTML, etc.) heavily relies on it. It does some really awesome stuff. I am going to run through some of the key things you can get out of the developer toolbar, like:

I decided to break this up into a few posts since there’s a lot of info to cover.

How do you get a Developer Toolbar?

Most if not all major browsers have a variation of one:

Internet Explorer calls it the F12 Developer Tools, and can be accessed by pressing the F12 button.

Chrome calls it Developer Tools, and can also be accessed by pressing the F12 button.

Safari calls it Web Inspector and you can get to it by pressing CTRL+ALT+i.

FireFox calls it FireBug, and is quite different than the rest, but the same functionality exists. You can get to it by pressing SHIFT+F2.

Once we have the developer toolbar running, we can explore the DOM. DOM stands for the Document Object Model, more at Wikipedia: http://en.wikipedia.org/wiki/Document_Object_Model. Basically, the DOM is your page, and all the elements you see: text, colors, shapes, images, etc.

Element Inspection

Each of the toolbars have an option to Inspect or Select an element:

Safari
Chrome
FireFox
Internet Explorer

With the selection tool enabled, you can then hover over elements in your page. You’ll quickly see a border wrapping the elements. Click on an item and the CSS attributes assigned to that element will appear in the toolbar.

Select an element and view its position in the DOM, and all CSS that affects it on the right.
Press Trace Styles (only in IE) to see a cleaner view of the CSS attributes.
Double click on a CSS value and see it change in the page! (See how the font size increased?)

Once you have played around with it, you can take what you know, and apply it to your custom CSS files, or in a web part. This part will require you to know CSS a little bit more, however if you mess with your CSS and decide you like a new look, you can send along your desired CSS  to your developers and surprise them.

A few notes:

Coming up next, Scripting!

Til then, Happy SharePointing!

Exit mobile version