Previous Next
HTML Responsive Web Design
What is Responsive Web Design?
Responsive Web Design is about using HTML and CSS to automatically resize, hide, shrink,
or enlarge, a website, to make it look good on all devices (desktops, tablets, and phones):
Try it Yourself »
Note: A web page should look good on any device!
T H E W O R L D ' S L A R G E S T W E B D E V E L O P E R S I T E
HTML CSS JAVASCRIPT MORE
HTML Responsive Web Design https://www.w3schools.com/html/html_responsive.asp
1 sur 16
23/01/2019 à 16:33
Without the viewport meta tag: With the viewport meta tag:
Setting The Viewport
When making responsive web pages, add the following <meta> element in all your web
pages:
This will set the viewport of your page, which will give the browser instructions on how to
control the page's dimensions and scaling.
Here is an example of a web page without the viewport meta tag, and the same web page
with the viewport meta tag:
Tip: If you are browsing this page on a phone or a tablet, you can click on the two
HTML Responsive Web Design https://www.w3schools.com/html/html_responsive.asp
2 sur 16
23/01/2019 à 16:33
links above to see the difference.
Responsive Images
Responsive images are images that scale nicely to fit any browser size.
Using the width Property
If the CSS width property is set to 100%, the image will be responsive and scale up and
down:
HTML Responsive Web Design https://www.w3schools.com/html/html_responsive.asp
3 sur 16
23/01/2019 à 16:33
HTML Responsive Web Design https://www.w3schools.com/html/html_responsive.asp
4 sur 16
23/01/2019 à 16:33
Notice that in the example above, the image can be scaled up to be larger than its original
size. A better solution, in many cases, will be to use the max-width property instead.
Using the max-width Property
If the max-width property is set to 100%, the image will scale down if it has to, but never
scale up to be larger than its original size:
HTML Responsive Web Design https://www.w3schools.com/html/html_responsive.asp
5 sur 16
23/01/2019 à 16:33
1 / 16 100%
La catégorie de ce document est-elle correcte?
Merci pour votre participation!

Faire une suggestion

Avez-vous trouvé des erreurs dans linterface ou les textes ? Ou savez-vous comment améliorer linterface utilisateur de StudyLib ? Nhésitez pas à envoyer vos suggestions. Cest très important pour nous !