久久久久久久视色,久久电影免费精品,中文亚洲欧美乱码在线观看,在线免费播放AV片

<center id="vfaef"><input id="vfaef"><table id="vfaef"></table></input></center>

    <p id="vfaef"><kbd id="vfaef"></kbd></p>

    
    
    <pre id="vfaef"><u id="vfaef"></u></pre>

      <thead id="vfaef"><input id="vfaef"></input></thead>

    1. 站長資訊網
      最全最豐富的資訊網站

      css怎么實現鼠標選中文字后改變背景色

      css中可以使用“::selection”選擇器來實現鼠標選中文字后改變背景色效果,只需給文字元素E添加“E::selection{background: 背景色值;}”樣式即可。

      css怎么實現鼠標選中文字后改變背景色

      本教程操作環(huán)境:windows7系統(tǒng)、css3版本、Dell G3電腦。

      教程推薦:css視頻教程

      css實現鼠標選中文字后改變背景色

      css鼠標選中文字后改變背景色可以使用::selection選擇器。

      ::selection選擇器匹配元素中被用戶選中或處于高亮狀態(tài)的部分。::selection只可以應用于少數的CSS屬性:color、background、cursor和outline。

      代碼示例:

      <!DOCTYPE html> <html> 	<head> 		<meta charset="UTF-8"> 		<style type="text/css"> 			p { 				border: 1px solid red; 			} 			 			.color::-moz-selection { 				background: #93c; 				color: #fcf; 			} 			 			.color::selection { 				background: #93c; 				color: #fcf; 			} 		</style> 	</head>  	<body> 		<p>默認文本。測試文本!測試文本!測試文本!測試文本!測試文本!測試文本!測試文本!測試文本!測試文本!測試文本!</p> 		<p class="color">鼠標選中文字后改變背景色。測試文本!測試文本!測試文本!測試文本!測試文本!測試文本!測試文本!測試文本!測試文本!測試文本!</p> 	</body>  </html>

      效果圖:

      css怎么實現鼠標選中文字后改變背景色

      贊(0)
      分享到: 更多 (0)
      網站地圖   滬ICP備18035694號-2    滬公網安備31011702889846號