html小案例

简介: html小案例

html简单菜单栏

<!DOCTYPE html>
<html lang="zh-CN">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <link rel="stylesheet" href="">
    <style>
        
        /* 简单菜单栏 */

        a {
            display: block;
            width: 230px;
            height: 40px;
            font-size: 16px;
            color: white;
            text-decoration: none;
            background-color: gray;
            text-indent: 2em;
            line-height: 40px;
        }

        a:hover {
            background-color: aqua;

        }

    </style>
</head>

<body>
    <a href="#">手机电脑</a>
    <a href="#">电视</a>
    <a href="#">笔记本</a>
    <a href="#">耳机</a>
    <a href="#">音响</a>
</body>

</html>

html轮播图布局

<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <style>
        
        * {
            margin: 0;
            padding: 0;
        }
        .box1 {
            position: absolute;
            top: 300px;
            width: 200px;
            height: 200px;
            background-color: pink;
        }
        .box2 {
            display: none;
            position: relative;
            width: 600px;
            height: 300px;
            background-color: skyblue;
        }

        .tb_promo {
            position: relative;
            width: 520px;
            height: 280px;
            background-color: blueviolet;
            margin:  100px auto;
        }

        .tb_promo img {
            width: 520px;
            height: 280px;
        }

        
        
        .tb_promo .prev,
        .tb_promo .next {
            position: absolute;
            top: 50%;
            margin-top: -15px;
            width: 20px;
            height: 30px;
            line-height: 30px;
            text-align: center;
            background-color: rgba(0, 0, 0, .5);
            text-decoration: none;
            color: #fff;
        }

        .tb_promo .prev {
            left: 0;
            border-top-right-radius: 15px;
            border-bottom-right-radius: 15px;
        }
        
        .tb_promo .next {
            right: 0;
            border-top-left-radius: 15px;
            border-bottom-left-radius: 15px;
        }

        .tb_promo .pro_nav {
            position:absolute;
            left: 50%;
            bottom: 15px;
            margin-left: -35px;
            width: 70px;
            height: 13px;
            background: rgba(255, 255, 255, .3);
            border-radius: 7px;
        }

        .pro_nav li {
            float: left;
            list-style: none;
            width: 8px;
            height: 8px;
            background-color: #fff;
            margin: 3px;
            border-radius: 50%;
        }



    </style>
</head>
<body>
    <div class="box2">
        <div class="box1"></div>
    </div>

    <div class="tb_promo">
        <img src="1000.png" alt="">
        <a href="#" class="prev">&lt;</a>
        <a href="#" class="next">&gt;</a>
        <ul class="pro_nav">
            <li></li>
            <li></li>
            <li></li>
            <li></li>
            <li></li>
        </ul>

    </div>
</body>
</html>

html小三角

<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <style>
        .box {
            width: 0;
            height: 0;
            border: 50px solid transparent;
            border-left: 50px solid pink;
        }

        .sanjiao {
            position: relative;
            width: 200px;
            height: 200px;
            background-color: antiquewhite;
        }

        span {
            position: absolute;
            /* border-width的两倍; */
            top: -20px;  
            right: 15px;
            width: 0;
            height: 0;
            font-size: 0;
            line-height: 0;
            border: 10px solid transparent;
            border-bottom-color: red;
        }

    </style>
</head>
<body>
    <div class="box"></div>
    <div class="sanjiao">
        <span></span>
    </div>
</body>
</html>
相关文章
|
6月前
|
前端开发 Python
HTML笔记+案例(上)
HTML笔记+案例
62 0
|
容器
layui框架实战案例(23):在layui-tab-content中layui-progress-bar在html拼接中不显示lay-percent的解决方案
layui框架实战案例(23):在layui-tab-content中layui-progress-bar在html拼接中不显示lay-percent的解决方案
341 0
|
5月前
杨老师课堂之网页制作HTML的学习入门-含有案例1
杨老师课堂之网页制作HTML的学习入门-含有案例
41 3
|
5月前
|
移动开发 HTML5
杨校老师课堂之HTML5动画特效的风车案例
杨校老师课堂之HTML5动画特效的风车案例
47 0
|
5月前
|
数据安全/隐私保护
杨老师课堂之网页制作HTML的学习入门-含有案例2
杨老师课堂之网页制作HTML的学习入门-含有案例
23 0
|
6月前
|
JavaScript
jQuery选择器案例之——index.html
jQuery选择器案例之——index.html
|
6月前
|
移动开发 HTML5
HTML5表格简单应用案例之[招聘需求表]
HTML5表格简单应用案例之[招聘需求表]
|
6月前
|
JavaScript 计算机视觉
纯js实现人脸识别眨眨眼张张嘴案例——index.html
纯js实现人脸识别眨眨眼张张嘴案例——index.html
|
6月前
|
Shell PHP
php案例:截取sy.66969.cn/sh.html中的sh怎么做?
php案例:截取sy.66969.cn/sh.html中的sh怎么做?
php案例:截取sy.66969.cn/sh.html中的sh怎么做?
|
6月前
|
移动开发 开发框架 Java
html一个案例学会所有常用HTML(H5)标签
html一个案例学会所有常用HTML(H5)标签
57 0