css position background image top center
backgroundPosition"center" Try it.How to position a background-image to be centered at top: body background-image: url(w3css.gif) background-repeat: no-repeat background-attachment: fixed background-position: center top If you need to position a background-image in CSS 20px from the left and 10px from the top, thats easy.The four-value syntax for background-position. This is the easiest way. You combine length values with any of top/right/bottom/left keywords (not center). The background-image property has to be part of a CSS rule. For instance, the background image for a textarea can be added using the following rulebackground-position: center default is top left. This example CSS rule sets the background position to left horizontally and top vertically.The result is a centered background image because the center (50, 50) of the background images is aligned with the center (50, 50) of the HTML element. CSS background-position - CSS Tutorials for beginners to advanced developers Learning Cascading Style Sheet in simple and easy steps withpercent. none. length. top. center. bottom.
left.The background image positioned 100 pixels away from the left and 200 pixels from the top.up CSS Example background-position