Home  >  Article  >  Web Front-end  >  Summary of how to use pseudo elements in css (code)

Summary of how to use pseudo elements in css (code)

不言
不言Original
2018-08-24 11:55:081237browse

This article brings you a summary (code) of how to use pseudo elements in CSS. It has certain reference value. Friends in need can refer to it. I hope it will be helpful to you.

Set the first letter of the text to a special letter



	
		 
		自学教程(如约智惠.com) 
		
	

你可以使用"first-letter"伪元素向文本的首字母设置特殊样式;

Set the first line of text to a special letter



	
		 
		自学教程(如约智惠.com) 
		
	

你可以使用"first-letter"伪元素向文本的首字母设置特殊样式;

Set the first letter of the first line of text to special



	
		 
		自学教程(如约智惠.com) 
		
	

你可以结合使用"first-line"和"first-letter"伪元素向文本的首行和首字母设置特殊样式。

Use: Insert some content before an element



	
		 
		自学教程(如约智惠.com) 
		
	

This is a heading

The :before pseudo-element inserts content before an element.

This is a heading

注意:仅当 !DOCTYPE 已经声明 IE8 支持这个内容属性

Usage: Insert some content after an element



	
		 
		自学教程(如约智惠.com) 
		
	

This is a heading

The :before pseudo-element inserts content before an element.

This is a heading

注意:仅当 !DOCTYPE 已经声明 IE8 支持这个内容属性

Related recommendations:

css pseudo-class, pseudo-element_html/css_WEB-ITnose

CSS pseudo-class pseudo-element_html/css_WEB-ITnose

The above is the detailed content of Summary of how to use pseudo elements in css (code). For more information, please follow other related articles on the PHP Chinese website!

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn