- CSS gradient генератор
- Радиальный градиент
- Практическое использование CSS градиента
- Градиент поверх картинки
- Градиент в тексте
- Ultimate CSS Gradient Generator
- Enter existing gradient CSS to import
- Import from an image-based gradient
- Browser compatibility
- What’s new
- Previous versions
- About
- Features
- Help
- Credits
- Gradient Background Generator
- How Does Gradient Background Generator Work?
- How can I change the color of the gradient image?
- Can I pick colors from an image I already have?
- What size of gradient image can I generate with Gradient Generator?
- What are some use cases of a gradient background?
- Can I use your gradient image as wallpaper on my device?
- How to use gradient backgrounds in website?
- How to Use Gradient Background Generator?
- Credits
CSS gradient генератор
Времена, когда сделать градиент на сайте можно было только с использованием картинок давно прошли. Теперь достаточно просто создавать градиенты внутри CSS стилей.
Для того, чтобы задать градиент используется свойство background-image или сокращенный вариант background-image . И мы можем создать как линейный так и радиальный градиент, прописав значения либо linear-gradient, либо radial-gradient и указав начальный и конечный цвета. Вот пример синтаксиса:
Поменять направление возможно, указав его вначале, перед первым цветом.
Если заменить этот параметр на to top right вы получите диагональный градиент. Такой же эффект можно создать, указав параметр в градусах, например, 45deg .
Вы можете использовать больше чем 2 цвета, и цвета можно записать в том числе и по названию.
Каждый из четырех цветов будет занимать равное количество доступного пространства, что даст нам гладкий и сбалансированный градиент.
Если мы хотим, чтобы один цвет занимал больше места, чем другой, можно добавить значение в процентах непосредственно после цвета. Потренируйтесь на градиент css генераторе выше.
Радиальный градиент
Используем все, что мы уже узнали ранее, чтобы создать радиальный градиент. На самом деле это довольно просто, достаточно в начале указать значение radial-gradient .
Такой радиальный градиент принимает форму родительского блока, поэтому вместо круга мы получили эллипс. Чтобы градиент был в форме круга независимо от пропорций родителя, необходимо указать ключевое слово circle .
К тому же мы можем указать где будет центр радиального градиента. Давайте сделаем так, чтобы он был в левом верхнем углу:
Практическое использование CSS градиента
Давайте попробуем использовать градиент более оригинальным способом.
Градиент поверх картинки
Ниже вы видите пример слоя с градиентом поверх изображения. Здесь мы использовали полупрозрачные rgba цвета.
Свойство background может принимать сразу несколько значений. При этом первое будет верхним слоем, а последнее — нижним.
CSS div { background: linear-gradient(to right, rgba(75, 123, 211, 0.5), rgba(22, 215, 177, 0.3)), url('gradient.jpg'); }
Градиент в тексте
Градиент в тексте — это классный эффект, хотя и не полностью поддерживаемый в чистом виде. Вместо него мы используем свойство background-clip , это что-то вроде хака, но отлично работающего хака.
Возьмем элемент, в данном случае h1, и применим к нему градиент. Свойству background-clip присвоим значение text, это удалит фон из всего блока, за исключением текста. И, конечно же, следует сделать свойство color прозрачным, иначе мы не увидим градиент.
CSS div { background-image: linear-gradient(to right, #0cebeb, #20e3b2, #29ffc6); -webkit-background-clip: text; background-clip: text; color: transparent; }
- Студия Профессиональная разработка сайтов под заказ Подробнее
- Иконки Прекрасный способ визуально выразить главную мысль Подробнее
- Сервисы Полезные инструменты для веб разработчиков Подробнее
- Блог Делимся в опытом и знанием в IT сфере Подробнее
- Поделиться ВконтактеFacebook Контакты support@active-vision.ru
© 2019 — 2023 Active-Vision. Политика конфиденциальности. Вся информация на сайте носит справочный характер и не является публичной офертой, определяемой статьей 437 ГК РФ
Ultimate CSS Gradient Generator
A powerful Photoshop-like CSS gradient editor from ColorZilla.
Enter existing gradient CSS to import
Import from an image-based gradient
Browser compatibility
Support using old -webkit- syntax
Browser usage: less than 0.1%
Select «Maximize compatibility» to support
IE9 support (?) Maximize compatibility
What’s new
- » Don’t generate older Opera, IE10 Preview, Webkit syntax by default (turn back on using «Maximize compatibility» mode)
- » Browser Compatibility panel showing supported browser versions, usage stats etc.
- » Support for radial and diagonal linear gradients
- » Support for full multi-stop gradients in Internet Explorer 9 (IE9) using SVG
- » Support for Sass SCSS format using Compassmixins (needs latest beta of Compass)
- » Copy to clipboard button for quickly grabbing the generated code
- » Easy resizing of preview panel by dragging its corner
Previous versions
- » Opacity support
- · Create transparent css gradients, or add fade-in, fade-out, semi-transparency and similar effects
- · Add any number of opacity stops to your gradient
- · Supports opacity stops at any position — completely independent of color stops
- · Automatically switch to rgba/hsla color output mode when transparency is used
- · Outputs older Internet Explorer opacity format (yes, this will even work with IE6!)
- · Opacity support when importing from CSS
- · Supports importing gradients with transparency from an image
- » New ‘Adjustments’ panel — tweak your gradient or create new flavors
- · Adjust hue, saturation and lightness
- · Reverse current gradient
- » Added support for 4 new gradient formats:
- · IE 10+
- · Newer Webkit
- · Opera 11.10+
- · W3C
- » Import from an image — convert an existing gradient image to CSS
- · Supports complex multi-stop gradients
- · Upload an image or import from an image URL
- » Import from CSS — enter existing gradient CSS in various formats and import it into the tool
- » Save your gradients as new presets
- · Edit your gradient, enter its name and hit ‘new’
- · Remove any of your preset gradients using its context menu (right click)
- · Your gradient presets will be persisted in the tool across sessions
About
The Ultimate CSS Gradient Editor was created by Alex Sirota (iosart). If you like this tool, check out ColorZilla for more advanced tools such as eyedroppers, color pickers, palette editors and website analyzers.
As you might know, HTML5 introduced many exciting features for Web developers. One of the features is the ability to specify gradients using pure CSS3, without having to create any images and use them as repeating backgrounds for gradient effects.
Important: You’ll need a recent version of Firefox, Chrome, Safari, Opera or IE to use this Gradient Generator. The resulting CSS gradients are cross-browser — they will work in these browsers and will also fall back to a simpler gradient in older versions of Internet Explorer.
Features
- Powerful Photoshop-like interface
- Cross browser CSS output
- Horizontal, vertical, diagonal and radial gradients
- Complex multi-stop gradients
- Opacity support with multiple opacity stops
- Hex, rgb, rgba, hsl, hsla color formats
- Support for full multi-stop gradients with IE9
- Import from image (convert image gradient to CSS)
- Import from existing CSS
- Adjust gradient by hue, saturation, lightness
- More than 135 gradient presets
- Saving custom gradient presets
- Sass output
- Flexible preview panel
- Gradient permalinks for sending and sharing
- More soon!
Help
- » Adjust the gradient stop position by dragging the stop marker
- » Adjust the stop color by double clicking on the stop marker
- » Delete a stop by draggin the stop marker up or down
- » Add a new stop by clicking anywhere in between the existing stop markers
The ‘Preview’ panel allows previewing the current gradient as a vertical or horizontal one, and also allows quickly previewing how the Internet Explorer fallback gradient will look in IE.
Finally, the ‘CSS’ panel always has the CSS for the current gradient for easy copying and pasting into your stylesheet. You can also use this panel to import an existing gradient CSS into the tool.
Credits
The ‘Ultimate Web 2.0 Gradients’ preset gradients were derived from work by deziner folio and SGlider12.
The Color Picker is a minor adaptation of John Dyer’s Color Picker.
The Base-64 encoder function is from webtoolkit.
Tags: CSS Gradient Editor, CSS Gradient Generator, HTML5 Gradient Generator, CSS3 Gradient Generator, CSS Gradient Maker, CSS Gradient Creator, Linear Gradients, Radial Gradients, IE6, IE7, IE8, IE9, IE10, SVG Gradients, ColorZilla
Gradient Background Generator
Generate Linear and Radial Gradient CSS code and Background Images with custom configuration options.
How Does Gradient Background Generator Work?
Gradient generator is capable of generating linear and radial gradient images that can be used as background images in your design or as wallpaper images. The tool also produces CSS code that can be used to create similar gradient using CSS code on a website. You can easily configure the colors in the gradient and choose the direction and position of the gradient. Downloading the gradient image in PNG as well as JPG files are supported.
You can generate a gradient image of any width and height. By default the tool generates image of size 3000px width and 2000px height. If you are generating background images, then you can also check out our solid color image generator.
How can I change the color of the gradient image?
Using the color picker controls, you can change the colors of the gradient image. You can also input your color in HEX, RGB, HSL or HSV.
Can I pick colors from an image I already have?
Yes, you can expand the color picker control and then click on the eye dropper icon to pick colors from your existing image or your screen. We also recommend using the color extractor tool to pick primary colors from your image.
What size of gradient image can I generate with Gradient Generator?
You can generate image of any width and height. By default our tool generates gradient image of 3000×2000 size. You can generate 1×1 pixel image or go as high as possible as per your requirement.
What are some use cases of a gradient background?
A gradient background can bring in better asthetics when designing a website, mockup or social media image. Using gradients in web design as well as graphic design has been a trend for a long time and would continue to be there.
Can I use your gradient image as wallpaper on my device?
Most certainly, yes! Simply go to screen resolution tester to find out the width and height of your device. Then use those dimensions to create a gradient background image of your choice. Download the PNG or JPG file and set it as your wallpaper.
How to use gradient backgrounds in website?
In order to set gradient as background in website you must use the CSS code provided by the tool.
For example here is a sample CSS code for creating a linear gradient:
And here is a sample CSS code for creating a radial gradient:
How to Use Gradient Background Generator?
- The tool above will present you with a randomly generated gradient background at start.
- You can change the primary or secondary color used in the gradient by entering the color value in HEX.
- You can also use the color picker control to pick the primary or secondary colors.
- The color input control can also be used to specify value in RGB, HSL or HSV.
- Gradient type can be switched between a linear gradient or a radial gradient using the radio button.
- Depending on the gradient type selected, you can then change the direction or position of the gradient colors.
- CSS code to generate the gradient will be automatically updated based on your choices. You can click on ‘Copy’ button to copy the code.
- For downloading your gradient as image, you can specify the width and height of the image.
- Once you have created the desired gradient, choose to download image as PNG (high-quality) or a JPG image.
- If the gradient image opens in a new tab, instead of downloading, right click and do «Save As» to save the background image.
- We do not store any of the gradients you create and everything is done inside your browser.
Credits
- vue.js — The Progressive JavaScript Framework
- TinyColor — Fast, small color manipulation and conversion for JavaScript
- highlight.js — Syntax highlighting for the Web
- clipboard.js — A modern JavaScript library to copy text to clipboard
- download.js — Client-side file downloading using JS and HTML5 by dandavis