CSS样式笔记

组合样式,CSS继承

复制代码
.content {
    padding:0 0 0 5px;
    line-height: 30px;
    height: 30px;
    border: 1px solid #a6bee7;
    vertical-align: middle;
}

/*不加空格,则表示class="content small"且small只有跟在content后面有效,否则无效
有效,如<div class="content small">则div的宽度是29.如果.content .small有空格,则表示,content的子元素的样式是small,子元素继承content的样式如<div class="content"><div class="small">*/
.content.small { width: 29%; }
.content.medium { width: 42.5%; }
.content.large { width: 92%; }
复制代码

 设置label标签样式,去掉每行都有边框

.disabled-label {
    width:90%;
    color:#cccccc;
    border: 1px solid #cccccc;
    display: inline-block;
}
 <asp:Label ID="Reason" runat="server" CssClass="disabled-label"></asp:Label>

 IE8下 Select文字垂直居中的办法

.select {
padding: 4px 0;
height: 30px;
line-height: 26px;
vertical-align: middle;
}

 让DIV内的li横向居中显示

复制代码
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
    <title></title>
    <style>
        .utop {
   
}

    .utop ul {
        display: table;
        margin-left: auto;
        margin-right: auto;
    }

        .utop ul li {
            float: left;
            text-decoration: none;
            border-style: none;
            list-style-type: none;
            padding:4px;
        }
    </style>
</head>
<body>
<div class="utop">
    <ul><li>sd</li><li>sd</li></ul>
</div>
</body>
</html>
复制代码

 

posted @   OFreedom  阅读(202)  评论(0)    收藏  举报
编辑推荐:
· 领域驱动设计实战:聚合根设计与领域模型实现
· 突破Excel百万数据导出瓶颈:全链路优化实战指南
· 如何把ASP.NET Core WebApi打造成Mcp Server
· Linux系列:如何用perf跟踪.NET程序的mmap泄露
· 日常问题排查-空闲一段时间再请求就超时
阅读排行:
· 在 .NET 中使用 Sqids 快速的为数字 ID 披上神秘短串,轻松隐藏敏感数字!
· c#开发完整的Socks5代理客户端与服务端——客户端(已完结)
· c# 批量注入示例代码
· 【Uber 面试真题】SQL :每个星期连续5星评价最多的司机
· .net core workflow流程定义
点击右上角即可分享
微信分享提示