Html & Css: How To Style An Hr Tag To Have A Title Embedded In It
I'm trying to create an HR that follows the below model: ------------------------------------------------------ This is a fairly common UI pattern but I'm not finding
Solution 1:
<fieldset>
<legend>title</legend>
</fieldset>
You could then apply CSS to these elements to get the desired effect
Solution 2:
What you are looking for is a <fieldset>
tag.
The <fieldset>
element represents a set of form controls optionally grouped under a common name.
The name of the group is given by the first legend element that is a child of the fieldset element, if any. The remainder of the descendants form the group.
The <legend>
element represents a caption for the rest of the contents of the legend element's parent fieldset element.
The dir
attribute can be used to specify the alignment of the text.
rtl
for right
-------------------------------------------------<title>-----
ltr
for left
-----<title>-------------------------------------------------
By default it is ltr
example:
<fieldsetdir="rtl"><legend>Fieldset Demo</legend></fieldset>
Post a Comment for "Html & Css: How To Style An Hr Tag To Have A Title Embedded In It"