CSS练习实例

<!DOCTYPE html>



<!--[if IE 9 ]><html class="ie9"><![endif]-->



<head>
    <!-- bootstrap是一个响应式布局,分辨率做自适应 
        initial-scale=1  缩放比例,完全不缩放
    -->
    <meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0" />

    <meta name="format-detection" content="telephone=no">


    <meta charset="UTF-8">


    <meta name="description" content="Violate Responsive Admin Template">

    <meta name="keywords" content="Super Admin, Admin, Template, Bootstrap">

    <link rel="stylesheet" href="bootstrap.min.css">
    <link href="./bootstrap-editable.css" rel="stylesheet">
    <link href="./bootstrap-table.css" rel="stylesheet">
    <script src="jquery.min.js"></script>
    <script src="bootstrap.min.js"></script>

    <script src="./bootstrap-editable.js"></script>
    <script type="text/javascript" src="./bootstrap-table.min.js"></script>
    <script type="text/javascript" src="./bootstrap-table-zh-CN.min.js"></script>
    <script src="./bootstrap-table-editable.js"></script>



    <script>
        window.sessionStorage.setItem("rwid", "login_token");
        var a = window.sessionStorage.getItem("rwid");
    </script>
    <style>
        p[text-value] {
            /* 含有text-value属性的p标签 */
            color: red;
        }

        p[text-value~='1'] {
            /* 含有text-value属性求,且值含有'1'单词的p标签 */
            color: green;
        }

        p[text-value='123'] {
            /* 选择带有text-value属性且等于'123'的p标签 */
            color: blue;
        }

        :link {
            /* 选择所有未访问过得连接 */
            /* background-color: wheat; */
        }

        a:active {
            /* 选择活动链接 */
            /* color: red; */
        }

        p:hover {
            /* 鼠标掠过标签会触发 */
            color: seagreen;
        }

        p:first-letter {
            color: black;
        }

        #donghua {
            width: 200px;
            height: 200px;
            background-color: red;

        }

        @-webkit-keyframes mymove {
            100% {
                background: blue bottom right/50px 50px;
            }
        }

        #tishi {
            background-color: #ddffff !important;
            padding: 18px;

            border-left: 6px solid blue !important;

            /* solid实线    dotted点状  double双线  dashed虚线 */
            /* background-color: #ddffff !important;
            padding: 14px;
            border-left: 6px solid #ccc !important;
                border-left-color: rgb(204, 204, 204);
            border-color: #2196F3 !important; */
        }

        #yuanjiao {
            border-radius: 16px;
            border: solid black 1px;
            padding: 17px;
        }

        #threed {
            border: 5px groove #98bf21;
            padding: 18px;
        }

        #threed2 {
            border: ridge 5px blueviolet;
            padding: 18px;
        }

        #bottom {
            position: fixed;
            bottom: 0px;
            padding: 18px;
            border: cadetblue 5px solid;
            width: 100%;
        }

        #niantie {
            position: -webkit-sticky;
            position: sticky;
            top: 0;
            padding: 18px;
            border: cadetblue 5px solid;
            width: 100%;
        }

        label>i:first-child {
            color: blue;
        }

        label::first-letter {
            /* ::first-letter实现对文本的首个字符获取 */
            color: #ff0000;
            font-size: xx-large;
        }

        label::before {
            content: 'lable前插入的内容';
        }

        label::after {
            content: 'lable后插入的内容';
        }

        .main {
            height: 1800px;
        }
        .daohang{
            list-style: none;
            width: 200px;
            background:#f1f1f1;
            padding: 0px;
            margin:0px
        }
        .daohang li{
            color: #000;
            padding: 8px 16px;
            text-decoration: none;
        }
        .daohang li a{
            color: #000;
            padding: 8px 16px;
            text-decoration: none;
        }
        .daohang li:hover{
            background-color: #555;
            color: white;
        }
        .tip{
            float: left;
        }
        .tipshow{
            visibility: hidden;
            width: 120px;
            background-color: black;
            color: #fff;
            text-align: center;
            border-radius: 6px;
            padding: 5px 0;

            /* 定位 */
            position: absolute;
            z-index: 1;
        }
        .tip:hover .tipshow{
            visibility: visible;
        }
        .username1{
            width: 100%;
            padding: 12px 20px;
            margin: 8px 0;
            box-sizing: border-box;
            border: none;
            border-bottom: 2px solid rgb(92, 233, 92);
        }
        .password1{
            width: 100%;
            padding: 12px 20px;
            margin: 8px 0;
            box-sizing: border-box;
            border: none;
            border-bottom: 2px solid rgb(92, 233, 92);
        }
        .username2{
            width: 100%;
            padding: 12px 20px;
            margin: 8px 0;
            box-sizing: border-box;
            border: 2px solid slategrey;
            border-radius: 4px;
        }
        .password2{
            width: 100%;
            padding: 12px 20px;
            margin: 8px 0;
            box-sizing: border-box;
            border: 2px solid slategrey;
            border-radius: 4px;
        }
    </style>
</head>

<body id="skin-blur-violate">
    <title>CSS</title>
    <div id="niantie">
        黏贴定位 position: -webkit-sticky; position: sticky;
    </div>
    <div class="main">
        <button onclick="go_up()">向上</button>
        <button onclick="go_down()">向下</button>
        <button onclick="go_left()">向左</button>
        <button onclick="go_right()">向右</button>
        <h3>选择器</h3>
        <p text-value>p[text-value]选择带有text-value属性的p标签</p>
        <p text-value="1 34">p[text-value~='1']选择带有text-value属性值含有'1'单词的p标签</p>
        <p text-value="123">p[text-value='123']选择带有text-value属性且等于'123'的p标签</p>
        <a href="#">测试</a>
        <a href="#">测试</a>

        <hr>
        <h3>动画</h3>
        <div id="donghua">
        </div>
        <hr>

        <div id="tishi">
            div提示框效果
        </div>
        <div id="yuanjiao">
            div曲线边框效果 border-radius
        </div>
        <div id="threed">
            div3d曲线边槽效果 groove
        </div>
        <div id="threed2">
            div3d脊边框 ridge
        </div>

        <hr>
        <label>标签<i>标签</i>1</label>
        <label>标签2</label>
        <label>标签3</label>
        <hr>

        <ul class="daohang">
            <li><a href="#home">主页</a></li>
            <li><a href="#news">新闻</a></li>
            <li><a href="#contact">联系</a></li>
            <li><a href="#about">关于</a></li>
        </ul>
        <div class="tip">鼠标移动到此
            <span class="tipshow">让你移动你就移动啊,你咋这听话呢</span>
        </div>
        <hr>
        <div style="width: 50%; float: left;padding: 40px;">
            <form action="">
                <input class="username2" type="text" placeholder="请输入用户名">
                <input class="password2" type="password" placeholder="请输入密码">
            </form>
        </div>
        <div style="width: 50%; float: left;padding: 40px;">
            <form action="">
                <input class="username1" type="text" placeholder="请输入用户名">
                <input class="password1" type="password" placeholder="请输入密码">
            </form>
        </div>
        <div>
            
        </div>
    </div>
    <div id="bottom">
        底部说明部分
    </div>

</body>
<script src="http://pv.sohu.com/cityjson?ie=utf-8"></script>
<script src="./adapter_core.js"></script>
<script>
    function go_up() {
        $("#donghua").css("-webkit-animation:", "mymove 5s forwards");
    }

    function go_down() {

    }

    function go_left() {

    }

    function go_right() {

    }
</script>

</html>

在这里插入图片描述
在这里插入图片描述

  • 1
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值