문제

I have this design for a dashed box:

enter image description here

what is the best way to create this with css3?

I have tried to use the 'border:dashed' - but it's not looking like the design I need.

I'm wondering if there is a way to do this with only css without using background image

도움이 되었습니까?

해결책

Try to realize it with two DIV boxes

<!DOCTYPE html>
<html>
<head>
<style>

#outside {
width:400px;
height:150px;
border-style:dashed; border-width:3px;
position: relative; 
}
#inside {
background-color: white;
width:404px;
height:154px;
position: absolute;
top:-2px;
left:-2px;
}
</style>
</head>

<body>
<div id="outside">
<div id="inside">
</div>
</div>
</body>

</html>

http://jsfiddle.net/RH5R3/

다른 팁

border:1px dashed grey;

JSFiddle

.box {
    width: 400px;
    height: 200px;
    border: dashed 1px gray;  
}

JSFiddle: http://jsfiddle.net/8Gxys/

 Try this:

    css:

        #xx {
            width: 400px;
            height: 200px; 
        }


        HTML:

        <div style="border:dotted"" id="xx"></div>
라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top