html - CSS positioned element leaves blank space -


i've been struggling issue. have web want put fixed positioned element (kind of alert box users). therefore decided position fixed , put in bottom left corner of web. assumed not matter put piece of html code positioned anyway, put right under opening body tag. went well, box ended wanted be, leaves strip of blank space @ top of web (where html code is). isn't positioned element supposed take no space? logic seems wrong.

image of problem.

box html:

<div class="users-alert-box">  text </div> 

css:

.users-alert-box { background: #fffcd2 none repeat scroll 0 0; border-radius: 5px; bottom: 35px; box-shadow: 1px 1px 5px #888; display: block; font-size: 12px; left: 30px; padding: 10px 15px; position: fixed; z-index: 1000; width:170px; } 

what missing?

thanks!

the code have provided not create top space. check fiddle.

https://jsfiddle.net/tpoj91u4/

the spacing due margin of other element.


Comments

Popular posts from this blog

c# - Validate object ID from GET to POST -

node.js - Custom Model Validator SailsJS -

php - Find a regex to take part of Email -