Can I blur the border of a div? CSS
You can use box-shadow
for this purpose.
https://developer.mozilla.org/en-US/docs/Web/CSS/box-shadow?v=b
body {
display: flex;
align-items: center;
justify-content: center;
height: 100vh;
}
div {
width: 25vw;
height: 25vw;
background: royalblue;
box-shadow: 0 0 10px navy;
}
<div></div>
Blur the border of an Image
Looking at your comments on Sagar Kodte's answer, is this what you wanted?
img { border: 2px solid #000; box-shadow: 0 0 8px 2px rgba(0, 0, 0, 0.8);}
<img src="http://visitwabashcounty.com/wp-content/uploads/6056710418_03fda4569b_z-150x150.jpg" />
Blur the edges of an image or background image with CSS
If what you're looking for is simply to blur the image edges you can simply use the box-shadow with an inset.
Working example:
http://jsfiddle.net/d9Q5H/1/
HTML:
<div class="image-blurred-edge"></div>
CSS
.image-blurred-edge {
background-image: url('http://lorempixel.com/200/200/city/9');
width: 200px;
height: 200px;
/* you need to match the shadow color to your background or image border for the desired effect*/
box-shadow: 0 0 8px 8px white inset;
}
CSS for fuzzy outline around input elements
it looks like a browser default behavior, but you can fake it with css3 box-shadow
http://jsfiddle.net/meo/BndwU/
or with your colours:
http://jsfiddle.net/meo/BndwU/1/
or with bonus focus animation:
http://jsfiddle.net/meo/BndwU/2/
Related Topics
CSS: Define Media Query Within One Class
Resizing Buttons in Twitter-Bootstrap
Divide Width of Element Between Child Divs with CSS
Bootstrap 5 Form-Group, Form-Row, Form-Inline Not Working
Twitter Bootstrap - Nav Bar Issues in Internet Explorer
Why Do I Have to Add "Overflow:Hidden" to Make The Navigation Bar Visible on The Page
CSS Text-Align: Center; Is Not Centering Things
Make Some Gradient Move Endlessly in a Progress Bar Like in Windows 7
How to Select a Div with Class "A" But Not with Class "B"
How to Add Vertical Spacing Between Block Elements, But Not Top and Bottom
How to Use Absolute Path to Import Custom SCSS, When Using React + Webpack
How to Use Nth-Child in CSS to Select All Elements After The 3Rd One
Why Can't I Decrease The Line-Height of This Text