tags:

views:

34

answers:

2

I saw in SO there is a lot of DIV which is surrounded by dotted lines, how to do it in CSS & HTML?

Thanks. Bin

+3  A: 
<div style="border: dotted 1px black" id="mydiv">content</div> 

or

<style type='text/css'>
    #mydiv { border: dotted 1px black; }
</style>
John Boker
man im drunk, and i need more characters
John Boker
more upvotes please
John Boker
man bin is an awesome name as a dev.
John Boker
is it possible to specify which sides has borders? eg) I want the top, left, right side have borders, but I don't want the bottom side has border, is it doable?
Bin Chen
yes, you can use border-left: dotted 1px black; or border-right, same for border-top and border-bottom
John Boker
thats' cool, thanks John. I hope you have gotten out of drunk.
Bin Chen
John Boker
A: 
<style type='text/css'>
    #mydiv { border-left: 1px dotted black; }
</style>

You can target each side individually, so instead of border-left you can use border-right, border-bottom, or border-top.

Also there are more then just solid or dotted borders you can find more here

http://www.w3schools.com/css/css_border.asp

orodio