html css:如何在<div>周围画出虚线框?

Bin*_*hen 4 html css

我在SO中看到有很多DIV被虚线包围,如何在CSS和HTML中做到这一点?

谢谢.箱子

Joh*_*ker 7

<div style="border: dotted 1px black" id="mydiv">content</div> 
Run Code Online (Sandbox Code Playgroud)

要么

<style type='text/css'>
    #mydiv { border: dotted 1px black; }
</style>
Run Code Online (Sandbox Code Playgroud)