css - no-repeat center center vs cover -


what difference between background: no-repeat center center; , background-size: cover; ?

both achieve same effect background image on website. no difference far can tell in results.

background: no-repeat centre centre; saying place background image in element, show 1 instance of (no-repeat), try looking @ thebackground-repeat property see other options.

the css says place image in vertical centre, , horizontal centre of element. related background-position property.

it might worth trying reducing image size small 10px x 10px see effect of no-repeat, vs repeat-x, repeat-y , repeat.

background-size: declares how big want background image (this allows dynamic resizing of image height , width in html img tag), property introduced in css3.

by default background-image's default/native resolution. using cover value saying scale background image large possible background area covered background image. parts of background image may not in view within background positioning area

i have put links on each of properties can see possible values each. recommend @ of background-* attributes on w3schools. on left hand side , listed ;)

alternatively if you're new css, recommend free course udacity has plenty of video tutorials , guides through html & css web development.


Comments

Popular posts from this blog

shopping cart - Page redirect not working PHP -

php - How to modify a menu to show sub-menus -

python - Installing PyDev in eclipse is failed -