Hi, just something I have noticed, that has me a bit stumped…
When I run an Ionic application in the browser (ie in Chrome using ionic serve
), elements display larger than the same markup in a straight html document.
For example, I have the following markup, in both a new blank Ionic app…
Ionic app
<ion-header>
<ion-navbar>
<ion-title>
Ionic Blank
</ion-title>
</ion-navbar>
</ion-header>
<ion-content >
<div style="display:grid;height:100%;grid-template-columns: 64px;grid-template-rows: 64px">
<div style="height: 100%;background-color: red"></div>
</div>
</ion-content>
HTML file…
<!DOCTYPE html>
<html>
<head>
<meta name="viewport" content="viewport-fit=cover, width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, user-scalable=no">
</head>
<body>
<div style="display:grid;height:100%;grid-template-columns: 64px;grid-template-rows: 64px">
<div style="height: 100%;background-color: red"></div>
</div>
</body>
</html>
So each has the exact mark up of
<div style="display:grid;height:100%;grid-template-columns: 64px;grid-template-rows: 64px">
<div style="height: 100%;background-color: red"></div>
When I measure (eg in paint, or using a ruler app), the plain HTML display shows the square to be 16px, but the one displayed in the Ionic app is much larger (as can be seen below)
I am copying the UI an existing aging application into Ionic, so am looking at the sizes of elements in the old app, but then when the Ionic app is rendered, they appear much bigger
Anyone have any idea why this is?
Thanks in advance for any ideas.