HTML and CSS: how an HR tag style has a title embedded in it

I am trying to create an HR that follows the model below:

-----<title>-------------------------------------------------

This is a fairly common user interface pattern, but I do not find an example of how to make this work in HTML. Does anyone have any ideas or even pointers to examples? This morning I'm going to take a walk and did not find what I need.

Oh, and besides, I want it for a form input set.

thank!

+3
source share
2 answers
<fieldset>
     <legend>title</legend>
</fieldset>

Then you can apply CSS to these elements to get the desired effect.

+5
source

What you are looking for is a tag <fieldset>.

<fieldset> , .

, fieldset, . .

<legend> .

dir .

rtl

-------------------------------------------------<title>-----  

ltr

-----<title>-------------------------------------------------

ltr

:

<fieldset dir="rtl">
    <legend>Fieldset Demo</legend>
</fieldset>
+3

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


All Articles