100字范文,内容丰富有趣,生活中的好帮手!
100字范文 > Html+css怎样实现纯文字和带图标的按钮

Html+css怎样实现纯文字和带图标的按钮

时间:2023-05-23 20:45:26

相关推荐

Html+css怎样实现纯文字和带图标的按钮

Html+css怎样实现纯文字和带图标的按钮

Html+css怎样实现纯文字和带图标的按钮,Html+css实现纯文字和带图标的按钮的注意事项有哪些,下面就是实战案例,一起来看一下。

本文总结一下一些基础页面元素的实现方式,后续陆续更新。首先我们遇到最多的可能是按钮的切图,按钮可能有很多种外观,但是一般可分为纯文字的和带图标的按钮,下面就来说说这两种按钮的实现方法。

效果图:

<!doctype html><html lang="zh-CN"><head><meta charset="utf-8"><title>各类按钮的html实现(css)</title> <meta http-equiv="X-UA-Compatible" content="IE=Edge,chrome=1"> <style type="text/css">a:hover{text-decoration: none;}.btn{display: inline-block;margin-top: 10px;padding: 10px 24px;border-radius: 4px;background-color: #63b7ff;color: #fff;cursor: pointer;}.btn:hover{background-color: #99c6ff;}.inbtn{border: none;}.bubtn{border: none;}.btn{font-style: normal;}.bgbtn span{margin-left: 10px;padding-left: 20px;background: url(images/edit.png) left center no-repeat;}.bgbtn02 img{margin-bottom: -3px;margin-right: 10px;}</style></head><body> <!--<a>标签按钮--> <a href="" class="btn">a标签按钮</a> <!-- <input>标签按钮 --> <input class="inbtn btn" type="button" value="input标签按钮"/> <!-- <button>标签按钮 --> <button class="bubtn btn">button标签按钮</button> <!-- <i>等 任意标签按钮 --> <i class="ibtn btn">i标签按钮</i> <!-- 带背景图标按钮 --> <a href="" class="bgbtn btn"><span>带图标按钮</span></a> <!--带图标按钮--> <a href="" class="bgbtn02 btn"><img src="/image/poco/works/87//0906/14/15362156223287880_56337008_H1920.png" height="22" />带图标按钮</a> </body></html>

发现一个好工具,在线测试Html代码:/tiy/t.asp?f=html5_video_all

·

本内容不代表本网观点和政治立场,如有侵犯你的权益请联系我们处理。
网友评论
网友评论仅供其表达个人看法,并不表明网站立场。