当前位置:网站首页>Understand the role of before and after Clearfixafter clear floating
Understand the role of before and after Clearfixafter clear floating
2022-06-11 02:05:00 【Bejpse】
The first style setting
When adding... To an element span, Want to set up css style , You need to rename it and set it again css style , To achieve the effect , More trouble
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title></title>
<style>
span:nth-of-type(1){
border: 1px solid red;
}
span:nth-of-type(2){
border: 1px solid salmon;
}
</style>
</head>
<body>
<p>
<span> Love :</span>
I love css
<span> Don't love </span>
</p>
</body>
</html>

The second style setting
We can find out , We can go straight to css with .pp:before( front ) Create an inline element
.pp:after( after ) Create an inline element
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title></title>
<style>
.pp:before{
content: " I :";
border: 1px red solid;
}
.pp::after{ content: " Don't love ";
border: 1px red solid;
}
</style>
</head>
<body>
<p class="pp">
I love css
</p>
</body>
</html>

.clearfix:after Clear the float
You must have seen and understood .
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title></title>
<meta name="viewport" content="width=device-width,initial-scale=1,minimum-scale=1,maximum-scale=1,user-scalable=no" />
<style>
div{
background-color: gold;
}
div p{ background-color: hotpink; float: left;}
.clearfix:after{
content: "";
display: block;
clear: both;
}
</style>
</head>
<body>
<div class="clearfix">
<p>abc</p>
<p>dev</p>
<p>good</p>
</div>
</body>
</html>

边栏推荐
- Internet of things final assignment - sleep quality detection system (refined version)
- [QT] error: qapplication: no such file or directory solution
- 晚餐阿帮的手艺
- [matlab] basic operation of MATLAB image processing
- Coordinates of the capital of each province in China
- [leetcode] breadth first search level traversal general disassembly template
- [cloud native | kubernetes] actual combat of ingress case
- On permutation and combination in probability and statistics
- 【MATLAB】图像基本运算(点运算、算术运算、缩放、旋转)
- [matlab] basic image operation (point operation, arithmetic operation, scaling and rotation)
猜你喜欢

Polynomial multiplication

Well paid test development programmers, why are you leaving? Kill each other with products until the sky is dark

Task05: tree

A brief history of neural network

【音乐】基于matlab演奏《天空之城》【含Matlab源码 1874期】

SAP SMARTFORMS文本内容手动换行输出

2021-02-27image processing of MATLAB

字节北京23k和拼多多上海28K,我该怎么选?
![[leetcode] ordered linked list transformation binary search tree](/img/9f/86e819beb8dc678d79c3e307891402.jpg)
[leetcode] ordered linked list transformation binary search tree

Data and electricity course design: circuit of full adder / subtractor
随机推荐
[leetcode] delete duplicate Element II in the sorting linked list
A brief history of neural network
Sword finger offer II 095 Longest common subsequence dynamic programming
Derivation of Kalman filter (KF) and extended Kalman filter (EKF)
The problem of slow response of cs-3120 actuator during use
Introduction and practice of QT tcp/udp network protocol (II) UDP communication
爱思唯尔---Elseviewer---预印本在线发表通知
Video compression data set TVD
[leetcode] path sum II (first glimpse recursion + backtracking)
Thoughts on small steamed stuffed bun's dividend
ASEMI场效应管12N65参数,12N65规格书,12N65特征
Task01: be familiar with the basic process of news recommendation system
2021-07-18 ROS notes - basics and communication
视频压缩数据集TVD
Matlab array other common operation notes
Task02: basic use of database (MySQL)
【HaaS Hands-On】全新视频节目上线 创意案例我们一起上手做 第一期E01: 物联网工程师 和你一起上手做遥控机械臂
On permutation and combination in probability and statistics
[traffic sign recognition] Based on Matlab GUI YCbCr feature extraction +bp neural network traffic sign recognition [including Matlab source code 1869]
[matlab] image enhancement (power transformation, histogram specification processing method, smoothing and sharpening filtering)