The Web Design Group

... Making the Web accessible to all.

Welcome Guest ( Log In | Register )

 
Reply to this topicStart new topic
> hr line in a div
jjordan33
post Apr 1 2019, 04:00 PM
Post #1





Group: Members
Posts: 7
Joined: 1-April 19
Member No.: 26,868



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 }
}
User is offlinePM
Go to the top of the page
Toggle Multi-post QuotingQuote Post
Christian J
post Apr 1 2019, 04:45 PM
Post #2


.
********

Group: WDG Moderators
Posts: 8,238
Joined: 10-August 06
Member No.: 7



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>
User is offlinePM
Go to the top of the page
Toggle Multi-post QuotingQuote Post
pandy
post Apr 1 2019, 08:30 PM
Post #3


Don't like donuts. Don't do MySpace.
********

Group: WDG Moderators
Posts: 18,402
Joined: 9-August 06
Member No.: 6



Did you remember to add the HR to the HTML?
User is offlinePM
Go to the top of the page
Toggle Multi-post QuotingQuote Post
jjordan33
post Apr 2 2019, 05:22 PM
Post #4





Group: Members
Posts: 7
Joined: 1-April 19
Member No.: 26,868



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.
User is offlinePM
Go to the top of the page
Toggle Multi-post QuotingQuote Post
pandy
post Apr 2 2019, 06:37 PM
Post #5


Don't like donuts. Don't do MySpace.
********

Group: WDG Moderators
Posts: 18,402
Joined: 9-August 06
Member No.: 6



I'm psychic! tongue.gif
User is offlinePM
Go to the top of the page
Toggle Multi-post QuotingQuote Post

Reply to this topicStart new topic
2 User(s) are reading this topic (2 Guests and 0 Anonymous Users)
0 Members:

 



- Lo-Fi Version Time is now: 18th October 2019 - 08:57 AM