r-ahim's picture
Create 10 different style buttons using raw CSS & Tailwind CSS
820e3fd verified
/* Base styles for all buttons */
button {
transition: all 0.3s ease;
font-weight: 500;
padding: 0.75rem 1.5rem;
border-radius: 0.5rem;
cursor: pointer;
outline: none;
font-size: 1rem;
position: relative;
overflow: hidden;
text-transform: uppercase;
letter-spacing: 0.5px;
}
/* Button 1: Classic Elegance */
.btn-classic {
background-color: #4f46e5;
color: white;
border: none;
box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
}
.btn-classic:hover {
background-color: #4338ca;
transform: translateY(-2px);
box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
}
/* Button 2: Modern Gradient */
.btn-gradient {
background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
color: white;
border: none;
background-size: 200% auto;
}
.btn-gradient:hover {
background-position: right center;
transform: scale(1.05);
}
/* Button 3: 3D Effect */
.btn-3d {
background-color: #3b82f6;
color: white;
border: none;
box-shadow: 0 5px 0 #1d4ed8;
transform: translateY(0);
}
.btn-3d:active {
transform: translateY(5px);
box-shadow: none;
}
/* Button 4: Outline with Icon */
.btn-outline-icon {
background: transparent;
color: #3b82f6;
border: 2px solid #3b82f6;
display: flex;
align-items: center;
justify-content: center;
}
.btn-outline-icon:hover {
background-color: #3b82f6;
color: white;
}
/* Button 5: Animated Fill */
.btn-animated-fill {
background: linear-gradient(to right, white 50%, #10b981 50%);
background-size: 200% 100%;
background-position: right bottom;
color: #10b981;
border: 2px solid #10b981;
transition: all 0.5s ease-out;
}
.btn-animated-fill:hover {
background-position: left bottom;
color: white;
}
/* Button 6: Glass Morphism */
.btn-glass {
background: rgba(255, 255, 255, 0.2);
backdrop-filter: blur(10px);
border: 1px solid rgba(255, 255, 255, 0.3);
color: white;
text-shadow: 0 1px 1px rgba(0, 0, 0, 0.2);
background-color: rgba(99, 102, 241, 0.7);
}
.btn-glass:hover {
background-color: rgba(79, 70, 229, 0.8);
}
/* Button 7: Neumorphic */
.btn-neumorphic {
background: #e0e5ec;
border: none;
color: #4a5568;
box-shadow: 5px 5px 10px #b8b9be, -5px -5px 10px #ffffff;
}
.btn-neumorphic:active {
box-shadow: inset 5px 5px 10px #b8b9be, inset -5px -5px 10px #ffffff;
}
/* Button 8: Bounce Animation */
.btn-bounce {
background-color: #f59e0b;
color: white;
border: none;
animation: pulse 2s infinite;
}
@keyframes pulse {
0% { transform: scale(1); }
50% { transform: scale(1.05); }
100% { transform: scale(1); }
}
/* Button 9: Ripple Effect */
.btn-ripple {
background-color: #ef4444;
color: white;
border: none;
}
.btn-ripple:hover {
background-color: #dc2626;
}
/* Button 10: Social Media */
.btn-social {
background-color: #1da1f2;
color: white;
border: none;
display: flex;
align-items: center;
justify-content: center;
}
.btn-social:hover {
background-color: #1a8cd8;
}
/* Responsive adjustments */
@media (max-width: 768px) {
button {
padding: 0.5rem 1rem;
font-size: 0.875rem;
}
}