Semantic HTML tag for displaying a path / directory?

Is there any tag suitable for marking up a path or directory?

For instance: <path>user/project/</path>

I checked all the new HTML5 tags, but it looks like this is not suitable for this purpose. So which one will be close?

+2
source share
4 answers

Unfortunately, there is nothing in HTML for this. You can try wrapping it with a tag <pre>or <code>in HTML5. Otherwise, you can use the tag <span>and customize it the way you want it to look.

0
source

, code.path.

, samp.path.

, ol.path :

<ol class="path">
  <li class="dir">user</li>
  <li class="dir">project</li>
<ol>

, span.path.

+1

:

<input type="text" value="user/project/" readonly="readonly" />

One of the advantages is that you can easily choose the full path without having to select other text by accident. On the other hand, this is not entirely semantic, since it is an element of form.

0
source

Source: https://habr.com/ru/post/1662823/


All Articles