Online CSS Design Tools
Online CSS Design Tools
A collection of free online visual tools for web design and CSS. All generators produce ready-to-use CSS code that you can copy and paste into your project with one click. Adjust colors, gradients, shadows, border radius, and filters in real time with a live preview.
txtly.ru CSS tools are built for web designers, frontend developers, and anyone who works with the visual styling of websites. Each tool replaces manual value tweaking in code with an interactive visual editor, saving time and eliminating errors.
Check out other tool categories: text tools, converters, and generators.
Why Choose txtly.ru CSS Tools
- Free and no registration β no hidden fees, subscriptions, or usage limits
- Live preview β all changes appear instantly; no need to refresh the page or switch between editor and browser
- Production-ready CSS β every generator outputs ready-to-use CSS for your project
- One-click copy β results are copied to your clipboard with a single button click
- Responsive design β tools work equally well on desktop, tablet, and smartphone
- Precision β values are output with pixel-level accuracy; all modern CSS properties are supported
How to Use These Tools
- Pick a tool from the list below or via the navigation menu
- Adjust the parameters β move sliders, pick colors, change values
- Watch the preview β results are visible instantly, in real time
- Copy the CSS code β and paste it into your project
Color Picker
What It Is
The Color Picker is an interactive tool for selecting, analyzing, and converting colors between HEX, RGB, and HSL formats. Unlike your operating system's color picker, the txtly.ru tool provides a full color wheel, manual value entry, and the ability to save a palette of multiple colors.
Color Theory
Understanding color models helps you work with color intentionally:
- HEX β hexadecimal representation: `#RRGGBB`, where each pair (00βFF) specifies the intensity of the red, green, and blue channels. Example: `#FF5733` β a vibrant orange-red. This is the most common format in CSS.
- RGB β explicit three-channel specification in decimal: `rgb(255, 87, 51)`. Each channel ranges from 0 to 255. Modern syntax also supports the comma-free form: `rgb(255 87 51)`.
- RGBA β RGB with an alpha (transparency) channel: `rgba(255, 87, 51, 0.5)`, where 0 is fully transparent and 1 is fully opaque.
- HSL β Hue (0β360Β°), Saturation (0β100%), Lightness (0β100%): `hsl(12, 100%, 60%)`. More intuitive for human color perception β ideal for creating tints, shades, and harmonious color schemes.
- HSLA β HSL with an alpha channel: `hsla(12, 100%, 60%, 0.5)`.
Color Accessibility
An important aspect of working with color is the contrast ratio between text and background. The WCAG (Web Content Accessibility Guidelines) standard sets minimum requirements:
| Level | Normal text | Large text (18px+) |
|---|---|---|
| AA (minimum) | 4.5:1 | 3:1 |
| AAA (enhanced) | 7:1 | 4.5:1 |
White text (`#FFFFFF`) on an orange background (`#FF5733`) has a contrast ratio of about 3.2:1 β insufficient for normal text. Black text (`#000000`) on the same background has about 6.5:1, which passes level AA.
When choosing colors for an interface, always check contrast, especially for text, buttons, and form elements.
When to Use
- Interface design β selecting primary and accent colors for a website or application
- Brand colors β precisely determining the HEX code of a brand color from a logo or mockup
- Palette creation β saving multiple harmonious colors for later use in a project
- Format conversion β converting a color from HEX to RGB (for JavaScript/Canvas) or to HSL (for programmatic shade adjustments)
- Light/dark theme β creating color variants for light and dark interface themes using HSL (adjusting Lightness)
Example: Picking a Color
Problem: find a pleasant blue color for website buttons in HEX, RGB, and HSL.
Solution:
- Using the color wheel, select hue 210Β° (blue)
- Saturation 80% β vibrant but not acidic
- Lightness 55% β comfortable for the eyes, not too dark
- Result: `#1E88E5`, `rgb(30, 136, 229)`, `hsl(210, 80%, 51%)`
Frequently Asked Questions (FAQ)
Which format is best to use in CSS? HEX β the most compact and widely used, ideal for static values. RGB/RGBA β when transparency is needed. HSL β when you need to programmatically adjust hue, saturation, or lightness (e.g., on hover: `hsl(210, 80%, 55%) β hsl(210, 80%, 45%)`). Modern CSS also supports `color(display-p3 ...)` for wider gamut, but browser support is still incomplete.
Why does the same color look different on different screens? Due to differences in color gamut and monitor calibration. Professional designers use calibrated monitors, but for the web it's reasonable to target sRGB β the standard color space supported by all browsers and most devices.
What are "web-safe" colors? In the era of 256-color monitors, there was a palette of 216 "safe" colors that displayed identically on all devices. Today, this concept is obsolete: modern screens display millions of colors. You can use any HEX value without concern.
CSS Gradient Generator
What It Is
The CSS Gradient Generator is a visual tool for creating smooth color transitions using the CSS `background-image: linear-gradient()`, `radial-gradient()`, or `conic-gradient()` properties. All parameters β colors, angles, stops β are configured through a visual interface, and the output is ready-to-use CSS code.
Gradients are a powerful tool in modern web design, enabling depth, dimension, and visual interest without using raster images.
Gradient Types
Linear Gradient: Colors transition along a straight line. Specify an angle or a direction keyword.
/* At 135Β° angle (bottom-left to top-right) */
background: linear-gradient(135deg, #667eea, #764ba2);
/* Left to right */
background: linear-gradient(to right, #ff758c, #ff7eb3);
Radial Gradient: Colors radiate from the center outward in a circle or ellipse. You can define the shape, size, and center position.
/* Circular gradient from the center */
background: radial-gradient(circle, #667eea, #764ba2);
/* Elliptical, center offset to top-left */
background: radial-gradient(ellipse at top left, #ff758c, #ff7eb3);
/* With size keywords: closest-side, farthest-corner, etc. */
background: radial-gradient(circle closest-corner at 50% 50%, #667eea, #764ba2);
Conic Gradient: Colors are distributed around a center point in a circular pattern β like a clock face or a pie chart.
/* Conic gradient starting from 0Β° */
background: conic-gradient(#667eea, #764ba2, #667eea);
/* With a specified starting angle */
background: conic-gradient(from 90deg, #ff758c, #ff7eb3, #ff758c);
/* Centered in the element */
background: conic-gradient(at 50% 50%, #667eea, #764ba2, #667eea);
Color Stops
A color stop defines the point in the gradient where a specific color appears. You can specify the position as a percentage or pixel value:
/* Three stops: red at 0%, yellow at 50%, blue at 100% */
background: linear-gradient(to right, red 0%, yellow 50%, blue 100%);
/* Hard boundary between colors (stops at the same position) */
background: linear-gradient(to right, red 50%, blue 50%);
/* Multiple stops for complex effects */
background: linear-gradient(135deg, #667eea 0%, #764ba2 30%, #f093fb 70%, #f5576c 100%);
Practical Applications
- Section backgrounds β a modern alternative to solid colors and background images. Gradients don't increase page size, unlike images.
- Buttons β gradient buttons look more dimensional and attractive than flat ones. Example: `linear-gradient(to right, #667eea, #764ba2)`.
- Image overlays β a semi-transparent gradient over a background image improves text readability: `linear-gradient(rgba(0,0,0,0.5), rgba(0,0,0,0.1))`.
- Section dividers β smooth transitions between page sections using gradients with transparency.
- Skeleton screens (loading) β animated gradients create a shimmer effect during content loading.
Frequently Asked Questions (FAQ)
Are gradients supported in all browsers? CSS gradients are supported in all modern browsers without prefixes, starting from Chrome 26+, Firefox 16+, Safari 6.1+, Edge 12+. Conic gradients (`conic-gradient`) have slightly later support (Chrome 69+, Safari 12.1+), and IE11 doesn't support them at all. For older browsers, specify a fallback solid color: `background: #667eea; background: linear-gradient(...)`.
Can gradients be animated with CSS? You can't directly animate gradients β the `background-image` property doesn't support `transition`. However, you can use a pseudo-element with a gradient and animate its `opacity`, or use `@keyframes` with `background-position` on an oversized background. A modern approach is registering a custom property via `@property` and animating color stops.
How many color stops can I use? Technically, there's no limit β you can specify any number of stops. Practically, 2β4 colors are sufficient for most design tasks. More than 5 stops usually create an overly busy effect unless it's a deliberate artistic choice.
What's the advantage of gradients over images? Gradients don't require additional file downloads, scale without quality loss at any resolution, can be easily changed via CSS custom properties, and support animation. Plus, they add zero bytes to page load.
CSS Shadow Generator (Box Shadow)
What It Is
The CSS Shadow Generator is a visual tool for creating `box-shadow` properties with a live preview. Shadows add depth to elements, make them stand out on the page, and are a key element of modern UI design β especially in the Material Design philosophy.
Box Shadow Parameters
The `box-shadow` property accepts up to six parameters:
box-shadow: offset-x offset-y blur spread color inset;
| Parameter | Description | Example |
|---|---|---|
| offset-x | Horizontal offset. Positive β right, negative β left | `5px`, `-10px` |
| offset-y | Vertical offset. Positive β down, negative β up | `5px`, `-3px` |
| blur | Blur radius. 0 β sharp shadow, higher β softer edges | `10px` |
| spread | Spread radius. Positive β shadow larger than element, negative β smaller | `0`, `5px`, `-2px` |
| color | Shadow color in any CSS format. Usually with transparency | `rgba(0,0,0,0.2)` |
| inset | Keyword β shadow inside the element (pressed effect) | `inset` |
Multiple Shadows
You can specify multiple shadows separated by commas for complex effects:
/* Dual shadow: near + far for a realistic effect */
box-shadow:
0 1px 3px rgba(0, 0, 0, 0.12),
0 1px 2px rgba(0, 0, 0, 0.24);
Material Design Shadow Levels
Google's Material Design defines standard elevation levels, each with a corresponding shadow:
| Elevation | Shadow | Usage |
|---|---|---|
| 1 dp | `0 1px 3px rgba(0,0,0,0.12), 0 1px 2px rgba(0,0,0,0.24)` | Cards, buttons (default state) |
| 3 dp | `0 3px 6px rgba(0,0,0,0.16), 0 3px 6px rgba(0,0,0,0.23)` | Buttons (hover) |
| 6 dp | `0 6px 10px rgba(0,0,0,0.16), 0 6px 10px rgba(0,0,0,0.23)` | FAB, dropdown menu |
| 8 dp | `0 8px 17px rgba(0,0,0,0.16), 0 8px 17px rgba(0,0,0,0.23)` | Navbar, side panel |
| 12 dp | `0 12px 28px rgba(0,0,0,0.19), 0 12px 28px rgba(0,0,0,0.23)` | Modal windows, dialogs |
To simulate a top-front light source (the standard Material Design approach), offset-y should always be larger than offset-x (the shadow falls downward, not directly beneath the element).
When to Use
- Cards β a light shadow (`0 2px 4px`) lifts the card above the background
- Buttons β shadows create a clickable appearance; in the `:active` state, use a smaller shadow or `inset` for a pressed effect
- Modals β a deep shadow darkens the backdrop and highlights the modal window
- Navigation β a shadow beneath the navbar visually separates it from the content
- Hover/focus states β increasing the shadow on hover provides interactive feedback
- Neumorphism β combining light and dark shadows creates a soft 3D effect
Example: Neumorphic Button
/* Neumorphism: light shadow top-left, dark shadow bottom-right */
box-shadow:
8px 8px 16px rgba(0, 0, 0, 0.1),
-8px -8px 16px rgba(255, 255, 255, 0.8);
Frequently Asked Questions (FAQ)
Can box-shadow be used to create borders? Yes, a shadow with no blur or offset and a positive spread creates a border-like effect: `box-shadow: 0 0 0 2px #667eea` β a 2px blue "border". Unlike `border`, the shadow doesn't affect the element's dimensions or shift neighboring elements.
Does box-shadow affect performance? Shadows with large blur values (50px+) can cause performance issues during animation or scrolling on low-end devices, as the browser needs to repaint a significant area. Use `will-change: box-shadow` to optimize animated shadows, but don't overuse it.
How is box-shadow different from filter: drop-shadow()? `box-shadow` follows the shape of the element's bounding box (a rectangle). `filter: drop-shadow()` is applied to the visible pixels of the element and works with transparency β for PNG images with transparent backgrounds, the shadow will follow the contour of the object, not the rectangle.
Border Radius Generator
What It Is
The Border Radius Generator is a visual tool for creating rounded corners with individual control over each of the four corners. The `border-radius` property is one of the most frequently used in modern web design, transforming rectangular blocks into rounded cards, pill-shaped buttons, and even circles.
Border Radius Syntax
Shorthand notation:
/* All 4 corners β same radius */
border-radius: 10px;
/* top-left/bottom-right and top-right/bottom-left pairs */
border-radius: 10px 20px;
/* top-left, top-right/bottom-left, bottom-right */
border-radius: 10px 20px 30px;
/* Each corner individually: top-left, top-right, bottom-right, bottom-left */
border-radius: 10px 20px 30px 40px;
Longhand notation β individual corner control:
border-top-left-radius: 10px;
border-top-right-radius: 20px;
border-bottom-right-radius: 30px;
border-bottom-left-radius: 40px;
Elliptical rounding (two values separated by `/`):
/* Horizontal radius / Vertical radius */
border-radius: 20px / 40px;
/* Different horizontal and vertical radii for each corner */
border-radius: 10px 20px 30px 40px / 5px 15px 25px 35px;
Popular Presets
| Preset | Value | Effect |
|---|---|---|
| Pill | `border-radius: 9999px` | Fully rounded edges β a pill-shaped button |
| Circle | `border-radius: 50%` | A circular element (requires a square container) |
| Modern card | `border-radius: 12px` | Standard for cards in modern UI |
| Slightly rounded | `border-radius: 4px` | Subtle rounding for a more formal design |
| Teardrop | `border-radius: 50% 0 50% 50%` | Teardrop or pointer shape |
| Leaf | `border-radius: 50% 0` | Rounded on one side only |
When to Use
- Buttons β rounded buttons look friendlier and more modern than rectangular ones. Pills (`border-radius: 9999px`) are a trend in recent UI design (macOS Big Sur+, Tailwind UI, shadcn/ui)
- Cards β rounding of 8β16px gives cards a soft feel. The larger the radius, the more "playful" the design
- Avatars β `border-radius: 50%` creates circular avatars (the image must be square)
- Input fields β rounded inputs (4β8px) look cleaner than rectangular ones
- Images β rounding image corners makes them visually softer and blends them more organically into the design
- Modals β rounded corners (12β16px) give modal windows a modern appearance
Example: Product Card
.product-card {
border-radius: 16px;
overflow: hidden; /* important: clips content to the rounded boundary */
box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}
.product-card img {
border-radius: 16px 16px 0 0; /* rounding only on the top */
}
Frequently Asked Questions (FAQ)
In what order are values specified in the shorthand? Clockwise, starting from the top-left corner: `top-left`, `top-right`, `bottom-right`, `bottom-left`. This is the standard order for all CSS directional properties (margin, padding, border-radius).
Why is border-radius: 9999px better than border-radius: 50%? For pill-shaped buttons, `border-radius: 50%` creates elliptical rounding if the button is not square (width β height), whereas `9999px` is a value large enough to guarantee fully rounded edges at any button width (the browser automatically clamps the radius when it exceeds half the element's size).
How does overflow: hidden work with border-radius? If an element has rounded corners but no `overflow: hidden`, its content (text, images) may extend beyond the rounded boundaries and appear in the corners. `overflow: hidden` clips the content along the rounding curve β this is critically important for cards with images.
Can border-radius be animated? Yes, `border-radius` animates beautifully via `transition` or `@keyframes`. Example: `transition: border-radius 0.3s ease` β on hover, you can increase or decrease the rounding. This is commonly used for hover effects on buttons and cards.
Open Border Radius Generator β
CSS Filter Generator
What It Is
The CSS Filter Generator is a visual tool for configuring the `filter` property, which applies graphical effects to an element: blur, brightness, contrast, saturation adjustments, and more. Filters work similarly to filters in graphic editors and are applied directly by the browser.
All Filter Functions
The `filter` property accepts one or more functions, space-separated:
| Function | Range | Description | Example |
|---|---|---|---|
| blur() | 0+ px | Gaussian blur. 0 β no blur, higher values β more blur | `blur(5px)` |
| brightness() | 0+ (100% = original) | Brightness. >100% β lighter, <100% β darker | `brightness(150%)` |
| contrast() | 0+ (100% = original) | Contrast. >100% β more contrast, <100% β flatter | `contrast(120%)` |
| grayscale() | 0β100% | Desaturation. 100% β fully black and white | `grayscale(100%)` |
| hue-rotate() | 0β360Β° | Hue rotation. 0Β° β no change, 180Β° β complementary colors | `hue-rotate(90deg)` |
| invert() | 0β100% | Color inversion. 100% β full negative | `invert(100%)` |
| saturate() | 0+ (100% = original) | Saturation. >100% β more vibrant, 0% β grayscale | `saturate(200%)` |
| sepia() | 0β100% | Sepia tone (old photograph). 100% β full sepia | `sepia(80%)` |
| opacity() | 0β100% | Transparency. Similar to opacity but can be hardware-accelerated | `opacity(50%)` |
| drop-shadow() | β | Shadow that follows the object's contour (like box-shadow for non-rectangular shapes) | `drop-shadow(4px 4px 6px black)` |
Combining Filters
Filters can be combined β they apply sequentially, left to right. Order matters:
/* Blurred, desaturated, and darkened image */
filter: blur(2px) grayscale(100%) brightness(70%);
/* Bright, contrasty, saturated image with a subtle shadow */
filter: brightness(110%) contrast(120%) saturate(150%) drop-shadow(0 4px 8px rgba(0,0,0,0.2));
Popular Filter Effects
Blurred background effect (glassmorphism):
.glass-card {
background: rgba(255, 255, 255, 0.2);
backdrop-filter: blur(10px); /* blurs the background behind the element */
border-radius: 16px;
}
Note: `backdrop-filter` blurs the background behind the element, while `filter` applies to the element itself.
Image hover effect:
.image-card img {
filter: grayscale(100%) brightness(90%);
transition: filter 0.4s ease;
}
.image-card:hover img {
filter: grayscale(0%) brightness(100%);
}
Creating a custom-color icon from a black SVG icon:
/* Black icon β red through a combination of filters */
.icon-red {
filter: invert(28%) sepia(95%) saturate(7489%) hue-rotate(352deg) brightness(94%) contrast(116%);
}
When to Use
- Images β applying artistic effects to photos without Photoshop: desaturation, sepia, brightness adjustments
- Hover effects β smooth image transitions on cursor hover (`transition: filter 0.3s`)
- Dark theme β inverting image colors in a dark theme
- Loading states β blurring and darkening content during loading or disabled states
- Decorative effects β creating unique visual styles without graphic design tools
- Performance β `filter` can be more performant than canvas processing for simple effects, as it uses GPU acceleration
Frequently Asked Questions (FAQ)
Do filters affect performance? Yes, filters β especially `blur()` and `drop-shadow()` β use GPU acceleration but can be resource-intensive with many animated elements. Use `will-change: filter` for elements with animated filters and avoid `blur(20px+)` on large images. For static elements, the performance impact is minimal.
What's the difference between filter: opacity() and the opacity property? Functionally similar, but `filter: opacity()` is GPU-processed in some browsers and may be faster as part of a filter chain. However, `opacity` is more standard and predictable. The key difference: `filter: opacity()` creates a stacking context, which may affect z-index behavior.
Can filters be animated? Yes, all `filter` functions support animation via `transition` and `@keyframes`. Example: `transition: filter 0.3s ease`. This enables smooth hover effects, such as desaturating an image on hover.
How do I apply a filter only to the background without affecting content? Use `backdrop-filter` instead of `filter`. `backdrop-filter` applies effects to the area behind the element without affecting the element itself or its content. Supported by all modern browsers except Firefox β for Firefox, provide a semi-transparent background as a fallback.
Other Useful Tools
After mastering these CSS design tools, check out the text tools β YAML and JSON validators, text diff, and case converters are essential when working with configurations and content. For content generation, use the generators β passwords, UUIDs, random numbers, and placeholder text.
When building full pages, you'll also find the unit converters useful for converting pixels to rem/em and other units, and math calculators for proportion and dimension calculations.