âš ī¸ Warning âš ī¸ Deprecated Code! This video tutorial contains outdated code.
💡 If you wish to update it, any AI assistant will update the code for you in seconds.

Background Size Scale Stretch Image

Published : November 17, 2014   •   Last Edited : November 24, 2025   •   Author : Adam Khoury
Learn to create backgrounds for HTML documents that scale and stretch to fit into the user screen regardless of the type of device they are viewing your page with.
<!DOCTYPE html>
<html>
<head>
<style>
body {
	background:url(dynamic_width_bg.jpg) #A98436 no-repeat left top;
	background-size: 100%;
}
</style>
</head>
<body>
<h1>My page with 100% width background image</h1>
</body>
</html>