Basj
Basj

Reputation: 46493

CSS 1px border in a Webview gives 2px border on some sides, when devicePixelRatio = 1.5

I'm loading a page in a Android app with a WebView (=embedded browser in app), with standard settings:

mywebView = (WebView) findViewById(R.id.activity_main_webview);
...
mywebView.loadUrl("http://example.com/test");

Everything works correctly except the following minor issue:

Problem: The 1-pixel-wide border is not displayed correctly: one or two of the four sides of the border are 2px instead of 1px. It looks like this:

enter image description here

Upvotes: 0

Views: 2160

Answers (1)

Jiang yongmin
Jiang yongmin

Reputation: 11

I just have a similar problem and it is fixed, I do not if this solution will help you or not:

It helped by give a margin to the div

.brand .col-8 {
    padding-right:0;
    margin-right:-1px;
}
.brand .col-4 {
    border-left:1px solid #d8d8d8;
}

Upvotes: 1

Related Questions