css - Keep an image centered regardless of screen size? -


here's fiddle created. want decorative ornament stay in middle of screen. can't figure out how it. tried wrapping in div didn't work either.

html

<span class="border-top"></span> 

css

.border-top { background: url("http://i.imgur.com/txoi4sd.png") no-repeat; clear: both; display: block; height: 47px; margin-bottom: 50px; width: 100%; } 

.border-top {      background: url("http://i.imgur.com/txoi4sd.png") center center no-repeat;      clear: both;      display: block;      height: 47px;      margin-bottom: 50px;      width: 100%;  }
<span class="border-top"></span>

this trick.

reference: http://www.w3.org/tr/css3-background/#the-background


Comments

Popular posts from this blog

python - mat is not a numerical tuple : openCV error -

c# - MSAA finds controls UI Automation doesn't -

wordpress - .htaccess: RewriteRule: bad flag delimiters -