

- Trending Categories
Data Structure
Networking
RDBMS
Operating System
Java
iOS
HTML
CSS
Android
Python
C Programming
C++
C#
MongoDB
MySQL
Javascript
PHP
- Selected Reading
- UPSC IAS Exams Notes
- Developer's Best Practices
- Questions and Answers
- Effective Resume Writing
- HR Interview Questions
- Computer Glossary
- Who is Who
Set background image as fixed with CSS
Use the background-attachment property to display the background image as fixed.
Example
You can try to run the following code to implement the background-attachment property −
<!DOCTYPE html> <html> <head> <style> body { background-image: url("https://www.tutorialspoint.com/videotutorials/images/tutor_connect_home.jpg"); background-repeat: no-repeat; background-attachment: fixed; background-position: right top; } </style> </head> <body> <h1>Background Image</h1> </body> </html>
- Related Questions & Answers
- Set a linear gradient as the background image with CSS
- Set a radial gradient as the background image with CSS
- Set the Background Image Position with CSS
- How to set a background image to be fixed with JavaScript DOM?
- Set the background image of an element with CSS
- Repeat the background image with CSS
- Specify the background image with CSS
- Set image as a border for elements with CSS
- Set all the background image properties in one section with CSS
- CSS background-image property
- Achieve Responsiveness for background image with CSS
- How to set background image in CSS using jQuery?
- Set the Background Attachment with CSS
- Setting Background Image using CSS
- Show the background image only once with CSS
Advertisements