Click here to Skip to main content
15,887,596 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
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
Posted

Like this
HTML
<button type="button" class="yourCssClassName">Click Me!</button>
 
Share this answer
 
v2
Comments
Rockstar_ 24-Apr-13 3:10am    
yes..
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:
HTML
<button type="button" id="UniqueButton">Click</button>

CSS:
CSS
#UniqueButton { background-color: green; }
 
Share this answer
 
v2
You directly add color and height, width in button style.
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900