
Data Structure
Networking
RDBMS
Operating System
Java
MS Excel
iOS
HTML
CSS
Android
Python
C Programming
C++
C#
MongoDB
MySQL
Javascript
PHP
- Selected Reading
- UPSC IAS Exams Notes
- Developer's Best Practices
- Questions and Answers
- Effective Resume Writing
- HR Interview Questions
- Computer Glossary
- Who is Who
Found 1594 Articles for CSS

814 Views
You can try to run the following code to fade in on button hover with CSSExampleLive Demo .btn { background-color: orange; color: white; padding: 10px; text-align: center; font-size: 16px; margin: 5px; opacity: 0.5; transition: 0.5s; display: inline-block; text-decoration: none; cursor: pointer; } .btn:hover { opacity: 2 } Result

5K+ Views
To set the button width, use the CSS width property.ExampleYou can try to run the following code to set the width of a button −Live Demo .btn { background-color: yellow; color: black; width: 120px; text-align: center; font-size: 15px; padding: 20px; border-radius: 15px; border: 3px dashed blue; } Result Click below for result: Result

2K+ Views
Adding a pressed effect on button click with CSS makes the user feel more interactive with the web page. It provides an immediate visual effect indicating that the button press has been registered. It helps in improving the user experience. In this article, we have a button on our web page. Our task is to add a pressing effect while clicking the button. Approaches to Add a Pressed Effect on Button Here is a list of approaches to add a pressed effect on button click with CSS which we will be discussing in this article with stepwise explanation and complete ... Read More

81 Views
Set gap between Grid rows with CSS. You can try to run the following code to implement the grid-row-gap property.ExampleLive Demo .container { display: grid; background-color: green; grid-template-columns: auto auto; padding: 20px; grid-column-gap: 20px; grid-row-gap: 20px; } .ele { background-color: orange; border: 2px solid gray; padding: 35px; font-size: 30px; text-align: center; } Game Board 1 2 3 4 5 6

129 Views
Use the flex-wrap property with wrap value to wrap flex-items.ExampleYou can try to run the following code to implement the wrap value −Live Demo .mycontainer { display: flex; background-color: orange; flex-wrap: wrap; } .mycontainer > div { background-color: white; text-align: center; line-height: 40px; font-size: 25px; width: 100px; margin: 5px; } Quiz Q1 Q2 Q3 Q4 Q5 Q6 Q7 Q8 Q9

444 Views
You can try to run the following code to create a bordered button group with border propertyExampleLive Demo .btn { color: black; background-color: yellow; width: 120px; text-align: center; font-size: 15px; padding: 20px; float: left; border: 3px solid blue; } .mybtn { background-color: orange; } Result Click below for result: Result Result Result Result Result

15K+ Views
To set the speed of the hover effect with CSS, we will be using two different approaches. These approaches includes using CSS transition and CSS animation properties. We are having a button and a div element which changes the styles upon hovering on them. Our task is to set the speed of the hover effect with CSS. Approaches to Set the Speed of the Hover Effect with CSS Here is a list of approaches to set the speed of the hover effect with CSS which we will be discussing in this article with step-wise explaination and complete example codes. ... Read More

404 Views
Use the CSS :hover selector to create hoverable buttons. You can try to run the following code to create hoverable buttons:ExampleLive Demo .btn { background-color: yellow; color: black; text-align: center; font-size: 15px; padding: 20px; border-radius: 15px; border: 3px dashed blue; } .btn:hover { background-color: orange; color: black; border: 3px solid blue; } Result Click below for result: Result

950 Views
To add colored border, use the CSS border property.ExampleYou can try to run the following code to add a colored border.Live Demo .button { background-color: yellow; color: black; text-align: center; font-size: 15px; padding: 20px; border-radius: 15px; border: 3px dashed blue; } Result Click below for result: Result

225 Views
Use the flex-wrap property with nowrap value to avoid flex-items to wrap.ExampleYou can try to run the following code to implement the nowrap value −Live Demo .mycontainer { display: flex; background-color: orange; flex-wrap: nowrap; } .mycontainer > div { background-color: white; text-align: center; line-height: 40px; font-size: 25px; width: 100px; margin: 5px; } Quiz Q1 Q2 Q3 Q4 Q5 Q6 Q7 Q8 Q9