Html – Which CSS tag creates a box like this with title


I want to create a box like this with title:

CSS box with title

Can any one please let me know if there is a default CSS tag to do this? Or do I need to create my custom style?

Best Solution

I believe you are looking for the fieldset HTML tag, which you can then style with CSS. E.g.,

    <fieldset style="border: 1px black solid">

      <legend style="border: 1px black solid;margin-left: 1em; padding: 0.2em 0.8em ">title</legend>

      Text within the box <br />