
- CSS Tutorial
- CSS - Home
- CSS - Introduction
- CSS - Syntax
- CSS - Inclusion
- CSS - Measurement Units
- CSS - Colors
- CSS - Backgrounds
- CSS - Fonts
- CSS - Text
- CSS - Images
- CSS - Links
- CSS - Tables
- CSS - Borders
- CSS - Margins
- CSS - Lists
- CSS - Padding
- CSS - Cursors
- CSS - Outlines
- CSS - Dimension
- CSS - Scrollbars
- CSS Advanced
- CSS - Visibility
- CSS - Positioning
- CSS - Layers
- CSS - Pseudo Classes
- CSS - Pseudo Elements
- CSS - @ Rules
- CSS - Text Effects
- CSS - Media Types
- CSS - Paged Media
- CSS - Aural Media
- CSS - Printing
- CSS - Layouts
- CSS - Validations
- CSS3 Tutorial
- CSS3 - Tutorial
- CSS3 - Rounded Corner
- CSS3 - Border Images
- CSS3 - Multi Background
- CSS3 - Color
- CSS3 - Gradients
- CSS3 - Shadow
- CSS3 - Text
- CSS3 - Web font
- CSS3 - 2d transform
- CSS3 - 3d transform
- CSS3 - Animation
- CSS3 - Multi columns
- CSS3 - User Interface
- CSS3 - Box Sizing
- CSS Responsive
- CSS - Responsive Web Design
- CSS References
- CSS - Questions and Answers
- CSS - Quick Guide
- CSS - References
- CSS - Color References
- CSS - Web browser References
- CSS - Web safe fonts
- CSS - Units
- CSS - Animation
- CSS Resources
- CSS - Useful Resources
- CSS - Discussion
How to create a vertical line with CSS?
To create a vertical line with CSS, the code is as follows −
Example
<!DOCTYPE html> <html> <head> <meta name="viewport" content="width=device-width, initial-scale=1"> <style> .vLine { border-left: 6px solid rgb(128, 0, 128); height: 500px; margin-left: 5%; } </style> </head> <body> <h1>Vertical Line Example<h1> <div class="vLine"></div> </body> </html>
Output
The above code will produce the following output −
- Related Articles
- How to create a vertical menu with CSS?
- How to create a vertical "button group" with CSS?
- How to create a line chart using ggplot2 with a vertical line in R?
- Create a Vertical Button Group with CSS
- How to create a vertical tab menu with CSS and JavaScript?
- How to create a wide vertical line using ggplot2 with different color in R?
- How to create vertical line in xyplot in R?
- How to create a dotted vertical line using ggplot2 in R?
- How to create a Vertical Navigation Bar using HTML and CSS ?
- How to Create the path element vertical line in JavaFX?
- How to create a circle with vertical lines in R?
- How to create a vertical line in a time series plot in base R?\n
- How to create a pagination with CSS?
- How to create a Calendar with CSS?
- How to create a preloader with CSS?

Advertisements