![]() |
To create a full-page background with CSS, set the body’s height to `100vh` to cover the viewport, and add a background image using `background-image`. Ensure the image fills the entire viewport without distortion by setting ‘background-size: cover’. Optionally, adjust ‘background-position‘ and ‘background-repeat‘ for alignment and repetition preferences. Syntaxbody { Approach
Example: Implementation to create a full-page background. HTML
Output: Example 2: Implementation to create a full-page background using HTML
Output: |
Reffered: https://www.geeksforgeeks.org
CSS |
Type: | Geek |
Category: | Coding |
Sub Category: | Tutorial |
Uploaded by: | Admin |
Views: | 15 |