CodeLab
Show Output
 
xxxxxxxxxx
14
 
1
<!DOCTYPE html>
2
<html lang="en">
3
<head>
4
    <title>Specify Multiple Source for Images in HTML</title>
5
</head>
6
<body>
7
    <picture>
8
        <source media="(min-width: 1000px)" srcset="/examples/images/logo-large.png">
9
        <source media="(max-width: 500px)" srcset="/examples/images/logo-small.png">
10
        <img src="/examples/images/logo-default.png" alt="My logo">
11
    </picture>
12
    <p><strong>Note:</strong> Open the output in a new blank tab (Click the arrow next to "Show Output" button) and resize the browser window to understand how it actually works.</p>
13
</body>
14
</html>
 

在微博、微信、公众号、小程序分享此示例。 如果您觉得有帮助,请给我们一个赞。