Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

how to put text in border

Tags:

html

css

I'm trying to insert some text in border but don't know how to do.

How can i put some text in middle of border.

Below is the screen-shot it should look like

enter image description here

like image 515
JavaGeek Avatar asked Oct 03 '11 07:10

JavaGeek


People also ask

How do you put text across a border in CSS?

For the four borders, we need four <fieldset> elements, each containing a <legend> element inside. We add the text that will appear at the borders inside the <legend> elements. To begin, we stack the <fieldset> elements on top of each other in a grid cell and give them borders.

How do I make a text border in HTML?

HTML tags can be formatted using a style attribute. To add a border using the style attribute, add the border CSS inside the quotes after style=. In the example below, we surrounded a paragraph (<p></p>) with a solid red border that is 3 pixels wide. First example with text surrounded by a red border.


2 Answers

Try HTML legend tag.

HTML legend

like image 100
C.L. Avatar answered Sep 20 '22 08:09

C.L.


use legend inside fieldset

The HTML Legend Field Element (<legend>) represents a caption for the content of its parent <fieldset>.

like image 33
diEcho Avatar answered Sep 19 '22 08:09

diEcho