html - Zooming issue in css? -


i have following code:

<h1>some data</h1> 
h1{     margin: 50px;     display:inline-block;     position:relative;     z-index:1;     padding:10px 50px 10px;     color:red;     border: 1px solid #ccc;     background: #fff; } h1:before{     content:'';     width:100%; height:100%;     position:absolute;     top:-1px; left:0;     background:red;     z-index:-1;     border: 1px solid #ccc;     -webkit-transform: skewx(-20deg);     -ms-transform: skewx(-20deg);     transform: skewx(-20deg);      -webkit-transform-origin:0 0;     -ms-transform-origin:0 0;     transform-origin:0 0;     background: #fff; } 

https://jsfiddle.net/gyvprwex/25/

the problem when zoom out (on chrome , ie 11), in cases child (:before) seemed higher parent, , in cases child seemed shorter.

how can fix zooming issue?

demo codepen

here, have modified code:

* {  	-moz-box-sizing: border-box;  	-webkit-box-sizing: border-box;  	box-sizing: border-box;  	margin: 0;  	padding: 0;  }    html {  	position: relative;  	margin: 2%;  	overflow: hidden;  	width: 540px;  }    html h1 {  	max-width: 100%;  	text-align:center;  	-moz-transition: 0.3s;  	-webkit-transition: 0.3s;  	transition: 0.3s;  }    html:hover h1 {  	-moz-transform: scale(1.1);  	-webkit-transform: scale(1.1);  	transform: scale(1.1);  }    h1 {  	margin: 50px;  	display:inline-block;  	position:relative;  	z-index:1;  	padding:10px 50px 10px;  	color:red;  	border: 1px solid #ccc;  	background: #fff;  }    h1:before {  	content:'';  	width:100%; height:100%;  	position:absolute;  	top:-1px; left:0;  	background:red;  	z-index:-1;  	border: 1px solid #ccc;  	-webkit-transform: skewx(-20deg);  	-ms-transform: skewx(-20deg);  	transform: skewx(-20deg);  	-webkit-transform-origin:0 0;  	-ms-transform-origin:0 0;  	transform-origin:0 0;  	background: #fff;  }
<h1>some data</h1>


Comments

Popular posts from this blog

asynchronous - C# WinSCP .NET assembly: How to upload multiple files asynchronously -

aws api gateway - SerializationException in posting new Records via Dynamodb Proxy Service in API -

asp.net - Problems sending emails from forum -