houdriwiokug houdriwiokug - 4 months ago 5
HTML Question

How to adjust the width of a hr tag

I've got a problem with setting the width of hr tag.. I mean I want my hr tag to be displayed half of the full width like this image:

enter image description here

As you can see the hr tag is between the h1 tag and paragraph and it's half of screen full width.

I have searched and all I got was to setting the hr tag like this:

<hr size="30">


But that just does not work. So do you know how to set the width of hr tag ?

Answer

you can set the style attributes of the hr element in css:

hr{width:50%;margin:0 auto;}