work5

 1 实现“回到顶部”功能
    参考思路:设置元素高度使得界面出现滚动条

         使用固定定位在界面右下角显示回到顶部div

         div里面可以使用a标签实现超链接锚点(参考锚点代码)

2. 实现 带图标的输入框效果:如下图:

   3779d4b810a38f4e5f44412e223bb1cfcd4.jpg

 

图标:推荐到阿里的图标库 http://www.iconfont.cn/去下载

可以将图标设置为 input框的背景图片

background:url(图标的文件名) no repeat;

然后 根据图标的大小可以调整input的高度

最后 设置input的 padding-left 让输入的字,向右偏移

     最后 good luck!

 

<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8" />
    <title>作业</title>
</head>
<body>
    <style type="text/css">
        .c2{
            width: 35px;
            height: 40px;
            background: #000000;
            position: fixed; 
            right : 50px; 
            bottom: 50px; 
            text-decoration: none;
            color: #ffffff;
        }
        .b1{
            background-image: url( 'user.jpg ') ;
            background-repeat: no-repeat;
            height: 48px;
            font-size: 44px;
            color: #0000ff;
            position: absolute;
            padding-left: 70px;
        }
    </style>

    <p id="p1"></p>
   
    <form align="center" style="position: absolute;">
        <input class="b1" type="text"/>
    </form>


    <table>
        <tr>
            <td height="5000px"></td>
        </tr>
    </table>

    <a href="#p1" class="c2">回到顶部</a>
</body>
</html>

 

转载于:https://my.oschina.net/1824375992/blog/2244785

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值