Created
August 23, 2013 09:35
-
-
Save swaydeng/6317395 to your computer and use it in GitHub Desktop.
media query demo 评选方案真实代码
This file contains 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
.w990, | |
.w952, | |
.screen, | |
.layout-col .grid, | |
#alibar-v4 .alibar-container, | |
#footer div#footer-v0 { | |
width: 990px; | |
} | |
.arrow-r { | |
display: block; | |
} | |
.region-screen1st .r-main { | |
width: 990px; | |
} | |
#header .ali-nav-category .cat-title { | |
cursor: pointer; | |
} | |
.mod-category { | |
display: none; | |
position: absolute; | |
} | |
.mod-banner, | |
.mod-banner .content, | |
.mod-banner .content a { | |
width: 750px; | |
} | |
.mod-floor1 .offer .wrap { | |
width: 780px; | |
} | |
.mod-floor1 .list li { | |
padding: 0 12px; | |
} | |
.mod-floor2 .banner { | |
margin-right: 10px; | |
} | |
.mod-floor2 .offer { | |
margin-right: 0; | |
} | |
.mod-floor2 .offer .wrap { | |
width: 780px; | |
} | |
.mod-floor2 .list li { | |
padding: 0 12px; | |
} | |
.mod-floor2 .brand li { | |
float: left; | |
padding: 4px 22px; | |
} | |
.mod-active .offer { | |
margin: 0 25px; | |
width: 920px; | |
} | |
.mod-active .list li { | |
float: left; | |
padding: 0 5px; | |
} | |
@media (max-width: 1280px) { | |
.w990, | |
.w952, | |
.screen, | |
.layout-col .grid, | |
#alibar-v4 .alibar-container, | |
#footer div#footer-v0 { | |
width: 1190px; | |
} | |
.arrow-r { | |
display: block; | |
} | |
.region-screen1st .r-main { | |
width: 990px; | |
} | |
.mod-category { | |
position: relative; | |
display: block!important; | |
} | |
.mod-banner, | |
.mod-banner .content, | |
.mod-banner .content a { | |
width: 750px; | |
} | |
.mod-floor1 .offer .wrap { | |
width: 980px; | |
} | |
.mod-floor1 .list li { | |
padding: 0 12px; | |
} | |
.mod-floor2 .banner { | |
margin-right: 2px; | |
} | |
.mod-floor2 .offer .wrap { | |
margin-right: 2px; | |
width: 776px; | |
} | |
.mod-floor2 .list li { | |
padding: 0 12px; | |
} | |
.mod-floor2 .brand li { | |
float: none; | |
padding: 2px 4px; | |
} | |
.mod-active .offer { | |
margin: 0 20px; | |
width: 1150px; | |
} | |
.mod-active .list li { | |
padding: 0 5px; | |
} | |
} | |
@media (max-width: 1440px), (min-width: 1440px) { | |
.w990, | |
.w952, | |
.screen, | |
.layout-col .grid, | |
#alibar-v4 .alibar-container, | |
#footer div#footer-v0 { | |
width: 1390px; | |
} | |
.region-screen1st .r-main { | |
width: 1190px; | |
} | |
.arrow-r { | |
display: none; | |
} | |
.mod-category { | |
position: relative; | |
display: block!important; | |
} | |
.mod-banner, | |
.mod-banner .content, | |
.mod-banner .content a { | |
width: 950px; | |
} | |
.mod-brand-activity .content { | |
width: 1190px; | |
} | |
.mod-floor1 .offer .wrap { | |
margin: 0 8px; | |
width: 1164px; | |
} | |
.mod-floor1 .list li { | |
padding: 0 12px; | |
} | |
.mod-floor2 .banner { | |
margin-right: 5px; | |
} | |
.mod-floor2 .offer .wrap { | |
margin-right: 5px; | |
width: 970px; | |
} | |
.mod-floor2 .list li { | |
padding: 0 12px; | |
} | |
.mod-floor2 .brand li { | |
float: none; | |
padding: 2px 4px; | |
} | |
.mod-active .offer { | |
margin: 0 5px; | |
width: 1380px; | |
} | |
.mod-active .list li { | |
padding: 0 5px; | |
} | |
} | |
.max1280 .w990, | |
.max1280 .w952, | |
.max1280 .screen, | |
.max1280 .layout-col .grid, | |
.max1280 #alibar-v4 .alibar-container, | |
.max1280 #footer div#footer-v0 { | |
width: 1190px; | |
} | |
.max1280 .arrow-r { | |
display: block; | |
} | |
.max1280 .region-screen1st .r-main { | |
width: 990px; | |
} | |
.max1280 .mod-category { | |
position: relative; | |
display: block!important; | |
} | |
.max1280 .mod-banner, | |
.max1280 .mod-banner .content, | |
.max1280 .mod-banner .content a { | |
width: 750px; | |
} | |
.max1280 .mod-floor1 .offer .wrap { | |
width: 980px; | |
} | |
.max1280 .mod-floor1 .list li { | |
padding: 0 12px; | |
} | |
.max1280 .mod-floor2 .banner { | |
margin-right: 2px; | |
} | |
.max1280 .mod-floor2 .offer .wrap { | |
margin-right: 2px; | |
width: 776px; | |
} | |
.max1280 .mod-floor2 .list li { | |
padding: 0 12px; | |
} | |
.max1280 .mod-floor2 .brand li { | |
float: none; | |
padding: 2px 4px; | |
} | |
.max1280 .mod-active .offer { | |
margin: 0 20px; | |
width: 1150px; | |
} | |
.max1280 .mod-active .list li { | |
padding: 0 5px; | |
} | |
.max1440 .w990, | |
.max1440 .w952, | |
.max1440 .screen, | |
.max1440 .layout-col .grid, | |
.max1440 #alibar-v4 .alibar-container, | |
.max1440 #footer div#footer-v0 { | |
width: 1390px; | |
} | |
.max1440 .region-screen1st .r-main { | |
width: 1190px; | |
} | |
.max1440 .arrow-r { | |
display: none; | |
} | |
.max1440 .mod-category { | |
position: relative; | |
display: block!important; | |
} | |
.max1440 .mod-banner, | |
.max1440 .mod-banner .content, | |
.max1440 .mod-banner .content a { | |
width: 950px; | |
} | |
.max1440 .mod-brand-activity .content { | |
width: 1190px; | |
} | |
.max1440 .mod-floor1 .offer .wrap { | |
margin: 0 8px; | |
width: 1164px; | |
} | |
.max1440 .mod-floor1 .list li { | |
padding: 0 12px; | |
} | |
.max1440 .mod-floor2 .banner { | |
margin-right: 5px; | |
} | |
.max1440 .mod-floor2 .offer .wrap { | |
margin-right: 5px; | |
width: 970px; | |
} | |
.max1440 .mod-floor2 .list li { | |
padding: 0 12px; | |
} | |
.max1440 .mod-floor2 .brand li { | |
float: none; | |
padding: 2px 4px; | |
} | |
.max1440 .mod-active .offer { | |
margin: 0 5px; | |
width: 1380px; | |
} | |
.max1440 .mod-active .list li { | |
padding: 0 5px; | |
} |
This file contains 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
// define some useful strings globally | |
@mq1440: ~"(max-width: 1440px)"; | |
@mq1280: ~"(max-width: 1280px)"; | |
@mq1024: ~"(max-width: 1024px)"; | |
// class set that need apply under media query conditions. | |
.clzset1024 () { | |
.w990, | |
.w952, | |
.screen, | |
.layout-col .grid, | |
#alibar-v4 .alibar-container, | |
#footer div#footer-v0 { | |
width: 990px; | |
} | |
.arrow-r { | |
display: block; | |
} | |
.region-screen1st .r-main { | |
width: 990px; | |
} | |
#header .ali-nav-category .cat-title { | |
cursor: pointer; | |
} | |
.mod-category { | |
display: none; | |
position: absolute; | |
} | |
.mod-banner, | |
.mod-banner .content, | |
.mod-banner .content a { | |
width: 750px; | |
} | |
.mod-floor1 .offer .wrap { | |
width: 780px; | |
} | |
.mod-floor1 .list li { | |
padding: 0 12px; | |
} | |
.mod-floor2 .banner { | |
margin-right: 10px; | |
} | |
.mod-floor2 .offer { | |
margin-right: 0; | |
} | |
.mod-floor2 .offer .wrap { | |
width: 780px; | |
} | |
.mod-floor2 .list li { | |
padding: 0 12px; | |
} | |
.mod-floor2 .brand li { | |
float: left; | |
padding: 4px 22px; | |
} | |
.mod-active .offer { | |
margin: 0 25px; | |
width: 920px; | |
} | |
.mod-active .list li { | |
float: left; | |
padding: 0 5px; | |
} | |
} | |
.clzset1280 () { | |
.w990, | |
.w952, | |
.screen, | |
.layout-col .grid, | |
#alibar-v4 .alibar-container, | |
#footer div#footer-v0 { | |
width: 1190px; | |
} | |
.arrow-r { | |
display: block; | |
} | |
.region-screen1st .r-main { | |
width: 990px; | |
} | |
.mod-category { | |
position: relative; | |
display: block!important; | |
} | |
.mod-banner, | |
.mod-banner .content, | |
.mod-banner .content a { | |
width: 750px; | |
} | |
.mod-floor1 .offer .wrap { | |
width: 980px; | |
} | |
.mod-floor1 .list li { | |
padding: 0 12px; | |
} | |
.mod-floor2 .banner { | |
margin-right: 2px; | |
} | |
.mod-floor2 .offer .wrap { | |
margin-right: 2px; | |
width: 776px; | |
} | |
.mod-floor2 .list li { | |
padding: 0 12px; | |
} | |
.mod-floor2 .brand li { | |
float: none; | |
padding: 2px 4px; | |
} | |
.mod-active .offer { | |
margin: 0 20px; | |
width: 1150px; | |
} | |
.mod-active .list li { | |
padding: 0 5px; | |
} | |
} | |
.clzset1440 () { | |
.w990, | |
.w952, | |
.screen, | |
.layout-col .grid, | |
#alibar-v4 .alibar-container, | |
#footer div#footer-v0 { | |
width: 1390px; | |
} | |
.region-screen1st .r-main { | |
width: 1190px; | |
} | |
.arrow-r { | |
display: none; | |
} | |
.mod-category { | |
position: relative; | |
display: block!important; | |
} | |
.mod-banner, | |
.mod-banner .content, | |
.mod-banner .content a { | |
width: 950px; | |
} | |
.mod-brand-activity .content { | |
width: 1190px; | |
} | |
.mod-floor1 .offer .wrap { | |
margin: 0 8px; | |
width: 1164px; | |
} | |
.mod-floor1 .list li { | |
padding: 0 12px; | |
} | |
.mod-floor2 .banner { | |
margin-right: 5px; | |
} | |
.mod-floor2 .offer .wrap { | |
margin-right: 5px; | |
width: 970px; | |
} | |
.mod-floor2 .list li { | |
padding: 0 12px; | |
} | |
.mod-floor2 .brand li { | |
float: none; | |
padding: 2px 4px; | |
} | |
.mod-active .offer { | |
margin: 0 5px; | |
width: 1380px; | |
} | |
.mod-active .list li { | |
padding: 0 5px; | |
} | |
} | |
//Default Style | |
.clzset1024(); | |
//browsers that support mq | |
@media @mq1280 { | |
.clzset1280(); | |
} | |
@media @mq1440 ,(min-width: 1440px) { | |
.clzset1440(); | |
} | |
//browsers that don't support mq | |
.max1280 { | |
.clzset1280(); | |
} | |
.max1440 { | |
.clzset1440(); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment