Quantcast
Channel: The Linux Page - width
Viewing all articles
Browse latest Browse all 20

HTML background that fits the screen

$
0
0

You can actually define an image or a background (with CSS) that fits the area in which is it shown.

For a simple image use a width of 100%, then the browser computes the height for you.

<div class="header"><img src="images/background.png" width="100%"></div>

This code will make the image width match the width of the <div> tag. Assuming the <div> tag fits the screen width, it will show in the full width, stretching as required.

When trying to do that with a background image in CSS, you want to use the background-size parameter ...

Details
Operating System: 
Drupal
Category: 
Development
Mode: 
Browser

read more


Viewing all articles
Browse latest Browse all 20

Trending Articles