一个有趣的例子: use css media query
Last active
August 29, 2015 14:17
-
-
Save FrankFan/ca4d013921c06eb63e0a to your computer and use it in GitHub Desktop.
demo of @media query
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<div class="cat"></div> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
.cat{ | |
width: 900px; | |
height: 500px; | |
} | |
@media screen and (min-width: 850px) { | |
.cat{ background:url(http://images.cnitblog.com/blog2015/405426/201503/030950092231183.png) no-repeat} | |
} | |
@media (min-width: 500px) and (max-width: 850px) { | |
.cat{ background:url(http://images.cnitblog.com/blog2015/405426/201503/030950358798105.png) no-repeat} | |
} | |
@media (max-width: 500px) { | |
.cat{ background:url(http://images.cnitblog.com/blog2015/405426/201503/030951245513470.png) no-repeat} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment