Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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?

like image 336
Mozammel Avatar asked Sep 22 '08 07:09

Mozammel


People also ask

How do you put a box around a title in HTML?

The HTML <fieldset> element is used to group several controls as well as labels ( <label> ) within a web form. The HTML Label Element ( <label> ) represents a caption for an item in a user interface. As mentioned before, the fieldset and legend elements are used when creating forms.

What is box type in CSS?

The CSS box model is essentially a box that wraps around every HTML element. It consists of: margins, borders, padding, and the actual content.

What is box border in CSS?

border-box tells the browser to account for any border and padding in the values you specify for an element's width and height. If you set an element's width to 100 pixels, that 100 pixels will include any border or padding you added, and the content box will shrink to absorb that extra width.


1 Answers

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 />       Etc     </fieldset>
like image 111
Athena Avatar answered Oct 24 '22 18:10

Athena