IE11 draws small line between positioned elements
It's because the way the border is calculated. Screen is a finite grid, so when you decide that the center of the arc is at coordinates e.g. "10 x, 10 y" it could mean different things:
- the center of the arc is in the middle of the 10th pixel?
- the center of the arc is at the begginnig of the 10th pixel?
- the center of the arc is at the end of the 10th pixel?
So, when it draws the arc with radius 10px it could go half pixel farther (or closer) from the point you expected (and will yield "half pixel" sizes, a 2px gray line where you wanted 1px black, a circle that is not really round or some other sad surprise).
This kind of different behaviour is common among the major browsers (e.g. see this: Border-radius: 50% not producing perfect circles in Chrome ) I think it shouldn't be considered a bug, those are just implementation decisions that unluckily for us differ from a browser to another.
The most common solutions is to play with the border width (0.5px,1px,2px) and radius (even/odd sizes) or even positioning with decimals (bottom: -19.5px?). Can't say wich combination will yield best results for this case since I can't reproduce it in Windows 7 + IE11.
CSS - Fading All Edges of div to Transparent over Defined Distance
I've used box shadows in the past to achieve this sort of effect.
box-shadow: 0px 0px 25px 25px rgba(55,54,51, 1);
By adding a box shadow with a translation of 0px in any direction, a spread distance of 25px, and a blur radius of 25px, it makes it the 50px blur you like. By changing the margin to 50px and using top
, right
, etc. for positioning you can get it exactly where you want.
HTML:
<div class="formBackground">
<form id="gform" method="POST" action="***">
<input type="text" id="name" name="name" placeholder="Name" style="width: 100%; float: left;">
<input type="text" id="email" name="email" placeholder="Email" style="width: 100%; float: left;">
<input type="textarea" id="message" name="message" placeholder="Write your message here..." style="width: 100%; float: left;">
</form>
</div>
CSS:
.formBackground {
height: auto;
background-color : rgba(55,54,51, 1);
overflow: hidden;
margin: 50px;
box-shadow: 0px 0px 25px 25px rgba(55,54,51, 1);
}
Outline Offset substitute on IE
Here is an alternate for IE as shown in "http://css-tricks.com/"
Code:
<div class="inner-border">
Transparent Inside Border
</div>
CSS
.inner-border {
background: #000;
color: #fff;
margin: 50px;
padding: 15px;
position: relative;
}
.inner-border:before {
border: 5px solid #000;
content: "";
position: absolute;
top: -10px;
bottom: -10px;
left: -10px;
right: -10px;
}
JSFiddle Demo of the Above Code
Here is another example of Transparent Inside Border:
http://jsfiddle.net/chriscoyier/DvaqK/4/
Hope this will help!
How can I add a box-shadow on one side of an element?
Yes, you can use the shadow spread property of the box-shadow rule:
.myDiv{ border: 1px solid #333; width: 100px; height: 100px; box-shadow: 10px 0 5px -2px #888;}
<div class="myDiv"></div>
Bootstrap dropdown position fixed with container border-radius vanishing beyond border in IE
Instead of setting overflow for the container, I set it to the ul and made that fill it's parent.
See fiddle http://jsfiddle.net/b3XA2/11/
.one > ul{
overflow-y:scroll;
margin:0;
height: 100%;
}
CSS: Workaround to backdrop-filter?
As of Chrome M76, backdrop-filter is now shipped, unprefixed, and without a needed flag.
https://web.dev/backdrop-filter/
NOTE: (since this answer keeps getting downvoted because Mozilla hasn’t yet shipped it): this feature is available in Safari, Chrome, and Edge, but not yet in Firefox. Mozilla is planning to ship it very soon, but hasn’t yet. So this answer doesn’t contain a “workaround” but simply more information about which browsers require a workaround. Which still seems like useful information.
Center a position:fixed element
If your div has a known width and height, then you basically need to set top
and left
to 50%
to center the left-top corner of the div. You also need to set the margin-top
and margin-left
to the negative half of the div's height and width to shift the center towards the middle of the div.
position: fixed;
width: 500px;
height: 200px;
top: 50%;
left: 50%;
margin-top: -100px; /* Negative half of height. */
margin-left: -250px; /* Negative half of width. */
Or, if your div has a dynamic/undefined width and/or height, then instead of the margin
, set the transform
to the negative half of the div's relative width and height.
position: fixed;
top: 50%;
left: 50%;
transform: translate(-50%, -50%);
Or, if your div has at least a fixed width and you don't care about centering vertically and old browsers such as IE6/7, then you can instead also add left: 0
and right: 0
to the element having a margin-left
and margin-right
of auto
, so that the fixed positioned element having a fixed width knows where its left and right offsets start. In your case thus:
position: fixed;
width: 500px;
margin: 5% auto; /* Will not center vertically and won't work in IE6/7. */
left: 0;
right: 0;
Again, this works only in IE8+ if you care about IE, and this centers only horizontally not vertically.
Related Topics
Add a Drop Shadow to Transparent Text with CSS
How to Reduce Font Size Based on Length
Z-Index and Relative/Absolute Positioning
Jagged "Border" Showing Due to Background Colour on Wrapper Element with Border-Radius: 50%;
Input Doesn't Respect Flex Container Width
Min - Height with Child Set to Position:Absolute
CSS Target Just Class Name Starts with and Ends with String
How to Create a Button (Or Div) with a Border That Has a Gradient and Has Rounded Corners
Media Query in Responsive Email Template
Multiple Attributes in Ng-Style
How to Expand a Cropped Image into a Box