css记录收集

让一个块级元素在某区域内上下左右居中

<div class="container">
<div class="box"></div>
</div>

<style>
.container {
border: 1px solid #000;
width: 300px;
height: 300px;
position: relative;
}

.box {
border: 1px solid #000;
width: 50px;
height: 50px;

/* magic below */
position: absolute;
margin: auto;
left: 0;
right: 0;
top: 0;
bottom: 0;
/* magic end */
}
</style>

文字模糊效果

*{

color: transparent;
text-shadow: #111 0 0 5px;

}

实时编辑CSS

<html>

<body>
    <style style="display:block" contentEditable>
        body { color: blue }
    </style>
</body>

</html>

    原文作者:苏生不惑
    原文地址: https://segmentfault.com/a/1190000007680505
    本文转自网络文章,转载此文章仅为分享知识,如有侵权,请联系博主进行删除。
点赞