Have you ever wanted to temporarily edit a webpage to see how it would look with specific styling?
It’s possible to edit text, colors, and more with a tool already in your browser called Inspect or Inspect Element. This is a dream come true for all DIY users when they find out about it.
In this article, we will show you the basics of Inspect Element and how to use it with your WordPress site.
What is Inspect Element or Developer Tools?
Modern web browsers like Google Chrome and Mozilla Firefox have built-in tools that allow web developers to debug errors.
For a DIY website owner, these tools can help you preview how a site design would look without making the changes for everyone.
For writers, these tools are fantastic because you can easily change personal identifying information when taking your screenshots, eliminating the need to blur out items altogether.
For support agents, it’s a great way to identify the error that could be causing your galleries to not load or your sliders to not work correctly.
We’re just scratching the surface of use cases. The inspect element is really powerful.
In this article, we will be focusing on Inspect Element in Google Chrome because that’s our browser of choice. Firefox has its own developer tools, which can also be invoked by selecting inspect element from the browser menu.
Ready? Let’s get started.
If you don’t like the video or need more instructions, then continue reading.
Launching Inspect Element and Locating The Code
You can launch the inspect element tool by pressing CTRL + Shift + I keys on your keyboard. Alternatively, you can click anywhere on a web page and select inspect element from the browser menu.
Your browser window will split into two, and the lower window will show the web page’s source code.
The developer tool window is further divided into two windows. On your left, you will see the HTML code for the page. On the right-hand pane, you will see the CSS rules.
As you move your mouse over the HTML source, you will see the affected area highlighted on the web page.
You will also notice CSS rules change to show the CSS for the element you are viewing.
You can also take the mouse pointer to an element on the web page, right-click, and select inspect element. The element you pointed at will be highlighted in the source code.
Editing and Debugging Code in Inspect Element
Both the HTML and CSS in the inspect element window are editable. You can double-click anywhere in the HTML source code and edit the code as you like.
You can also double-click and edit any attributes and styles in the CSS pane.
To add a custom style rule, click on the + icon at the top of the CSS pane.
As you make changes to the CSS or HTML those changes will be reflected in the browser instantly.
These changes will be saved in your browser’s temporary memory and won’t affect your website.
Note, that any changes you make here are not saved anywhere. Inspect element is a debugging tool, and it does not write your changes back to the files on your server. This means that if you refresh the page, all your changes will be gone.
To actually make the changes, you will have to edit your WordPress theme’s stylesheet or relevant template to add the changes you want to save.
Before you start editing your existing WordPress theme using the Inspect Element tool, make sure that you save all your changes by creating a child theme.
Easily Find Errors On Your Site
The inspect element has an area called Console, which shows all the errors that exist on your website. When trying to debug an error or requesting support from plugin authors, it’s always helpful to look here to see what the errors are.
For example, if you were an OptinMonster customer wondering why your optin is not loading, then you can easily find the problem “Your page slug does not match.”
Tools like the Inspect Element Console and SupportAlly help you get better customer support because the technical support team loves customers who take the initiative in providing detailed feedback on the issue.
We hope this article helped you learn the basics of the Inspect Element and how to use it with your WordPress site. You may also want to take a look at the default WordPress generated CSS cheat sheet to speed up your theme development skills.