How to Create Horizontal and Vertical Lines in HTML (+Image)
Steps on how to create horizontal and vertical lines in HTML along with examples
Website makers certainly want to see the website they build looks neat and easy to read by visitors. One way that can make a website look neat is to separate each content in it by using a dividing line such as a horizontal or vertical line. Then, how to make vertical and horizontal lines in HTML?
How to Create Horizontal and Vertical Lines in HTML
Creating horizontal and vertical lines in HTML is actually very easy. You only need to use some HTML tags that can create straight horizontal and vertical lines. Here are the steps.
1. Creating Horizontal Lines in HTML
In the HTML programming language, creating a horizontal line is quite easy. Because you only need to enter one HTML tag and tadaa be the horizontal line. The tag is the tag
or commonly referred to as the horizontal ruler. The following is an example of using a script or code
.
Membuat Garis Horizontal di HTML/title> Ini contoh konten pertama
Ini contoh konten kedua
And the image below is an example display of the results of the script or code above.
Very easy, isn’t it. Then, for example, you are bored with straight horizontal lines like only black, you can color the lines. You just enter the attributes color only in tags
the. The following is an example of using the script.
Membuat Garis Horizontal Berwarna di HTML
Well, you just need to enter the name of the color you want, such as red, yellow, green, and so on. And you can also set the line length by using the width attribute, as in the script or code above. Below you can see the results of the script or code above.
2. Creating Vertical Lines in HTML
Unlike horizontal lines which only require one tag to create, vertical lines in HTML are a bit more difficult than horizontal lines because you need CSS code and tags.
. This div tag is then used to create vertical lines that are manipulated using CSS code. The following is an example of using a script or vertical line code in HTML.
Membuat Garis Vertikal Pada HTML
And below is the result of the script above.
CSS script explanation:
- .vertical_line on tags
Membuat Garis Vertikal Pada HTML Dengan Beberapa Border Dan Warna