DIV CSS dotted line tutorial includes CSS tutorials that explain DIV dotted line cases in various styles that often appear.
This section introduces common CSS dotted lines and DIV tutorials. CSS dotted lines, underlines, and list dotted lines are all handled.
1. CSS border dotted line
Here, the dotted line is controlled by the dotted border border of the border attribute. The css height (css height) and css width (css width) set below are 350 pixels for the convenience of viewing the demonstration. Other meanings.
One and four sides are dotted borders
border:1px dashed #000; black dotted border
Example:
CSS code: .divcss5{border:1px dashed #000; height :50px;width:350px}
Html code:
The border abbreviation is set here to define the four-sided borders of the divcss5 selector as 1px black dotted border
2. Dotted line on the left:
CSS code: .divcss5-1{border-left:1px dashed #000; height:50px;width:350px }
Html code:
Here I set a black dotted border on the left side
3. Dotted line on the right:
CSS code: .divcss5-2{border-right:1px dashed #000; height:50px;width:350px}
Html code:
Here I set the right side to be a black dotted border
4. The top edge (upper edge) is a dotted line:
CSS code: .divcss5-3{border-top:1px dashed #000; height:50px;width:350px}
Html code:
Here the top edge (upper edge) is set to a black dotted border
5. The bottom edge (lower edge) is a dotted line:
CSS code: .divcss5-4{border-bottom:1px dashed #000; height:50px;width:350px}
Html code:
Here, the bottom edge (lower line) is set as a black dotted border
6. If any side is not dotted, and the other three sides are dotted
Add a right border that is not dotted but has no edge, and the other three sides are black dotted borders
CSS code: .divcss5-5{border:1px dashed #000;border-right:0; height:50px;width :350px}
Html code:
Here by setting the The four sides of the object are black 1px dotted borders, and then one side is set to 0. This is equivalent to setting the dotted border attributes of 3 sides, but pay attention to the order of setting the border attributes here.
The complete DIV+CSS code of the above example is as follows:
<!DOCTYPE html> <html> <head> <meta charset="gb2312" /> <title>CSS 虚线 DIVCSS5实例说明<title>www.php.cn</title> <style> .divcss5{ border:1px dashed #000; height:50px; width:350px} .divcss5-1{border-left:1px dashed #000; height:50px;width:350px} .divcss5-2{border-right:1px dashed #000; height:50px;width:350px} .divcss5-3{border-top:1px dashed #000; height:50px;width:350px} .divcss5-4{border-bottom:1px dashed #000; height:50px;width:350px} .divcss5-5{border:1px dashed #000; border-right:0;height:50px;width:350px} /* www.divcss5.com实例 */ </style> </head> <body> www.divcss5.com css虚线实例实例<br> <div class="divcss5">我四边为虚线边框</div><br> <div class="divcss5-1">我的左边为黑色虚线边框</div><br> <div class="divcss5-2">我的右边为黑色虚线边框</div><br> <div class="divcss5-3">我的上边为黑色虚线边框</div><br> <div class="divcss5-4">我的下边为黑色虚线边框</div><br> <div class="divcss5-5">我的右边边框无边线而其它三边为黑色虚线边框实例</div> </body> </html>
2. Hyperlink dotted line and underline
We often set the linked text content or Links have a dotted underline, or a dotted underline appears when the mouse is moved to the text with a link. How to achieve this? Here we will introduce you to the dotted underline of CSS hyperlinks.
1. Linked text has dotted underline
Here, the CSS style of the hyperlink a object is also controlled through the CSS border property.
Demonstration CSS code:
a{ border-bottom:1px dashed #111;}/* Here set the dotted underline to appear below the link text*/
a:hover{ border:0;} /* Here, set the dotted line not to appear when the mouse passes over the linked text */
Complete DIV CSS code:
<!DOCTYPE html><html><head><meta charset="gb2312" /><title>CSS 虚线下划线 DIVCSS5实例说明</title><style>a{ border-bottom:1px dashed #111;text-decoration:none;}a:hover{ border:0;}</style></head> <body>欢迎到<a href="www.php.cn">CSS教程网</a>的www.php.cn- divcss5学习CSS</body></html>
Description: text-decoration:none; This is to remove the CSS underline ( The underline attribute that comes with hyperlinks by default)
The above is the detailed content of Common CSS dotted line example tutorials. For more information, please follow other related articles on the PHP Chinese website!

In this week's roundup: Firefox gains locksmith-like powers, Samsung's Galaxy Store starts supporting Progressive Web Apps, CSS Subgrid is shipping in Firefox

In this week's roundup: Internet Explorer finds its way into Edge, Google Search Console touts a new speed report, and Firefox gives Facebook's notification

You’re probably already at least a little familiar with CSS variables. If not, here’s a two-second overview: they are really called custom properties, you set

Building websites is programming. Writing HTML and CSS is programming. I am a programmer, and if you're here, reading CSS-Tricks, chances are you're a

Here's what I'd like you to know upfront: this is a hard problem. If you've landed here because you're hoping to be pointed at a tool you can run that tells

Picture-in-Picture made its first appearance on the web in the Safari browser with the release of macOS Sierra in 2016. It made it possible for a user to pop

Gatsby does a great job processing and handling images. For example, it helps you save time with image optimization because you don’t have to manually

I learned something about percentage-based (%) padding today that I had totally wrong in my head! I always thought that percentage padding was based on the


Hot AI Tools

Undresser.AI Undress
AI-powered app for creating realistic nude photos

AI Clothes Remover
Online AI tool for removing clothes from photos.

Undress AI Tool
Undress images for free

Clothoff.io
AI clothes remover

AI Hentai Generator
Generate AI Hentai for free.

Hot Article

Hot Tools

SublimeText3 Mac version
God-level code editing software (SublimeText3)

Safe Exam Browser
Safe Exam Browser is a secure browser environment for taking online exams securely. This software turns any computer into a secure workstation. It controls access to any utility and prevents students from using unauthorized resources.

MantisBT
Mantis is an easy-to-deploy web-based defect tracking tool designed to aid in product defect tracking. It requires PHP, MySQL and a web server. Check out our demo and hosting services.

SecLists
SecLists is the ultimate security tester's companion. It is a collection of various types of lists that are frequently used during security assessments, all in one place. SecLists helps make security testing more efficient and productive by conveniently providing all the lists a security tester might need. List types include usernames, passwords, URLs, fuzzing payloads, sensitive data patterns, web shells, and more. The tester can simply pull this repository onto a new test machine and he will have access to every type of list he needs.

ZendStudio 13.5.1 Mac
Powerful PHP integrated development environment