CSS Backgrounds
Background-Image in HTML and CSS
1 2 3 |
body { background-image: url("logo.jpg"); } |
Background – Shorthand property in HTML and CSS
1 2 3 4 |
body { background: url("logo.jpg") no-repeat right ; text-align: left; } |
Background Image – Set position and no-repeat in HTML and CSS
1 2 3 4 5 6 |
body { background-image: url("logo.jpg"); background-repeat: no-repeat; background-position: center; text-align: center; } |
Different Background Colors in HTML and CSS
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 |
h1 { border-style:
solid; border-width: 10px; text-align: center; background-color: lightgray; color: gray; margin: 50px; } .aa { background-color: lightpink; border-style: solid; color: red; font-size: 30px; } p { text-align: left; background-color: black; color: white; } |