How to give Gradient to background border color using Css3 | Sanwebcorner

How to give Gradient to background border color using Css3

This post help you how to create gradient background border using css3 with the help of  border-image property. This is one of the simple way to add the gradient background using css3. The below image shows how the gradient looking for.

using the linear-gradient property you can mention the degree of the gradient and also starting background color and ending background color using this the gradient will appear in the border background.

In the below example i given different types of background colors with different types of the angle of the gradient. You can change those value as your wish. Below is the demo page is available check it out. I hope this post is very useful.

Html code for Gradient Border Background using css3

<h1>How to give Gradient to border using css3</h1>
<div class='bordered-gr-1'>1</div>
<div class='bordered-gr-2'>2</div>
<div class='bordered-gr-3'>3</div>
<div class='bordered-gr-4'>4</div>
<div class='bordered-gr-5'>5</div>
<br/>
<p style="margin-top:150px;">&nbsp;</p>
<p><a href="http://www.sanwebcorner.com"><h1>www.sanwebcorner.com</h1></a></p>

Css code for Gradient Border Background using css3

div {
    height: 100px; width: 100px;
    font-size: 50px;
    line-height: 100px;
    text-align: center;
    margin: 10px auto;
    background-clip: padding-box;
}
.bordered-gr-1 {
    float:left;
    margin:15px;
    border: 20px double pink;
    border-image: -webkit-linear-gradient(45deg,orange,yellow) 20 stretch;
}

.bordered-gr-2 {
    float:left;
    margin:15px;
    border: 20px double pink;
    border-image: -webkit-linear-gradient(90deg,green,yellow) 20 stretch;
}

.bordered-gr-3 {
    float:left;
    margin:15px;
    border: 20px double pink;
    border-image: -webkit-linear-gradient(120deg,red,yellow) 20 stretch;
}

.bordered-gr-4 {
    float:left;
    margin:15px;
    border: 20px double pink;
    border-image: -webkit-linear-gradient(180deg,pink,yellow) 20 stretch;
}

.bordered-gr-5 {
    float:left;
    margin:15px;
    border: 20px double pink;
    border-image: -webkit-linear-gradient(360deg,gray,black) 20 stretch;
}

Post a Comment

Labels

360 degree view product image 3d rotate 3d text 3step-form Accordion menu ajax All Browsers Animated Background Gradient animation audio controller auto complete Best accordion menu bootstrap border bounce effect on hover Breadcrumb calculate age by dob calendar Captcha change image on mouse move color chooser countdown Counter on scroll Css css animation css buttons css hover css3 customized upload Button Date picker delete data from table Different scroll speed email otp verification email verifier Embed eventlist Expanding Menu feedbck form flash news section close button full screen menu Google custom search Google Maps Google reCAPTCHA Google site search gradient hide menu Horizontal News ticker Hover Htm Html html dropdown html form html5 html5 form validation Iframe image hover increment decrement textbox value based on select box Javascript Jquery js Layered image effect on mouse hover lock & unlock page scroll marquee marquee with close button mobile number validation mobile otp login Multi-level-drop-down-menu multi-level-form Multi-Step-form mysql News ticker on hover change text to image our team page password strength checker Photoshop PHP populate html selectbox Popup image on click the link pure css Question type form Random password Redirect page Based on the select box while submit the form responsive responsive menu responsive popup box Responsive Vertical Time line design rotate image selectbox based on select box simple coming soon page simple countdown based on end date simple typing effect slider sliding tab sms otp login statistic counter on scroll switch tag shape team member Time picker toggle toggle view transparent button underline animation up down slide validation vertical fixed sidebar Webtips Youtube