Two ways to implement the CSS dash style: dotted and dashed (instance)

Source: Internet
Author: User
Tags dashed line
CSS dashed border how to do? HTML dashed border settings generally think of border solid,html page layout of solid with the highest probability, to have CSS dashed effect can also be used to do the background of the picture, but not recommended, as far as possible using CSS dashed style to do this dashed effect, then the CSS dash style is border in the dotted and dashed, both of which are CSS dashed, but they are different, see the following CSS dotted border code example usage demo.





CSS Dash Style implementation method One: dotted dashed line


<! Doctype html>
<html>
<head>
<meta http-equiv = "Content-Type" content = "text / html; charset = gbk2312" />
<title> dotted dotted line </ title>
<style type = "text / css">
* {
margin: 100px;
padding: 0;
}
body {
width: 1000px;
margin: 0 auto;
}
.box {
width: 300px; height: 50px;
text-align: center;
padding-top: 30px;
border: 1px dotted # 000;
}
</ style>
</ head>
<body>
<div class = "box"> Hello everyone, I ’m dotted! </ div>
</ body>
</ html>
dotted dotted display effect:

CSS dotted line style 2: dashed dotted line

<! Doctype html>
<html>
<head>
<meta http-equiv = "Content-Type" content = "text / html; charset = gbk2312" />
<title> dashed dotted line </ title>
<style type = "text / css">
* {
margin: 100px;
padding: 0;
}
body {
width: 1000px;
margin: 0 auto;
}
.box {
width: 300px; height: 50px;
text-align: center;
padding-top: 30px;
border: 1px dashed # 000;
}
</ style>
</ head>
<body>
<div class = "box"> Hello everyone, I ’m a dashed dotted line! </ div>
</ body>
</ html>
The dashed dotted line shows the effect:

The difference between dotted and dashed in css dotted style border

dashed: from dash (dash), a dashed line composed of dash

dotted: dotted line from dot (dot), also called dotted line

The above demo can also intuitively see their difference

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.