Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

IE's F12 Developer Tools - add new CSS?

Im viewing an element with IE's F12 developer tools. I can see the styles being applied to the element so I can change or disable them, but how can I add a completely new style?

Thanks

like image 225
Evanss Avatar asked Jul 04 '11 09:07

Evanss


People also ask

How do I use F12 developer tools?

To open F12 tools, press "F12" from the webpage you want to debug or inspect. To close F12 tools, press "F12" again. Lists command menus that can be accessed at any time regardless of the selected View.

How do I edit CSS in IE?

With the HTML tab selected choose the "Attributes" panel next to Style, Trace Styes and Layout. Click the "+" button and begin typing the css style you would like to add. The new style attribute is added automatically in the DOM view panel.

What are the properties of IE developer tools?

It was introduced as a toolbar for Internet Explorer 6 and 7. Internet Explorer 8 and later have developer tools built in. It allows validating of CSS and HTML, previewing page layout at various resolutions, and also offers a ruler (measuring in pixels) to aid in positioning the elements.


3 Answers

In IE9 you can select the CSS tab then right click to add a new style rule.

enter image description here

In IE11 you'll need to select the DOM Explorer tab, then the Styles tab on the right. Then you can right-click to add a new style rule.

enter image description here

like image 127
joshb Avatar answered Sep 29 '22 20:09

joshb


For IE8/IE9 you could add the style attribute to the element and add any CSS properties inline. Simply right click on the element and select Add Attribute. As commented, this only adds style to one element.

For IE10/11 see the other answer.

like image 22
andyb Avatar answered Sep 29 '22 19:09

andyb


If IE is not finding the element you hover with the cursor it may be because part of the HTML code is being loaded with Ajax or another similar technique after the page have already being generated. If that is the case, you will have to close the inspector, reload the page, make all the steps necessary to show the element in wich you are interested and only then open the inspector again. Now it should find your element when you hover it so you can inspect it for whatever you need.

like image 22
Ulysses Alves Avatar answered Sep 29 '22 18:09

Ulysses Alves