新手练习

一二三四五

<!DOCTYPE html>
<html>
<head>
    <meta charset="UTF-8">
    <title>浮动float</title>
    <style>
        *{
            padding: 0;
            margin: 0;
        }   	
        .abso{
            width: 450px;
            height: 279px;
            position: relative;
            margin: 0 auto 400px;
            border: 1px solid red;
            overflow: hidden;/*溢出处理*/
        }
        .abso:hover p{
            /* display: block; */
            bottom: 0;
        }
        .abso p{
            width: 100%;
            height: 50px;
            position: absolute;
            bottom: -50px;
            background-color: rgba(0,0,255,0.5);
            /* opacity: 0.5; */
            /* 不透明度 */
            transition: 1s;/*过渡*/
            /* display: none; */
        }
    </style>
</head>
<body>
    <div class="abso">
        <p>一二三四五</p>
    </div>
</body>
</html>
<!DOCTYPE html>
<html>
	<head>
		<meta charset="utf-8" />
		<title></title>
		<style type="text/css">					
			*{
				padding: 0;
				margin: 0;
			}
			li{
				list-style: none;
			}
			a{
				text-decoration: none;
			}			
			.nav{
            font-size: 0px;
        	}
        	.nav li{
            	display: inline-block;
            	vertical-align: top;
            	width: 100px;
            	height: 30px;
            	font-size: 16px;
            	background: #ccc;
            	text-align: center;
            	line-height: 30px;
        	}
			.subNav{
				display: none;				
			}
			.nav li:hover .subNav{
				display: block;			
			}
			.subNav li:hover{
				color: white;
				background: lightblue;
			}			
		</style>		
	</head>
	<body>
		<ul class="nav">
		<li>
			<a href="">首页</a>
			<ul class="subNav">
                <li>1111</li>
                <li>2222</li>
                <li>3333</li>
            </ul>
		</li>
        <li>
        	<a href="">新闻</a>      	
            <ul class="subNav">
                <li>1111</li>
                <li>2222</li>
                <li>3333</li>
            </ul>
        </li>
        <li>         	
           	<a href="">地图</a>
            <ul class="subNav">
                <li>1111</li>
                <li>2222</li>
                <li>3333</li>
            </ul>
        </li>			
		</ul>				
	</body>
</html>

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值