Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Is there a non-visual HTML tag?

Does there exist an HTML tag solely for the purpose of nominally grouping its children together? e.g.:

<group id="example_template">
  <h3>Example</h3>
  <div>...</div>
</group>

Ideally, the <group> tag above would be css-exempt, or not affect its children, or at least have no default visual side-effects. The idea is to find the cleanest way to identify a group of contiguous nodes without introducing semantically misleading or junky markup.

An example use case is for a JavaScript HTML templating system. After rendering a template and adding it to the DOM, I'd like to keep track of that fact that the group of elements were rendered together, in case the group should be replaced later.

Open to other solutions as well.

like image 859
calebds Avatar asked Mar 15 '26 17:03

calebds


1 Answers

A div element with no CSS does not produce anything that is visible on the page. This means that unless you add CSS, either as a file or inline, that modifies the DIV, it is effectively invisible.

Update: As noted above, DIVs are for blocking content and SPANs are for inline content

like image 73
jasonscript Avatar answered Mar 18 '26 07:03

jasonscript