Prevent inspect element from targeting element? - html

Is there a way to force inspect element via Chrome to ignore a certain element?
I've often had a need to put an overlay over the entire site (say for development purposes) and the only problem is my development workflow suffering due to "inspect element" always targeting that top level element.
I guess another way to ask this question is, how do I place an overlay (site PSD) over a live site, without it affecting my inspector workflow?
Thanks for any suggestions!
I just tried :before, which allows text selection / doesn't appear in the inspector, but it's still caught.

Was just looking at my old answers, and not sure if it's just new chrome behavior or what, but Chrome's inspect element respects pointer-events: none;

I imagine you're talking about using the right-click option to inspect element or the magnify glass to select an object on the page. I don't think there is a way to prevent it from working that way without a little work on your part.
You could have a button that turns on and off that overlay locally for you (or a JS snippet that you can run in the console to delete the overlay).
You could select the overlay and then in the inspect element portion of the tools right-click the object and delete the node (as long as it isn't the parent of all the other content). Then you can select the object on the page.
Or you can just inspect the element (the top one) and then drill down in the DOM tree in the inspect element tab of Chrome to your element. One nice thing though, if you do it this way when you refresh it should take you back to that element in the inspect element tab (unless it's really complex with iFrames loading on the page, in which case it won't do that).

Related

How to see HTML hierarchy of a page

I'm looking for a tool that will label the components on a page with their position in the DOM, so I can see immediately, then, that a particular div is a child of some other div and had some children divs. I know I've seen this tool but it was a long time ago and I don't recall where it came from. Chrome Dev tools?
I think you're referring to Chrome's inspector. Just right click any DOM element on the page and click "Inspect element"
from there you can see the hierarchy of HTML
https://developers.google.com/web/tools/chrome-devtools/inspect-styles/ for more info
After selecting an element, this breadcrumb shows you all of the parents of the currently-selected element.

Multiple selection of HTML elements in Firefox (or other) inspector?

In the question https://stackoverflow.com/questions/33907611/controlling-line-spacing-with-br-firefox-rendering-differences-with-html4-doc, I wanted to show the boxes of HTML elements, as that would have clarified the problem best. Unfortunately, I couldn't find a way to select multiple elements when using the Firefox inspector, so I had to select each element individually, take a screenshot, and then combine the screenshots into an animated gif like this:
... which is a rather tedious and time-consuming job.
Is there a way to do a multiple selection - either from the main browser window, or from the HTML tree in the inspector in the bottom - such that the element boxes of the selected elements are all indicated/shown simultaneously? I tried Ctrl+click-ing, that doesn't work...
Alternatively, is there another addon/browser/tool that can do this (maybe Chrome?)
In going through the latest release of Google Developers' EDIT THE DOM section for Chrome, there is no mention of the ability to select multiple elements. This suggests the feature doesn't exist.
A similar question came to the same conclusion, albeit the link reference wasn't much help.
Thinking about it logically, however, there's really no way such a feature could reasonably work: Once an element is highlighted, dev tools (or Inspector) populates the right panel with the element's styles, computed values, event listeners, and other unique data. How could dev tools do this for two or more elements at a time? Maybe it's technically possible, but the appearance would be messy, cluttered and potentially confusing.

webpage overflow scroll bar

Here is the issue I am having:
One of my webpages overflows on the x-axis, meaning I have to scroll left or right which in effect causes other issues.
I started disabling all the css stuff for that page, but I still continue to see the scroll bar at the bottom.
How do I find out which element/html code is causing this? There are literally hundreds of lines of code.
Thanks
Bruce
If you're using a WebKit-based browser, try the Web Inspector. If you're using Firefox, try using Firebug.
Regardless, either of those tools should have some way that lets you see the HTML of the page. In both of these tools, when you hover over the element in the inspector, it will highlight the element on the page. If you just move your mouse down over the elements, you might see one pop out of the confines of the page. If that doesn't find it, you could try right clicking on areas of the normally-out-of-view part and clicking Inspect Element. If you get some specific element, that might be causing the problem.
Depending on the browser you are using, there are multiple methods via an 'element inspector'. A helpful bookmarklet that I have found is XRAY. Simply enable the inspector or bookmarklet and simply highlight the designated area that you wish to inspect.

CSS Layout of a Particular Website

I really like what this website has done with their CSS layout. Is there any tutorials anyone can point me to/an explanation of the layout - particularly how to get those smaller linked images to line up over the larger image. I'm a bit new to design. Let me know.
Site: http://www.fssjax.org
Thanks
Download Firefox's Web Developer Add-on and Firebug. (Chrome has something similar - likely other browsers do too).
After you install them, visit the page in question, and click Outline -> Outline Current Element. This will make it so anything you rollover will show you a red border around it - which will help you understand all the parts that make up their page.
Then, right-click on an element and click Inspect Element (at bottom of pop-up options). This will show you the HTML on the left and the CSS on the right - the perfect way to learn how they're laying out their page.
Download Firebug for Firefox, it allows you to easily inspect elements on a web page and see their css etc. Chrome also has a bult-in inspector.
Inspect an element, look at the css then Google to find out what the css does if you aren't sure.
Well ok, it's kind of a crap navigation though...
Anyway, the nav is built using the float (http://www.w3schools.com/css/css_float.asp) attribute. Two elements (the containers) are placed sequentially, then the first (the nav) is floated to the left of the second. There's also usage of the position (http://www.w3schools.com/cssref/pr_class_position.asp) attribute to move it over the picture.
And like the others said, use Firebug to figure out what everything is doing.

A Firefox tool that shows object and element structure on hover?

on any element in the webpage. I need to look at what the element and children elements are.
For e.g.
Firebug's Inspect tool sounds like what you're looking for.
Also the Web Developer extension does a good job for DOM inspection...
Check out Firebug http://getfirebug.com
You may also use the Firefox DOM Inspector. In the app click the icon at the very top left, then on the desired element on the page, and it should scroll automatically to the relevant node in the DOM tree.