radial-gradient is a cool css property. We can use it to draw a very sensible gradient background to the element. If you don't use it often, you'll find that its syntax is not easy to remember, and is slightly more complicated than linear-gradient(). This article takes you to appreciate its charm through 2 examples.
gradient background color
<div class="hire_wrapper"></div>
.hire_wrapper {
background: radial-gradient(circle at 22% 5%, rgb(85, 55, 101), rgb(30, 38, 74) 76%);
height: 100vh;
}
It can be rendered in the browser with the following background gradient:
Highlight text
<h1>Syncopate</h1>
@import url(https://fonts.googleapis.com/css?family=Syncopate);
body {
height: 100vh;
background: radial-gradient(
circle closest-corner at center 125px,
#222,
black 40%
) no-repeat;
text-align: center;
}
h1 {
display: inline-block;
padding-top: 100px;
font-family: 'Syncopate', sans-serif;
text-transform: uppercase;
background: radial-gradient(
circle farthest-corner at center center,
#ccc,
#333
) no-repeat;
-webkit-background-clip: text;
-webkit-text-fill-color: transparent;
}
Renders the following result:
Background follow mouse gradient animation
If you add some mouse-in events, you can make more awesome effects, such as this:
**粗体** _斜体_ [链接](http://example.com) `代码` - 列表 > 引用
。你还可以使用@
来通知其他用户。