简体   繁体   中英

Inline or block using chrome developer tools?

Can we figure out whether an HTML element is inline or block using chrome developer tools?

"inline" and "block" aren't hugely useful categories to use in the first place.

In HTML 4 they were terms used in the DTD to group elements for quickly describing which elements could contain which other elements (and they often had exceptions).

In HTML 5 DTDs are gone and there are a different set of groups for elements.

There's no way to get the HTML categorisation of an element from the developer tools.

(At least not by default. Someone could put together a list of elements and how they are categorised in the specification and then write a developer tools plugin to display that information for the selected element. I'm not aware of anyone who has or why anyone would bother though.)


Meanwhile in CSS, display and block are two of the original values for the display property . Almost all elements used to default to displaying as one or the other.

Today there are many more values as the specification has been rewritten to have (for example) display: inline-block instead of depending on exceptions to the rendering rules and new layout tools have been added like display: grid .

You can determine the display value for an element by looking in the Computed panel.

计算面板

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM