css CSS仅警告标志

Posted

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了css CSS仅警告标志相关的知识,希望对你有一定的参考价值。

{"view":"split","fontsize":"100","seethrough":"","prefixfree":"1","page":"result"}
// alert('Hello world!');
<span class="⚠"></span>
@charset "UTF-8"
@import url(http://fonts.googleapis.com/css?family=Droid+Sans|Droid+Sans+Mono);

/** 
 * CSS Only Warning Sign
 * 
 * In an attempt to create this effect utilizing the Unicode "Warning Sign" character
 * I quickly ran into trouble trying to get things cross-browser compatible. Something
 * else that bothered me was the fact that there was no way to change the look of the
 * sign, as that was implemented in the used font. In this attempt, the exclamation mark
 * is an actual exclamation mark and the sign effect is created by positioning two 
 * CSS-border-triangles over eachother, a smaller one over a larger one.
 *
 * If you hover over the sign, the outline of each individual component will light up.
 *
 * @see: http://dabblet.com/gist/6981659
 */
.⚠ {
    position: relative; /* So we can position the content as absolute */

    /* Using the borders to create a triangle  */
    border-left: 1em solid transparent;
    border-right: 1em solid transparent;
    border-bottom: 1.732em solid black;

    top: -1em;          /* Correction because of the CSS Triangle trick*/
}
    .⚠::before {
    	position: absolute;
    	content: " ";
	    /* Using the borders to create a triangle  */
	    border-left: 0.8em solid transparent;
	    border-right: 0.8em solid transparent;
	    border-bottom: 1.4722em solid yellow;
	    top: 1.275em;
	    left: -0.8em;
    }
    .⚠::after {
        content: "!";
        position: absolute;
        
        /* 	Position the character over the triangle
         *	These values depend very much on the font used. 
         */
		font-family: "Droid Sans";        
        top: 0.87em; /* top of the yellow triangle */
        left: -0.54em;

        font-size: 1.4722em;
        color: black;
        height: 0.99em;
        width: 1.077em;
    }
    
    
/* Additional style to show how its done */
	.⚠:hover {
		outline: 1px solid;
    	transform: skew(-20deg, -10deg);
    	border-left-color: rgba(0, 0, 0, 0.5);
    	border-right-color: rgba(0, 0, 0, 0.5);
	}
	
    .⚠:hover::before {
		outline: 1px solid yellow;
    	border-left-color: rgba(255, 255, 0, 0.5);
    	border-right-color: rgba(255, 255, 0, 0.5);
	}
	
    .⚠:hover::after {
		outline: 1px solid;
	}
	

/* Additional style to tart up the page */
html {
	display: table;
	width: 100%;
	min-height: 80%;
}
body {
 	display: table-cell;
	vertical-align: middle;
    background: rgb(205,205,0);
    background: linear-gradient(90deg, rgb(125,125,0), rgb(205,205,0));
    min-height: 80%;
    text-align: center;
}

span {
	font-size: 1000%;
}

/*EOF*/

以上是关于css CSS仅警告标志的主要内容,如果未能解决你的问题,请参考以下文章

css CSS仅警告标志

Instagram 新标志 css 背景

CSS3标志动画?

Css3之基础-10 Css列表(列表项标志 列表项图像列表项位置列表属性)

添加自定义css后我的标志消失了,如何解决?

CSS动画/过渡旋转标志(步骤)