- ✕Tá an achoimre seo ginte ag intleacht shaorga atá bunaithe ar roinnt foinsí ar líne. Úsáid na naisc "Foghlaim tuilleadh" chun amharc ar an mbunfhaisnéis fhoinseach.
To set a background image for a single HTML page, you can use CSS either inline, in the <style> tag, or via an external stylesheet. This ensures the image is applied only to that page and not site-wide.
Using CSS in <style> Tag
Place the CSS inside the <head> section of your HTML file and target the <body> element.
<!DOCTYPE html><html lang="en"><head><meta charset="UTF-8"><title>Background Image Example</title><style>body {background-image: url('background.jpg');background-repeat: no-repeat;background-attachment: fixed;background-size: cover;}</style></head><body><h1>Welcome</h1><p>This page has a custom background image.</p></body></html>Cóipeáilte!✕Cóipeáilbackground-repeat: no-repeat; prevents tiling.
background-attachment: fixed; keeps the image fixed while scrolling.
background-size: cover; ensures it covers the entire viewport proportionally.
Using Inline CSS
If you want to apply it directly without a <style> block:
HTML Background Images - W3Schools
How to Add Background Image in HTML? - GeeksforGeeks
23 Iúil 2025 · The <body> background attribute is used in HTML to add a background image. The background attribute uses an image URL or a color code to customize the HTML body element.
How to Add Background Image in HTML - W3docs
Learn how to add and position a background image in an HTML document with CSS styles. See examples of different background-image properties, such as repeat, …
HTML Background Image – How to Add Wallpaper …
23 MFómh 2022 · Learn how to use CSS to add a background image to your website and adjust its size, position, and repetition. See examples of different …
CSS Background Image - W3Schools
Learn how to set a background image for an element using the CSS background-image property. See examples, exercises and video tutorial on how to use HTML …
How Do I Add A Background Image To An HTML Page?
Learn various methods of adding background images to HTML pages, such as inline CSS, external CSS, and deprecated attributes. Also, explore CSS properties …
- Iarrann daoine freisin
How to Add Background Image in HTML: A Simple Guide
3 days ago · Learn how to add background image in HTML with simple steps, examples, and best practices to make your web pages look stunning and professional.
CSS Background Image – With HTML Example Code
21 Iúil 2021 · Learn how to add images to your HTML code and how to fine-tune them with CSS properties. See how to stop repeat, set position, resize and attach …
HTML & CSS Colors and Backgrounds - W3Schools
Background properties background-color - solid colors. background-image - images or gradients. background-size - cover, contain, or dimensions. background-position, background-repeat, …
How to Set a Background in HTML and CSS: Guide + Examples
Féach ar an bhfíseán iomlán17 Márta 2025 · Fortunately, it's easy to set a background image on your website. This wikiHow article will walk you through setting your web page's background using HTML and CSS using simple examples. We'll also give you some more …
- Amhairc: 2.3M