Responsive Web design (RWD), a design strategy developed to cope with the amazing popularity of mobile devices for viewing the Web. Responsive images are an important component of responsive Web design (RWD),
Responsive web design is a new approach to website design that ensures users have a good viewing experience no matter what type of device theyâre using.
Web designer Ethan Marcotte is credited with coining the term âresponsive design.â In 2010, he published an article on A List Apart discussing the rapidly changing environment of devices, browsers, screen sizes, and orientations. Building separate sites for every type of device simply wouldnât be sustainable. Instead, he proposed an alternative concept: responsive design, which calls for building flexible and fluid layouts that adapt to almost any screen.

There are several frameworks used by developers to make a webpage responsive.
- Bootstrap
- Foundation
- Pure
- Skeleton
- Symantic
A responsive Full page background image scales itself according to the user’s viewport. There are several websites that use this effect such as-
This full page background image effect can be easily added to a webpage using CSS.
Example Implementation
Input
HTML
<!DOCTYPE html> <head> <link rel="stylesheet" href="css/main.css"> <title>Responsive Background Example</title> </head> <body> <h1>Hi GFG</h1> </body> </html> |
CSS
body { /* Image Location */ background-image: url("../img/Fall-Nature-Background-Pictures.jpg"); /* Background image is centered vertically and horizontally at all times */ background-position: center center; background-repeat: no-repeat; background-attachment: fixed; background-size: cover; background-color: #464646; /* Font Colour */ color:white; } |
EXPLANATION
background-size: cover;
This property tells the browser to scale the background image proportionally so that its width and height are equal to, or greater than, the width/height of the element.
background-position: center center;
The above sets the scaling axis at the center of the viewport.
background-attachment: fixed;
The background is fixed with regard to the viewport
OUTPUT
The output shows the background image in different viewports.



Recommended Posts:
- How to create responsive image gallery using HTML, CSS, jQuery and Bootstrap?
- How to create responsive website zoomed out to full width on mobile using Bootstrap?
- Responsive page in AngularJS
- Creating Responsive Grid Vanilla using HTML,CSS and Bootstrap
- How to hide elements in responsive layout using CSS ?
- How to redirect a page to another page in HTML ?
- Convert an image into grayscale image using HTML/CSS
- How to display search result of another page on same page using ajax in JSP?
- How to disable dragging an image from an HTML page using JavaScript/jQuery ?
- How to show Page Loading div until the page has finished loading?
- How to pass form variables from one page to other page in PHP ?
- How to design Meet the Team Page using HTML and CSS ?
- HTML | Responsive Modal Login Form
- HTML | Viewport meta tag for Responsive Web Design
- How to put a responsive clear button inside HTML input text field ?
- How to create Responsive Bottom Navigation Bar using Bootstrap ?
- How to Create Full Screen Overlay Navigation Bar using HTML CSS and JavaScript ?
- How to hide an element when printing a web page using CSS?
- How to disable zoom on a mobile web page using CSS?
- How to create fade-in effect on page load using CSS ?
If you like GeeksforGeeks and would like to contribute, you can also write an article using contribute.geeksforgeeks.org or mail your article to contribute@geeksforgeeks.org. See your article appearing on the GeeksforGeeks main page and help other Geeks.
Please Improve this article if you find anything incorrect by clicking on the "Improve Article" button below.


