html - Inconsistent element rendering and spacing -


i started creating simple concept javascript game based around tiles, when positioning tiles, found problem display. http://i.gyazo.com/8328507c64b4254a6271172892ca3f92.png

in picture, couple of columns dragged around 0.5px , 1px, , highly undesirable.

i have tested in chrome, mozilla firefox , internet explorer , have trouble aligning tiles: chrome has trouble vertically, firefox , ie horizontally.

the css code both container , tiles (there 200 in container) following:

#container {     position:absolute;     width:100%;     height:100%; }  .tile {     width:5%;     padding-bottom:5%;     display:inline-block;     margin-right:-4px;     margin-bottom:-4px;     position:relative;     background-size:100% auto;     background-repeat:no-repeat; } 

edit: html code, request:

<div id="container">     <div class="tile tile_0_0"></div>     <div class="tile tile_1_0"></div>     <div class="tile tile_2_0"></div>     <div class="tile tile_3_0"></div>     <div class="tile tile_4_0"></div>     <div class="tile tile_5_0"></div>     <div class="tile tile_6_0"></div>     <div class="tile tile_7_0"></div>     <div class="tile tile_8_0"></div>     <div class="tile tile_9_0"></div>     <div class="tile tile_10_0"></div>     <div class="tile tile_11_0"></div>     <div class="tile tile_12_0"></div>     <div class="tile tile_13_0"></div>     <div class="tile tile_14_0"></div>     <div class="tile tile_15_0"></div>     <div class="tile tile_16_0"></div>     <div class="tile tile_17_0"></div>     <div class="tile tile_18_0"></div>     <div class="tile tile_19_0"></div>     <div class="tile tile_0_1"></div>     <div class="tile tile_1_1"></div>     <div class="tile tile_2_1"></div>     <div class="tile tile_3_1"></div>     <div class="tile tile_4_1"></div>     <div class="tile tile_5_1"></div>     <div class="tile tile_6_1"></div>     <div class="tile tile_7_1"></div>     <div class="tile tile_8_1"></div>     <div class="tile tile_9_1"></div>     <div class="tile tile_10_1"></div>     <div class="tile tile_11_1"></div>     <div class="tile tile_12_1"></div>     <div class="tile tile_13_1"></div>     <div class="tile tile_14_1"></div>     <div class="tile tile_15_1"></div>     <div class="tile tile_16_1"></div>     <div class="tile tile_17_1"></div>     <div class="tile tile_18_1"></div>     <div class="tile tile_19_1"></div>     <!--continues way tile_19_9--> </div> 

any regarding issue appreciated. in advance.

it difficult tell without live version of code play with, 1 thing might try adding font-size: 0; #container.

the reason bring .tiles inline-block, means browser going collapse newlines between them in html source text spaces. (see this article space between inline-block elements more information.)

at point, may able remove negative margin-right , margin-bottom .tiles well.


Popular posts from this blog

c# - ODP.NET Oracle.ManagedDataAccess causes ORA-12537 network session end of file -

matlab - Compression and Decompression of ECG Signal using HUFFMAN ALGORITHM -

utf 8 - split utf-8 string into bytes in python -