How To Change The Thickness Of Hr Tag Using CSS ? - GeeksforGeeks
Có thể bạn quan tâm
Skip to content
- Courses
- DSA to Development
- Machine Learning & Data Science
- Generative AI & ChatGPT
- Become AWS Certified
- DSA Courses
- Data Structure & Algorithm(C++/JAVA)
- Data Structure & Algorithm(Python)
- Data Structure & Algorithm(JavaScript)
- Programming Languages
- CPP
- Java
- Python
- JavaScript
- C
- All Courses
- Tutorials
- Python Tutorial
- Taking Input in Python
- Python Operators
- Python Data Types
- Python Loops and Control Flow
- Python Conditional Statements
- Python Loops
- Python Functions
- Python OOPS Concept
- Python Data Structures
- Python Exception Handling
- Python File Handling
- Python Exercises
- Java
- Learn Java Programming Language
- Java Collections
- Java 8 Tutorial
- Java Programs
- Java Interview Questions
- Java Interview Questions
- Core Java Interview Questions-Freshers
- Java Multithreading Interview Questions
- OOPs Interview Questions and Answers
- Java Exercises
- Java Quiz
- Java Quiz
- Core Java MCQ
- Java Projects
- Advance Java
- Spring Tutorial
- Spring Boot Tutorial
- Spring Boot Interview Questions
- Spring MVC Tutorial
- Spring MVC Interview Questions
- Hibernate Tutorial
- Hibernate Interview Questions
- Programming Languages
- JavaScript
- C++
- R Tutorial
- SQL
- PHP
- C#
- C
- Scala
- Perl
- Go Language
- Kotlin
- System Design
- System Design Tutorial
- Software Design Patterns
- System Design Roadmap
- Top 10 System Design Interview Questions and Answers
- Interview Corner
- Company Preparation
- Top Topics
- Practice Company Questions
- Interview Experiences
- Experienced Interviews
- Internship Interviews
- Competitive Programming
- Multiple Choice Quizzes
- Aptitude for Placements
- Computer Science Subjects
- Operating System
- DBMS
- Computer Networks
- Engineering Mathematics
- Computer Organization and Architecture
- Theory of Computation
- Compiler Design
- Digital Logic
- Software Engineering
- DevOps
- GIT
- AWS
- Docker
- Kubernetes
- Microsoft Azure Tutorial
- Google Cloud Platform
- Linux
- Linux Tutorial
- Linux Commands A-Z
- Linux Commands Cheatsheet
- File Permission Commands
- Linux System Administration
- Linux File System
- Linux Shell Scripting
- Linux Networking
- Linux Interview Questions
- Software Testing
- Software Testing Tutorial
- Software Engineering Tutorial
- Testing Interview Questions
- Jira
- Databases
- DBMS Tutorial
- SQL Tutorial
- PostgreSQL Tutorial
- MongoDB Tutorial
- SQL Interview Questions
- MySQL Interview Questions
- PL/SQL Interview Questions
- Android
- Android Tutorial
- Android Studio Tutorial
- Kotlin For Android
- Android Projects
- Android Interview Questions
- 6 Weeks of Android App Development
- Excel
- MS Excel Tutorial
- Introduction to MS Excel
- Data Analysis in Excel
- Basic Excel Formulas & Functions
- Data Analysis in Advanced Excel
- Workbooks
- Statistical Functions
- Data Visualization in Excel
- Pivot Tables in Excel
- Excel Spreadsheets in Python
- Basic Excel Shortcuts
- Mathematics
- Number System
- Algebra
- Linear Algebra
- Trigonometry
- Set Theory
- Statistics
- Probability
- Geometry
- Mensuration
- Logarithms
- Calculus
- Python Tutorial
- DSA
- Data Structures
- Arrays
- Matrix
- Strings
- Linked List
- Stack
- Queue
- Tree
- Heap
- Hashing
- Graph
- Set Data Structure
- Map Data Structure
- Advanced Data Structure
- Data Structures Tutorial
- Algorithms
- Analysis of Algorithms
- Design and Analysis of Algorithms
- Asymptotic Analysis
- Asymptotic Notations
- Worst, Average and Best Cases
- Searching Algorithms
- Linear Search
- Binary Search
- Searching Algorithms Tutorial
- Sorting Algorithms
- Selection Sort
- Bubble Sort
- Insertion Sort
- Merge Sort
- Quick Sort
- Heap Sort
- Counting Sort
- Radix Sort
- Bucket Sort
- Sorting Algorithms Tutorial
- Greedy Algorithms
- Dynamic Programming
- Graph Algorithms
- Pattern Searching
- Recursion
- Backtracking
- Divide and Conquer
- Mathematical Algorithms
- Geometric Algorithms
- Bitwise Algorithms
- Randomized Algorithms
- Branch and Bound
- Algorithms Tutorial
- Analysis of Algorithms
- DSA Tutorial
- Practice
- All DSA Problems
- Problem of the Day
- Company Wise Coding Practice
- Amazon
- Microsoft
- Flipkart
- Explore All
- GfG SDE Sheet
- Practice Problems Difficulty Wise
- School
- Basic
- Easy
- Medium
- Hard
- Language Wise Coding Practice
- CPP
- Java
- Python
- Curated DSA Lists
- Beginner's DSA Sheet
- Top 50 Array Problems
- Top 50 String Problems
- Top 50 DP Problems
- Top 50 Graph Problems
- Top 50 Tree Problems
- Competitive Programming
- Company Wise SDE Sheets
- Facebook SDE Sheet
- Amazon SDE Sheet
- Apple SDE Sheet
- Netflix SDE Sheet
- Google SDE Sheet
- DSA Cheat Sheets
- SDE Sheet
- DSA Sheet for Beginners
- FAANG Coding Sheet
- Product-Based Coding Sheet
- Company-Wise Preparation Sheet
- Top Interview Questions
- Puzzles
- All Puzzles
- Top 100 Puzzles Asked In Interviews
- Top 20 Puzzles Commonly Asked During SDE Interviews
- Data Structures
- Data Science
- Python Tutorial
- R Tutorial
- Machine Learning
- Data Science using Python
- Data Science using R
- Data Science Packages
- Pandas Tutorial
- NumPy Tutorial
- Data Visualization
- Python Data Visualization Tutorial
- Data Visualization with R
- Data Analysis
- Data Analysis with Python
- Data Analysis with R
- Deep Learning
- NLP Tutorial
- Web Tech
- HTML Tutorial
- CSS Tutorial
- JavaScript Tutorial
- PHP Tutorial
- ReactJS Tutorial
- NodeJS Tutorial
- Bootstrap Tutorial
- Typescript
- Web Development Using Python
- Django
- Django Tutorial
- Django Projects
- Django Interview Questions
- Flask
- Flask Tutorial
- Flask Projects
- Flask Interview Questions
- Postman
- Github
- Django
- Cheat Sheets
- HTML Cheat Sheet
- CSS Cheat Sheet
- JavaScript Cheat Sheet
- React Cheat Sheet
- Angular Cheat Sheet
- jQuery Cheat Sheet
- Bootstrap Cheat Sheet
- Learn Complete Web Development
- CSS Tutorial
- CSS Exercises
- CSS Interview Questions
- CSS Selectors
- CSS Properties
- CSS Functions
- CSS Examples
- CSS Cheat Sheet
- CSS Templates
- CSS Frameworks
- Bootstrap
- Tailwind
- CSS Formatter
The <hr> tag in HTML creates a horizontal rule or a thematic break in an HTML page. The thickness of the <hr> tag defines the height of the horizontal line. To change the thickness of hr tag, CSS height property is used.
Syntax
hr { height: 3px;}Example 1: Inserting a horizontal rule along with some CSS properties.
HTML <!DOCTYPE html> <html lang="en"> <head> <style> .custom-hr{ border:none; height:12px; background:black; margin:20px0; } </style> </head> <body> <h1>Code World</h1> <hr class="custom-hr" /> <h3>A Computer Science Portal</h3> </body> </html>Output
change the thickness of hr tag
Example 2: Different styling and thickness of <hr> element in CSS.
HTML <!DOCTYPE html> <html lang="en"> <head> <style> hr.class-1{ border-top:10pxsolid#8c8b8b; } hr.class-2{ border-top:3pxdouble#8c8b8b; } hr.class-3{ border-top:1pxdashed#8c8b8b; } hr.class-4{ border-top:1pxdotted#8c8b8b; } hr.class-5{ background-color:#fff; border-top:2pxdashed#8c8b8b; } hr.class-6{ background-color:#fff; border-top:5pxdotted#8c8b8b; } </style> </head> <body> <hr class="class-1" /> <hr class="class-2" /> <hr class="class-3" /> <hr class="class-4" /> <hr class="class-5" /> <hr class="class-6" /> </body> </html>Output
change the thickness of hr tag
P
Pankaj_Singh Follow Improve Previous Article How to indent text in HTML by using CSS ? Next ArticleSimilar Reads
- How to change the thickness of hr tag using CSS ? The <hr> tag in HTML creates a horizontal rule or a thematic break in an HTML page. The thickness of the <hr> tag defines the height of the horizontal line. To change the thickness of hr tag, CSS height property is used. Syntax hr { height: 3px;}Example 1: Inserting a horizontal rule alo 1 min read
- How to Change Font Size using CSS? The CSS font-size property is used to change the font size of text. CSS font-size PropertyThe font-size property in CSS sets the size of the text of HTML elements. Values can be in pixels, percentages, em, rem etc. Syntax font-size: value;Example: We can use various font-size units like - em, smalle 2 min read
- How to set the Text Color of HTML Element using CSS? Setting the text colour of an HTML element using CSS involves using the color property. It allows you to define the colour of the text content within the selected element. Note: The color property can take various colour values, such as named colours, hexadecimal, RGB, or HSL values. Syntax:p { colo 2 min read
- How to Set the Border Thickness of a Table in HTML ? To set the border thickness of a table in HTML, you use the "border" attribute within the <table> tag. This attribute specifies the width of the borders around the table and its cells. The value of the "border" attribute represents the thickness of the border in pixels (px). Syntax<table bo 2 min read
- How to Change the Margin of Paragraph using JavaScript ? The CSS Margin property is used to give space around elements. It is completely transparent and has no background color. It clears up space around the component. Using separate properties, you can independently change the top, bottom, left, and right margins. In this article, we'll see how to change 4 min read
- How to Add Shadow to Text using CSS? The text-shadow property is used to add shadow to the text. The text-shadow property creates text shadows, specifying horizontal/vertical offsets, blur radius, and color for depth and emphasis. Note: We can customize text shadow by changing position, blur, and color for improved appearance and visua 1 min read
- How to make rounded corner using CSS ? Creating rounded corners is a popular design technique in web development that enhances the visual appeal of web elements. The CSS border-radius property allows you to easily set the radius of an element's corners, making them rounded. In this article, we will explore how to use the border-radius pr 3 min read
- How to set the margins of a paragraph element using CSS ? The CSS margins properties are used to make space around components, outside any characterized borders. With CSS, you have full power over the margins. There are properties for setting the edge for each side of a component (top, right, base, and left). CSS has properties for indicating the edge for 2 min read
- How to Change the Height of br Tag? The <br> (break) tag in HTML is used to create line breaks in text or content. By default, the <br> tag generates a simple line break without any additional spacing. Sometimes we need to adjust the height or spacing of the line break to control the layout. In this article, we will explor 2 min read
- How to Add Stroke using CSS ? Adding a stroke using CSS means applying an outline or border around text or elements to enhance visibility and style. This effect is typically achieved with properties like `text-shadow` for text or stroke in SVG elements, creating bold, defined edges. Several methods can be used to add strokes usi 2 min read
- How to define the color of the border using CSS ? We can give the color of the border using border or border-color properties. We need to give border-style property. Approach 1: We will give the color of the border using the border property of CSS.We will give our CSS inside the tags which are also known as an inline style.We need to give the borde 2 min read
- How to bold the text using CSS ? In HTML, we use the <b> and <strong> tags to make content bold. However, when it comes to styling text, CSS provides a more versatile way to achieve boldness through the font-weight property. This property allows you to set various boldness levels for your text to mark something importan 2 min read
- How to Create a Responsive Text using CSS ? This article will show you how to create responsive text with HTML and CSS. Responsive text means the text size will change in different screen sizes. We can create Responsive Text using CSS Media Query or using viewport width (vw). Example 1: In this example, we will create a responsive text using 2 min read
- How to specify the width of the border image using CSS? In this article, we will set the width of the border image using CSS. To set the width of the border image, we use CSS border-image-width property. The border-image-width property is used to set the width of the border-image. It can be set by providing multiple values. If only one value is provided, 2 min read
- How to change the color of horizontal line (hr element) using CSS ? The HTML <hr> tag is used to insert a horizontal rule or a thematic break in an HTML page to divide or separate document sections. The color of the <hr> tag can be set by using the background-color property in CSS. Example 1: In this example, the CSS within the <style> section cust 2 min read
- How to change the underline color in CSS? In this article, we are going to learn how to change the underline color in CSS, To change the underline color in CSS, use the text-decoration-color property. Set it to the desired color value. Styling is implemented in HTML text to make it catchy and attractive. The text can be made italic, underli 1 min read
- How to Change Line Spacing in CSS? The line-height property in CSS is used to adjust line spacing between lines of text. Syntax line-height: value;Example 1: In this example, we will increase the line height using the CSS line-height property. [GFGTABS] HTML <h3>Paragraph with Default Line Spacing</h3> <p> HTML stan 2 min read
- How to Change the Font Family & Size of Text in CSS ? In CSS, the font family and size of the text can be customized to enhance the visual appearance of the text within the application. We can use various inbuilt properties offered by CSS to change font family and size. Below are the approaches to change the font family and size of text in CSS: Table o 3 min read
- How to indent text in HTML by using CSS ? Text indentation in an HTML document sets the length of empty white space before lines of text in a block, typically marking the beginning of a paragraph. Proper indentation can enhance the readability and layout of your web content. Here, we will explore several common approaches for text indentati 3 min read
- CSS
- Web Technologies
- CSS-Misc
What kind of Experience do you want to share?
Interview Experiences Admission Experiences Career Journeys Work Experiences Campus Experiences Competitive Exam ExperiencesTừ khóa » Hr Dotted Line Css
-
How To Style The HR Element With CSS - W3Schools
-
How To Create A Dotted
Tag? [duplicate] - Stack Overflow -
Border-style - CSS: Cascading Style Sheets - MDN Web Docs - Mozilla
-
How To Make A Dotted Hr In Css Code Example - Code Grepper
-
Html Hr Dotted Line Code Example - Code Grepper
-
Dashed Hr - CodePen
-
How To Make Horizontal Lines
In HTML & CSS - Love2Dev -
How To Make A Dotted Hr In Css - MaxInterview
-
"how To Make A Dotted Hr In Css" Code Answer's - CodeProZone
-
How To Make A Dotted Hr In CSS? - Poopcode
-
CSS Dashed Line Using HR Tag - JSFiddle - Code Playground
-
How To Add Hr In Css?
-
How To Make A Dotted Hr In Css - Code Example
-
How To Create A Dotted
Tag? [duplicate]