Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to create a partial-horizontal line in HTML?

Tags:

html

css

I would like to create a thin line below the main heading in a webpage, which is centered, something like this. How do I go about it as using /hr will create an end-to-end line.

like image 452
Hyperbola Avatar asked Jul 16 '16 12:07

Hyperbola


1 Answers

In your example this is done with css and not with a hr-tag So either you can use the css-style border-bottom as in your example, or you indeed can use a hr-tag which you give some CSS, e.g.:

<hr style="width:40%">

If you want to position the hr, you may need the position-style. You can try this easily on the w3c example site.

Remember, that the hr-width-attribute (not the style!) is not working under html5 anymore.

like image 97
franc Avatar answered Sep 21 '22 09:09

franc