Help - Search - Members - Calendar
Full Version: hr line in a div
HTMLHelp Forums > Web Authoring > Markup (HTML, XHTML, XML)
jjordan33
Hi,

I want to add a hr line into one of my css divs, and I can't seem to make it work. Can someone help me out please?

CODE

.topleft {
  position: absolute;
  top: -10px;
  left: 16px;
  color : #413839;
  padding-left: 150px;
font-family: "Andale Mono";
hr { width:100%; height: 1px; background: #fff }
}
Christian J
You can create a line using the CSS "border" property on the DIV element, e.g. like this:

CODE
div {border-bottom: 1px solid red;}

In contrast, HR is an HTML element, and as such it must be placed where you want it to appear in the HTML structure:

CODE
<div>
foo
<hr>
bar
</div>
pandy
Did you remember to add the HR to the HTML?
jjordan33
QUOTE(pandy @ Apr 1 2019, 09:30 PM) *

Did you remember to add the HR to the HTML?

.......

I did not.... glare.gif

Thank you both.
pandy
I'm psychic! tongue.gif
This is a "lo-fi" version of our main content. To view the full version with more information, formatting and images, please click here.
Invision Power Board © 2001-2020 Invision Power Services, Inc.