如何在网页上仅应用按钮颜色单个按钮 [英] How to apply button color only single button on web page

查看:65
本文介绍了如何在网页上仅应用按钮颜色单个按钮的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

大家好,



我有一个小要求,我想用css添加按钮的颜色,但在我的网页上有这么多按钮,我的要求是将css应用于单个按钮而不影响网页上的其他按钮。请尽快帮助我



谢谢,

Naresh

Hi All,

I have a small requirement, I want to add color of the button using css, but in my web page so many button are there, My requirement is apply css to single button without affecting the other buttons on the webpage. Please help me asap

Thanks,
Naresh

推荐答案

喜欢这个
<button type="button" class="yourCssClassName">Click Me!</button>


您通常应该避免内联样式,只是为了保持演示文稿分离并将所有CSS保持在一起。如果此按钮绝对是唯一的,您可能希望比可重用的CSS类更具体,并通过ID引用它:

You should generally avoid inline styles, just to keep the presentation separate and keep all CSS together. If this button is definitely unique, you may want to be more specific than a reusable CSS class, and refer to it by ID:
<button type="button" id="UniqueButton">Click</button>



CSS:


CSS:

#UniqueButton { background-color: green; }


直接添加按钮样式的颜色和高度,宽度。
You directly add color and height, width in button style.


这篇关于如何在网页上仅应用按钮颜色单个按钮的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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