@Mark Yes, it is indeed possible to create a gradient with a glow effect using CSS. You can get this by combining the linear-gradient property and the box-shadow property.
Here is an example:
body {
margin: 0;
height: 100vh;
display: flex;
align-items: center;
justify-content: center;
background: linear-gradient(to bottom, #87CEEB, #ffffff, #00008B);
box-shadow: 0 0 20px rgba(0, 0, 139, 0.5); /* Adjust the color and spread as needed */
}
/* Add other styles for your content */
.content {
color: white;
font-size: 24px;
}
In this example:
The linear-gradient property is used to create a gradient that goes from lightblue (#87CEEB) to white to dark blue(#00008B) from top to bottom.
Hope to be helpful for your coding.
PS: If you just want to give that effect on border you can do like this:
body {
margin: 0;
height: 100vh;
display: flex;
align-items: center;
justify-content: center;
}
.border-container {
width: 200px; /* Adjust the width as needed */
height: 200px; /* Adjust the height as needed */
border-width: 20px; /* Adjust the border width as needed */
border-image: linear-gradient(to bottom, #87CEEB, #ffffff, #00008B) 1;
border-image-slice: 20; /* Adjust the slice value to match the border width */
box-shadow: 0 0 20px rgba(0, 0, 139, 0.5); /* Adjust the shadow properties as needed */
}
2
Answers
@Mark Yes, it is indeed possible to create a gradient with a glow effect using CSS. You can get this by combining the
linear-gradient
property and thebox-shadow
property.Here is an example:
In this example:
linear-gradient
property is used to create a gradient that goes from lightblue (#87CEEB
) to white to dark blue(#00008B
) from top to bottom.Hope to be helpful for your coding.
PS: If you just want to give that effect on border you can do like this:
I add sample code below.