Skip to main content

HTML hr Tag | Basic syntax of the hr tag - Example of the hr tag

HTML <hr> Tag:

The `<hr>` tag in HTML is used to create a horizontal rule, also known as a horizontal line or a divider. It is a self-closing tag, meaning it doesn't have a closing tag. The `<hr>` tag is often used to separate content within a page or to indicate a change in topic or section.

Here is the basic syntax of the `<hr>` tag:

html
<p>This is some text.</p>
<hr>
<p>This is more text after the horizontal rule.</p>

Example:

html
<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>HTML hr Tag Example</title>
</head>
<body>
  <h1>Document Title</h1>
  <p>This is the first paragraph of text.</p>
  <hr>
  <p>This is the second paragraph of text, separated by a horizontal rule.</p>
</body>
</html>
Basic syntax of the hr tag - Example of the hr tag
HTML hr Tag

In this example, the `<hr>` tag is used to create a horizontal line between the two paragraphs, visually separating them. The horizontal rule can be styled using CSS to change its appearance, such as its color, width, and style.

css
hr {
  color: #333; /* Change the color of the horizontal rule */
  margin-top: 20px; /* Add space above the horizontal rule */
  margin-bottom: 20px; /* Add space below the horizontal rule */
  border-style: dotted; /* Change the style of the border */
}


The `<hr>` tag is a simple and effective way to visually break up content and provide a clear visual separation between sections on a webpage.

Comments

Popular posts from this blog

Best Money Earning Apps in India 2026 – Online Jobs & Income Guide

Best Apps to Earn Money Online in India (2026 Guide) Introduction With the rapid growth of Technology and digital platforms, earning Money online in India has become easier than ever. From students to professionals, everyone is exploring online Jobs and Business opportunities using mobile apps. In this blog, we will explore the Best Apps to Earn Money Online in India , along with selection process, benefits, earning power, and latest developments. Why Choose Money Earning Apps? Online earning apps are becoming popular due to: Flexible working hours No high investment required Easy to start with basic skills Opportunity to build a scalable Business Increasing demand due to Latest Development in digital economy Best Apps to Earn Money Online in India 1. Meesho Category: Reselling Business Earn by selling products without investment Share products via WhatsApp & social media Profit margin depends on pricing Best For: Housewives, beginners, side income seekers 2. Upwork Category...

New Technology Trends That Will Change India Jobs

New Technology Trends That Will Change India: Jobs, Money, Business & Future Opportunities: India is rapidly transforming into a technology-driven economy. With the rise of AI, automation, and digital platforms, new Technology trends are not only shaping industries but also creating new Jobs , boosting Business , and opening multiple ways to earn Money . In this blog, we will explore the latest developments, future job roles, selection process, benefits, and the power these technologies hold in shaping India’s future. Introduction: Why Technology Trends Matter in India India’s digital growth is fueled by government initiatives, startups, and global investments. The integration of Technology in sectors like agriculture, healthcare, education, and finance is creating massive opportunities. These trends are directly impacting: Job creation Business growth Income opportunities Skill demand Top New Technology Trends That Will Change India 1. Artificial Intelligence (AI) & Automati...

Students want to know about Government Jobs

What Students Want to Know About Government Jobs 1. Eligibility Criteria Minimum education required (10th / 12th / Graduation) Age limit and age relaxation (SC/ST/OBC) Physical fitness requirements (if any) Nationality requirements 2. Types of Government Jobs Central Government jobs State Government jobs Public Sector Undertakings (PSUs) Banking jobs Teaching jobs Defence jobs (Army, Navy, Air Force) Railway jobs 3. Popular Government Exams Union Public Service Commission (UPSC) Staff Selection Commission (SSC) Institute of Banking Personnel Selection (IBPS) Railway Recruitment Board (RRB) State PSC exams 4. Syllabus & Exam Pattern Subjects included in the exam Number of stages (Prelims, Mains, Interview) Marking scheme & negative marking Language of exam (Hindi / English) 5. Selection Process Written examination Physical test (for defence/police) Skill test / typing test Interview / document verification Medical examination 6. Salary & Pay Scale Starting salary Grade pay ...