Emily Xiong
1 min readMay 14, 2019

--

I tried both ways by setting height:auto and right: 0, both did not work. Any idea? This is what my class looks like:

border: 0;
clip: rect(0 0 0 0);
height: 1px;
margin: -1px;
overflow: hidden;
padding: 0;
position: absolute;
width: 1px;
right: 0;

It seems that I could only make it work by changing to position: relative.

Updated:

So this is what our class looks like at the end:

border: 0;
height: 0;
width: 0;
margin: 0;
padding: 0;
font-size: 0;
overflow: hidden;
white-space: nowrap;
position: relative;
float: left;

I just tested for latest chrome, safari, firefox, IE edge. Not sure how backwards compatible it is.

--

--

Emily Xiong
Emily Xiong

Written by Emily Xiong

A frontend web developer in Toronto

Responses (1)