Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Draw a line in a div

Tags:

html

css

I want to make a div that is a line. Here is my HTML:

<html xmlns="http://www.w3.org/1999/xhtml">     <head>         <link href="clickable.css"  type="text/css" rel="stylesheet" />     </head>     <body >         <div class="line"></div>     </body > </html> 

And here my CSS:

.line{     width: 112px;     height: 47px;     border-bottom: 1px solid black;     position: absolute;     } </style> 

Nothing is displaying, something is probably wrong in my CSS, but I can't see what.

like image 504
Laetis Avatar asked Sep 28 '15 09:09

Laetis


People also ask

How do I draw a horizontal line in a div?

Its simple to add a horizontal line in your markup, just add: <hr>. Browsers draw a line across the entire width of the container, which can be the entire body or a child element.

How do I add a new line to a div tag?

Type <br /> (or <br>) where the line break should occur. There is no separate end br tag because it's what's known as an empty (or void) element; it lacks content. Typing br as either <br /> or <br> is perfectly valid in HTML5.


1 Answers

Its working for me

 .line{  width: 112px;  height: 47px;  border-bottom: 1px solid black;  position: absolute;  }
<div class="line"></div>
like image 168
Mukul Kant Avatar answered Oct 11 '22 06:10

Mukul Kant