Design professional CSS buttons visually — no coding required. Adjust every style property in real time, pick from built-in presets, and copy the finished CSS and HTML with one click.
Presets Primary Secondary Outline Ghost Gradient 3D Pill Icon Button Button Text Colors Background Color Text Color Border Color Size & Typography Font Size 16px Padding H 20px Padding V 12px Border Radius 8px Border Border Width 0px Border Style Solid Dashed Dotted Double Box Shadow Shadow X 0px Shadow Y 4px Shadow Blur 14px Shadow Spread 0px Shadow Color Shadow Opacity 30% Hover Effects Hover Background Scale on Hover Hover Scale 1.05 Hover Shadow Transition Duration 300ms Live Preview Light Dark Click Me CSS HTML Copy How to Use the CSS Button Generator Choose a preset — start with Primary, Outline, Gradient, or any of the 8 presets. Adjust controls — tweak colors, size, border, shadow, and hover effects live. Toggle preview theme — check how the button looks on light and dark backgrounds. Copy CSS or HTML — switch tabs and click Copy to grab the finished code. Paste into your project — rename .my-button to match your class name. CSS Properties Explained Property What it does background-color Fill color of the button color Text color font-size Text size in pixels padding Inner spacing (vertical / horizontal) border-radius Corner roundness; 9999px = pill shape border Width, style, and color of the border box-shadow Drop or glow shadow with full offset control transition Animation speed for hover effects transform: scale() Scale-up effect on hover Preset Reference Primary — solid indigo fill, subtle shadow, standard border-radius Secondary — muted gray, minimal shadow Outline — transparent background, colored border and text Ghost — no border, no background; background appears on hover only Gradient — linear-gradient background with glow shadow and scale hover 3D — solid bottom shadow creates a raised, pressable look Pill — border-radius: 9999px for fully rounded ends Icon Button — compact square with equal padding, suitable for icon-only actions Tips for Accessible Buttons Maintain at least 4.5:1 contrast ratio between text and background. Never rely on color alone — add a visible focus ring with :focus-visible. Keep tap targets at least 44×44 px for mobile users. Use <button> for actions and <a> for navigation links. Related Free Tools CSS Box Shadow Generator — build and preview multi-layer shadows CSS Gradient Generator — linear, radial, and conic gradients with live preview CSS Animation Generator — keyframe animations with timing and easing controls