Ge3ng
Ge3ng

Reputation: 2430

Android CSS webkit not lining up elements

I am trying to get some css to get some we elements to line up with css like this(How it appears on chrome):

call_to_action on chrome

But what I get is this on devices:

call_to_action on device

My Html for this element is this:

<div class="callToAction">
    <p id="p32" class="para"> My personal plan to give service: </p>
    <a id="p33" href="note://title=My_personal_plan_to_give_service:&amp;tags=plan&amp; name="p33"></a>
</div>

My CSS:

.callToAction p{
    background-color:rgb(158, 107, 31);
    padding:.5em;
    color:#FFF;
    font-family:"HelveticaNeue-Light";
    font-size:.9em;
    position:relative;
}
.callToAction p:after{
    content:"";
    position:absolute;
    bottom:-15px;
    left:25px;
    border-width:15px 15px 0;
    border-style:solid;
    border-color:rgb(158, 107, 31) transparent;
}
.callToAction a{
    display:block;
    color:inherit;
    width:96%;
    min-height:100px;
    background:url(file:///android_asset/call_to_action.png) no-repeat 98% 95% rgb(230, 230, 220);
    background-size:6%;
    margin-bottom:1em;
    padding: 15px 2%;
}

.callToAction a:empty{
    width:100%;
    background:url(file:///android_asset/call_to_action.png) no-repeat center rgb(230, 230, 220);
    background-size:12%;
    padding: 10px 0%;
}

Upvotes: 0

Views: 61

Answers (1)

Shen Weizheng
Shen Weizheng

Reputation: 191

You should reset the margin for the "p" element, by default chrome set it to "1em". Add the margin: 0px; to your css style ".callToAction p".

Upvotes: 1

Related Questions