Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Box-shadow not shown on Safari Mobile on iOS 7 (in landscape)

I have a very simple box-shadow on an header:

h1 {
    box-shadow: 0 4px 9px -8px #000000;
    color: #D95B43;
    height: 1.2em;
    margin-top: 0;
    font-size: 1.3em;
    padding: 10px;
}

But the box-shadow doesn't work on Mobile Safari (iOS 7). In the previous version (and in portrait view, in iOS7) it works fine.

Here's a screenshot:

enter image description here

And a jsfiddle.

How can I solve this problem?

like image 220
franzlorenzon Avatar asked Jan 28 '14 09:01

franzlorenzon


3 Answers

Try the following CSS property:

-webkit-appearance: none;
like image 113
Harish Jain Avatar answered Nov 15 '22 13:11

Harish Jain


Adding border-radius: 1px fixed the problem:

h1 {
    box-shadow: 0 4px 9px -8px #000000;
    border-radius: 1px;
    color: #D95B43;
    height: 1.2em;
    margin-top: 0;
    font-size: 1.3em;
    padding: 10px;
}

From: https://stackoverflow.com/a/21323644/1565597 .

like image 20
franzlorenzon Avatar answered Nov 15 '22 12:11

franzlorenzon


I tried reading the Bootstrap code.
Maybe set the following code will solve it.

background-clip: padding-box;
like image 23
KABA Avatar answered Nov 15 '22 11:11

KABA