好得很程序员自学网

<tfoot draggable='sEl'></tfoot>

第一个CSS变量:currentColor_html/css_WEB-ITnose

一、基本介绍

CSS变量正慢慢地从最初的草案到浏览器实现。但规范中有个已经存在多年的变量:currentColor。这个CSS特性具有良好的浏览器支持和一些实际的应用,本篇文章,我们来学习和了解它。 引用MDN中的描述:

The currentColor keyword represents the calculated value of the element's color property. It allows to make the color properties inherited by properties or child's element properties that do not inherit it by default. It can also be used on properties that inherit the calculated value of the element's color property and will be equivalent to the inherit keyword on these elements, if any.

我们知道如果你不指定border-color的值,它会默认填充color的值:

	 	.parent{ 		width: 100px;		height: 100px; 		color: red;		border: 1px solid;		box-shadow: 5px 5px 5px;		text-shadow: 3px 3px 3px;	}	 	

没有设置边框颜色

查看更多关于第一个CSS变量:currentColor_html/css_WEB-ITnose的详细内容...

  阅读:38次