How to create a horizontal line in CSS

0 votes

How to create a horizontal line in CSS?

I’m trying to add a horizontal line to my webpage using CSS for styling. What’s the best way to do this? Are there specific CSS properties I can use to customize its width, color, or style? Any tips for creating a line that fits well with the rest of the design would be appreciated

Oct 29 in Web Development by Nidhi
• 2,660 points
52 views

1 answer to this question.

0 votes

The most basic way to create a horizontal line in HTML is using <hr> tag. The <hr> tag adds a simple, horizontal line across the page, it is used to separate content sections.
you can style the <hr> tag to customize its look, like changing the color, width, or thickness in the CSS file later.

<hr class="styled-line">

.styled-line {
  border: 0;
  height: 2px;           
  background-color: #333; 
  width: 80%;             
  margin: 20px auto;     
}
answered Nov 4 by kavya

Related Questions In Web Development

0 votes
0 answers

How to create a node in a linked list?

How to create a node in a ...READ MORE

Oct 29 in Web Development by Nidhi
• 2,660 points
99 views
0 votes
1 answer

How to create a service file in Angular?

To create a service file in Angular, ...READ MORE

answered Nov 13 in Web Development by kavya
27 views
0 votes
1 answer

How to create a laravel hashed password?

Hello @kartik, Hashing A Password Using Bcrypt in Laravel: $password ...READ MORE

answered Oct 6, 2020 in Web Development by Niroj
• 82,840 points
13,450 views
0 votes
1 answer

How to verify links that open in a new tab in phpUnit?

Hey @Marium, What do you mean by "the ...READ MORE

answered Dec 14, 2020 in Web Development by Gitika
• 65,770 points
1,282 views
0 votes
2 answers

Define a SQL query? What is the difference between SELECT and UPDATE Query? How do you use SQL in SAS?

HI.. SQL is Structured Query Language, which is ...READ MORE

answered Aug 8, 2020 in PHP by anonymous
10,540 views
0 votes
1 answer

Using/Handling colon inside a JSF generated HTML element ID in CSS selector

Yes, you can.  Just Backslash (\) the colon.  Like ...READ MORE

answered Nov 14, 2018 in Others by DataKing99
• 8,250 points
2,846 views
0 votes
1 answer

What is a css selector and where is it used?

CSS Selector is a combination of element ...READ MORE

answered Nov 21, 2018 in Data Analytics by Kalgi
• 52,350 points
924 views
0 votes
1 answer

What is the difference between span and div?

The div should be used to wrap sections of ...READ MORE

answered Jan 16, 2020 in Web Development by Niraj

edited Jan 21, 2020 by Niroj 3,638 views
0 votes
1 answer

How to update Angular version in a project?

Angular is a powerful framework for building ...READ MORE

answered Nov 4 in Web Development by kavya
74 views
0 votes
1 answer

How can you create a tag in Git?

Firstly, we should know what are tags ...READ MORE

answered Nov 4 in Web Development by kavya
54 views
webinar REGISTER FOR FREE WEBINAR X
REGISTER NOW
webinar_success Thank you for registering Join Edureka Meetup community for 100+ Free Webinars each month JOIN MEETUP GROUP