I'm not exactly sure how to do this with CSS, and I'm having trouble googling about it too because I'm not sure what it's called.
What I want to do is have a line going across my div separating different elements of text. Basically, what I am going for is exactly how the DIC comments section is set up on your profile page.
Is this a special element or do they use an image? I'd really like to do it without an image, is this possible?
Thanks for the help!
Line Separator?
Page 1 of 17 Replies - 4436 Views - Last Post: 31 May 2011 - 09:29 AM
Replies To: Line Separator?
#2
Re: Line Separator?
Posted 29 May 2011 - 09:19 PM
This is a border-bottom CSS style applied to a div element.
The above statement will put a gray line across the bottom of a div element, makes it solid and 1px wide.
div {
border-bottom: #c0c0c0 solid 1px;
}
The above statement will put a gray line across the bottom of a div element, makes it solid and 1px wide.
#3
Re: Line Separator?
Posted 29 May 2011 - 09:30 PM
Oh that was simple enough!
Thanks for the help!
Thanks for the help!
#4
Re: Line Separator?
Posted 30 May 2011 - 08:49 AM
I've tried doing that, and I'm not getting exactly what I want.
Here's my HTML and CSS (with a little php thrown in to print comments):
Right now it's underlining everything between the commetformat class tags. I want just one line underneath each comment.
Here's what it's doing:
Here's my HTML and CSS (with a little php thrown in to print comments):
<div id="thecomments">
<?php
for($j = 0; $j < $viewnumberComments; ++$j)
{
echo '<span class="commentformat">' . ${viewcommenterbox.$j} . "<br/>" . ${viewtimebox.$j} . "<br/>" . ${viewcommentbox.$j} . "<br/><br/></span>";
}
?>
</div>
#thecomments {
position: relative;
left: 30px;
top: 30px;
}
.commentformat {
border-bottom: #c0c0c0 solid 1px;
width: 200px;
/*background-color: gray;*/
}
Right now it's underlining everything between the commetformat class tags. I want just one line underneath each comment.
Here's what it's doing:
#5
Re: Line Separator?
Posted 31 May 2011 - 02:17 AM
Personally I would have each peice of data (such as viewcommentbox) in separate divs or spans. This allows you to easily restyle them later as well as to add the border to the last one.
#6
Re: Line Separator?
Posted 31 May 2011 - 03:33 AM
I would actually just put a <hr /> tag, that would be so much easier.
#7
Re: Line Separator?
Posted 31 May 2011 - 06:46 AM
I didn't evem know the <hr /> tag existed. Thanks for pointing that out, it's exactly what I was looking for!
#8
Re: Line Separator?
Posted 31 May 2011 - 09:29 AM
It is still better to wrap each thing in divs. This is best practice because it allows for one step styling with a style sheet and will allow simple tweaks in the style sheet when it comes time to test against browser.
Page 1 of 1
|
|

New Topic/Question
Reply



MultiQuote





|