博客列表 >简单样式封装

简单样式封装

琥珀的博客
琥珀的博客原创
2019年10月09日 23:38:58682浏览

实例

<!DOCTYPE html>
<html lang="zh">
<head>
	<meta charset="UTF-8">
	<meta name="viewport" content="width=device-width, initial-scale=1.0">
	<meta http-equiv="X-UA-Compatible" content="ie=edge">
	<link rel="stylesheet" href="../static/js/highlight/styles/default.css">
	<title></title>
	<style>
		.lyh-w100{
			width:100px;			
		}
		.lyh-w200{
			width:200px;			
		}
		.lyh-h100{
			height:100px;
		}
		.lyh-h200{
			height:200px;
		}
		.lyh-bgc-red{
			background-color:red;
		}
		.lyh-bgc-green{
			background-color:green;
		}
		.lyh-border-r30{
			border-radius: 30%;
				}
		.lyh-border-r50{
			border-radius: 50%;
		}
		
	</style>
</head>
<body>
		<pre>
		<code class="html">
                &lt;!DOCTYPE html&gt;
                &lt;html&gt;
                &lt;head&gt;
                &lt;meta charset="UTF-8"&gt;
                &lt;meta name="viewport" content="width=device-width, initial-scale=1.0"&gt;
                &lt;meta http-equiv="X-UA-Compatible" content="ie=edge"&gt;
                &lt;title></title&gt;
                &lt;style>
                .lyh-w100{
                width:100px;
                }
                .lyh-w200{
                width:200px;
                }
                .lyh-h100{
                height:100px;
                }
                .lyh-h200{
                height:200px;
                }
                .lyh-bgc-red{
                background-color:red;
                }
                .lyh-bgc-green{
                background-color:green;
                }
                .lyh-border-r30{
                border-radius: 30%;
                }
                .lyh-border-r50{
                border-radius: 50%;
                }
                
                &lt;/style&gt;
                &lt;/head&gt;
                &lt;body&gt;
                    &lt;button class="lyh-w200 lyh-h50 lyh-bgc-green"&gt;
                通过
                &lt;/button&gt;
                &lt;button class="lyh-w100 lyh-h50 lyh-bgc-red"&gt;
                不通过
                &lt;/button&gt;
                &lt;/body&gt;
                &lt;/html&gt;
		</code>
		</pre>
	    <button class="lyh-w200 lyh-h50 lyh-bgc-green">通过</button>
		<button class="lyh-w100 lyh-h50 lyh-bgc-red">不通过</button>	
			<!--引入代码高亮插件-->
			<script src="../static/js/highlight/highlight.pack.js"></script>
			<!--初始化插件-->
			<script>hljs.initHighlightingOnLoad();</script>
</body>
</html>

运行实例 »

点击 "运行实例" 按钮查看在线实例

运行结果:

1111.jpg

声明:本文内容转载自脚本之家,由网友自发贡献,版权归原作者所有,如您发现涉嫌抄袭侵权,请联系admin@php.cn 核实处理。
全部评论
文明上网理性发言,请遵守新闻评论服务协议