当前位置:网站首页>Simple understanding of pseudo elements before and after
Simple understanding of pseudo elements before and after
2022-06-11 06:01:00 【Not bald】
Pseudo elements before,after A simple understanding of
1.before,after brief introduction
Both are based on display:inline-block( Horizontal block level arrangement ) Attribute of exists ,::before Is to add content before the original element ,::after Is to add content after the original element , At the same time, the pseudo element also inherits the attributes of the original element , Just like if the original text is black , The text of pseudo elements will also be black .
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title></title>
<style type="text/css">
div::before{
content: " A piece of writing ";
}
</style>
</head>
<body>
<div style="color: #55FFFF;">
</div>
</body>
</html>

2.content attribute
content Properties can be written in , Like text , Symbol , Of course, you can not write .
1) written words
As the example in the introduction .
2) Symbol
<div>
<q> I am a text I am a text I am a text </q>
</div>
div::before{
width: 200px;
height: 200px;
background-color: #87CEEB;
content: open-quote;
}
div::after{
content: close-quote;
}
q{
quotes: '<''>';
}

3. And hover combination
And hover There will also be some good-looking effects after the combination .
.one{
width: 500px;
height: 200px;
background-color: #7FFFD4;
margin: 0 auto;
}
.one::after {
content: '';
position: absolute;
left: 0;
top: 0;
bottom: 0;
right: 0;
transition: .3s;
background: #ffffff;
transform-origin: left;
transform: scaleX(0);
}
.one:hover::after {
transform: scaleX(1);
}


When the mouse moves up, it will div Will appear .
It can be used transition To control the speed of occurrence .
边栏推荐
- NDK learning notes (IX) POSIX sockect connection oriented communication
- Gilde failed to go to the listener to call back the reason record when loading the Gaussian blur image
- Altiumdesigner2020 import 3D body SolidWorks 3D model
- Which company is better in JIRA organizational structure management?
- Xposed bypasses 360 reinforcement to get a real classloader
- Wechat custom component - style - slot
- 亚马逊、速卖通、Lazada、虾皮平台在用911+VM的环境可以进行产号、养号、补单等操作吗?
- [元数据]LinkedIn-DataHub
- Use of vlayout
- Reading the registry using batch
猜你喜欢

All the benefits of ci/cd, but greener

Altiumdesigner2020 import 3D body SolidWorks 3D model

Deployment of Flink

NDK learning notes (12) native graphics API, using avilib to create an avi video player

亚马逊、速卖通、Lazada、虾皮平台在用911+VM的环境可以进行产号、养号、补单等操作吗?

Which company is better in JIRA organizational structure management?

Sword finger offer 50: the first character that appears only once

Implementation of data access platform scheme (Youzu network)

Jsonobject jsonarray for parsing

View controller and navigation mode
随机推荐
Linux Installation redis
Experimental report on information management and information system [information security and confidentiality] of Huazhong Agricultural University
NDK learning notes (V)
Can Amazon, express, lazada and shrimp skin platforms use the 911+vm environment to carry out production number, maintenance number, supplement order and other operations?
Installing and using sublist3r in Kali
Use of vlayout
Install Oracle Database
[must see for game development] 3-step configuration p4ignore + wonderful Q & A analysis (reprinted from user articles)
NLP-D46-nlp比赛D15
URL in flask_ for
Wechat custom component - style - slot
20多种云协作功能,3分钟聊透企业的数据安全经
Gilde failed to go to the listener to call back the reason record when loading the Gaussian blur image
What is a thread pool?
Adapter the problem of executing only one animation in multiple frames
JIRA software annual summary: release of 12 important functions
“All in ONE”一个平台解决所有需求,运维监控3.0时代已来
Using Internet of things technology to accelerate digital transformation
NDK R21 compiles ffmpeg 4.2.2 (x86, x86_64, armv7, armv8)
数组部分方法