Answers
Feb 26, 2007 - 11:51 AM
They way I am thinking to create a dotted line with css is to use the BORDER property.
This is an example:
Because borders are attached to boxes, you want to specify which border to display: top, bottom, left or right. The first parameter specifies the thickness, the second that it should be dotted and the last is the rgb color code.
The length of the line will depend on - in this case - the width of your box, which you can set with the width property.
You can probably do something with the
element as well (which is by nature a line - a horisontal rule), but since this one is styled so differently in various browsers, I think it is not worth trying.
This is an example:
Because borders are attached to boxes, you want to specify which border to display: top, bottom, left or right. The first parameter specifies the thickness, the second that it should be dotted and the last is the rgb color code.
The length of the line will depend on - in this case - the width of your box, which you can set with the width property.
You can probably do something with the
element as well (which is by nature a line - a horisontal rule), but since this one is styled so differently in various browsers, I think it is not worth trying.
Feb 26, 2007 - 11:58 AM
How would it be displayed on a .css page?
Feb 26, 2007 - 12:14 PM
I use inline style in the example only because it is shorter - of course it's probably best to put the style in a class in an external .css document.
The translation is very easy:
and in styles.css:
.horizontal_dotted_line
{
border-bottom: 1px dotted #80c080;
width: 100px;
}
I hope that was what you meant.
The translation is very easy:
and in styles.css:
.horizontal_dotted_line
{
border-bottom: 1px dotted #80c080;
width: 100px;
}
I hope that was what you meant.
Add New Comment