纯CSS按钮 [英] Pure CSS Buttons

查看:111
本文介绍了纯CSS按钮的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

任何人都可以给我看一些在css中制作按钮并且不需要图片的教程吗?我搜索了它,但一切都涉及到图像...



谢谢! 解决方案

如果我正确理解你,你想让一个任意元素看起来像一个按钮?



呃... 相应地写CSS !这里有一个启动的例子,它使链接看起来像一个按钮:

 <!DOCTYPE html> 
< html lang =en>
< head>
< title> SO问题3489881< / title>
< style>
a.button {
display:inline-block;
padding:0 2px;
背景:lightgray;
border:2px开头lightgray;
cursor:default;
}
a.button:active {
border-style:inset;
}
< / style>
< / head>
< body>
< p>< a class =button>连结< / a>
< / body>
< / html>


Could anyone show me some tutorials that make a button in css and doesn't require images? I googled it but everything involved images...

Thanks!

解决方案

If I understand you correctly, you want to make an arbitrary element look like a button?

Well ... just write CSS accordingly! Here's a kickoff example which makes a link look like a button:

<!DOCTYPE html>
<html lang="en">
    <head>
        <title>SO question 3489881</title>
        <style>
            a.button {
                display: inline-block;
                padding: 0 2px;
                background: lightgray;
                border: 2px outset lightgray;
                cursor: default;
            }
            a.button:active {
                border-style: inset;
            }
        </style>
    </head>
    <body>
        <p><a class="button">link</a>
    </body>
</html>

这篇关于纯CSS按钮的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆