HTML css, what is a modern line?

What is the modern way to make a line halfway through the screen? I saw this in the textbook and now it looks a little old fashioned.

how

<hr size="6" width="50%">

How would you do something like this if you were making a web page now?

+3
source share
5 answers

You can continue to use <hr />, but I would suggest abandoning the built-in attributes. This is just another element, and you can move the style information in css:

hr {
  width:50%; 
}
+6
source

You can use CSS to style the string.

hr{
   width:50%;
}
0
source

HTML:

<hr />

CSS

hr { width: 50%; }
0

CSS, - :

hr { width: 50%; }

.. , reset , .

0

<div> :

#line {
    width: 50%;
    margin: 0 auto; /* Centered */
    height: 4px; /* The border adds to height */
    border: 1px solid #888888;
    border-bottom: 1px solid #E9E9E9;
    border-right: 1px solid #E9E9E9;
}
-1

Source: https://habr.com/ru/post/1788222/


All Articles