My code
hr {
height: 3px;
background-color: brown;

I have tried many times. How come the code is wrong?
can anybody know how to correct?

The small bit of code you showed us looks fine, so you probably accidentally changed something else that is causing this issue. That’s why it is always a good idea to paste all of your code in here using the following method.

To display your code in here you need to wrap it in triple back ticks. On a line by itself type three back ticks. Then on the first line below the three back ticks paste in your code. Then below your code on a new line type three more back ticks. The back tick on my keyboard is in the upper left just above the Tab key and below the Esc key. You may also be able to use Ctrl+e to automatically give you the triple back ticks while you are typing in the this editor and the cursor is on a line by itself. Alternatively, with the cursor on a line by itself, you can use the </> button above the editor to add the triple back ticks.

Even better is to use the Help button to create a post in here as it will automatically include your code and a link to the step. So next time you need to ask a new question, please use the Help button.