Original source: JellyBool (@JellyBool) Welcome to share the original to Bole Toutiao
Due to some reasons, I didn’t write a blog yesterday. I promised to post one post every day. This is To make up for what I did yesterday. Then I will become a clickbait. The black technology here is actually some properties in CSS that are not well known but are very useful in solving certain problems.
border-radius
Many developers probably do not understand this border-radius correctly, because basically many people use it this way:
CSS
2 3
| .box { border-radius: 4px; }
|
The slightly higher-end version is Like this:
1 2 3 |
.box { border-radius: 4px 6px 6px 4px; } |
CSS
1 23
|
border-radius: 4px 6px 6px 4px; }
|
1 |
斜线前面的影响的是水平方向,斜线后面影响的是垂直方向,各个数字就分别代表四个不一样的方向。 |
1 2 3 | .box { border-radius: 5px 5px 3px 2px / 5px 5px 1px 3px; } |
1 | The one before the slash affects the horizontal direction, and the one after the slash affects the vertical direction. Each number represents four different directions. |
outline-offset
I believe many developers will be familiar with the following statement when writing CSS:
CSS
1 2 3 4 5 6 7 |
input { outline : none; }
input:focus { outline : none; } |
2
3
4
5
6
7
input { outline : none;
}
1 2 3 |
input { outline-offset: 4px ; } |
outline : none;
}
This is how to remove the default blue line frame from the input box. In fact, another thing to mention here is that there is an outline-offset attribute in CSS. In this attribute, you can set the distance of the default wireframe; like this
CSS
1 2 3 |
.col-8 {
} |
input { outline-offset: 4px; } |
1 2 3 | .col-8 { } |
Of course it’s okay, but what if you write it like this:
CSS
2 3
4 5 6 7
| .? { color: hotpink; }
color: yellow; }
|
Well, how does it look, you can use it like this:
1 2 3 4 5 6 7 |
ol li:nth-child(n 7):nth-child(-n 14) { background: lightpink; } /** Or Safari Way **/ ol li:nth-child(-n 14):nth-child(n 7) { background: lightpink; } |
1 |
1 2 3 4 5 6 7 | ol li: nth-child(n 7):nth-child(-n 14) { background: lightpink; } /**Or Safari Way **/ ol li:nth-child(-n 14):nth-child(n 7) { background: lightpink; } |
The above writing method can actually select the seventh to fourteenth li elements below ol.
Pseudo class setting single tag
There are several common single tags in HTML:
,
etc. Details can be found here:
http://www.w3.org/TR/html5/syntax.html#void-elements
The following example is to modify
.
CSS
2 3
4 5 6 7
| hr:before { content: "?? "; }
content: " This is an element"; }
|
Yes, the key is to use the :before and :after pseudo-classes. Here, by the way, you can actually use these two pseudo-classes to modify and , but the premise is that you set the display attributes of these two to:
CSS
1 2 |
|
1 | display: block td> |
1 2 |
Then we use attribute selectors for CSS modification:
3
4
1 2 3 4 5 6 7 |
div [class="box"] { color: blue; }
input [type="email"] { border: solid 1px red; } |
7
div [class="box"] {
color: blue;
}
input [type="email"] {
border: solid 1px red;}
1 2 3 4 5 6 7 |
div [class="BOX"] { color: blue; }
input [type="EMAIL"] { border: solid 1px red; } |
After this becomes uppercase, the first class="BOX" will not affect
, and the second type ="EMAIL" will still be modified normally . So when using attribute selectors, pay attention to capitalization issues.Currently, I just feel like I need to remind myself of these CSS black technologies, and I can add some.
Happy Hacking
It is said that programmers have high wages, but few understand the pain of working overtime. Are you there every time? I think in my heart that the salary calculated based on time is too low, so I want to shout in my heart, either a salary increase, a salary increase, or a salary increase, why? ? Because we are not allowed to work overtime, this is impossible! ! !
Want to subvert your work model? Want to reduce your overtime hours? Join us and explore with us the freedom model that belongs to our programmers!
A native APP for programmers, with the purpose of sharing knowledge and skills, and an online interactive platform in the form of rewards.
We have a top technical team of nearly 20 people, as well as an excellent product and operations team. The team leaders all have more than 10 years of experience in the industry.
Now we are recruiting original participating heroes. You will work with us to change the way programmers work and change the world of programmers! There will also be generous rewards. As our original participant, you will experience this programmer artifact with us. You can make professional suggestions, and we will humbly adopt them. Everyone will be a hero, and you will be the hero we need! At the same time, you can also invite your friends to participate in this hero recruitment interaction.
We won’t waste too much of your time, we just need your professional opinion. As long as you spare 1 hour from a month, you can save two hours every day in the future, everything is for ourselves !
Come? Still not coming?
Contactor password: 1955246408 (QQ)

The official account web page update cache, this thing is simple and simple, and it is complicated enough to drink a pot of it. You worked hard to update the official account article, but the user still opened the old version. Who can bear the taste? In this article, let’s take a look at the twists and turns behind this and how to solve this problem gracefully. After reading it, you can easily deal with various caching problems, allowing your users to always experience the freshest content. Let’s talk about the basics first. To put it bluntly, in order to improve access speed, the browser or server stores some static resources (such as pictures, CSS, JS) or page content. Next time you access it, you can directly retrieve it from the cache without having to download it again, and it is naturally fast. But this thing is also a double-edged sword. The new version is online,

The article discusses using HTML5 form validation attributes like required, pattern, min, max, and length limits to validate user input directly in the browser.

This article demonstrates efficient PNG border addition to webpages using CSS. It argues that CSS offers superior performance compared to JavaScript or libraries, detailing how to adjust border width, style, and color for subtle or prominent effect

Article discusses best practices for ensuring HTML5 cross-browser compatibility, focusing on feature detection, progressive enhancement, and testing methods.

The article discusses the HTML <datalist> element, which enhances forms by providing autocomplete suggestions, improving user experience and reducing errors.Character count: 159

The article discusses the HTML <meter> element, used for displaying scalar or fractional values within a range, and its common applications in web development. It differentiates <meter> from <progress> and ex

This article explains the HTML5 <time> element for semantic date/time representation. It emphasizes the importance of the datetime attribute for machine readability (ISO 8601 format) alongside human-readable text, boosting accessibilit

The article discusses the HTML <progress> element, its purpose, styling, and differences from the <meter> element. The main focus is on using <progress> for task completion and <meter> for stati


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

SAP NetWeaver Server Adapter for Eclipse
Integrate Eclipse with SAP NetWeaver application server.

EditPlus Chinese cracked version
Small size, syntax highlighting, does not support code prompt function

Dreamweaver Mac version
Visual web development tools

Notepad++7.3.1
Easy-to-use and free code editor

VSCode Windows 64-bit Download
A free and powerful IDE editor launched by Microsoft
