3. background-image #
Created Monday 15 June 2020
Syntax #
body {
background-image: url("paper.gif"); /* url('path-to-image') */
}
- See to it that the background doesn’t make the text unreadable
Variations #
- Prevent repeating - background-image repeats an image both horizontally and vertically, to control this use:
body { background-image: url("something"); background-repeat: repeat-x; /* or repeat-y or no-repeat */* }
- Specify the position:
body { background-image: url(something); background-attachment: fixed; /*scroll, background does not change*/ }
- Fill value -
background-size: cover | fill
etc.