How to Make Image Fit to Screen in HTML
In this article, you will learn how to create a full screen image using css.
The following example shows a full screen responsive image.
Demo - Full Screen ImageHow to create a full screen image.
To create a full screen image is easy using css height and width properties.
- Add css height property with its value set to 100% and also margin property with its value set to 0 to the <html> and <body> element using css.
<style> body,html { height: 100%; margin: 0; } </style>
- Create an <img> tag. Set height:100% and width:100% using css.
<style> img { width: 100%; height: 100%; } </style> <img src="https://stories.3schools.in/img/b.png">
Click on the Try it Yourself » button to edit the HTML code.
Demo - full screen image
<style> body,html { height: ; margin: 0; } img { width: 100%; height: 100%; } </style> <img src="https://stories.3schools.in/img/b.png">Try it Yourself »
save
listen
AI Answer
How to Make Image Fit to Screen in HTML
0
In this article, you will learn how to create a full screen image using css . The following…
asked
Apu
0 answers
2915
In this article, you will learn how to create a full screen image using css . The following…
Answer Link
answered
Apu