日期:2013-11-13  浏览次数:21159 次

网页制造aiyiweb文章简介:使用em单位创建CSS3的Media Queries.

本站有关于CSS3的Media Queries的相关教程有不少,说直一点,就是使用Media Queries来制造Responsiv Desgin。如今国外流行的一种设计叫Responsive Design(国内称为呼应式设计),其中这种规划关键之处就是不能少了Media Queries的配合,早在《CSS3 Media Queries模板》一文中就给大家引见了常用的模板,但有很多评论和论坛中说使用px为单位写呼应式规划,会形成断点,那么今天给大家贴上一段使用“em”为单位的Media Queries模板代码片段:

/* ===== == = === 20em (320px) === = == ===== */  @media only screen and (min-width : 20em) {  }   /* ===== == = === 30em (480px) === = == ===== */  @media only screen and (min-width : 30em) {  }   /* ===== == = === 37.5em (600px) === = == ===== */  @media only screen and (min-width: 37.5em) {  }   /* ===== == = === 48em (768px) === = == ===== */  @media only screen and (min-width : 48em) {  }   /* ===== == = === 56.25em (900px) === = == ===== */  @media only screen and (min-width : 56.25em) {  }   /* ===== == = === 68.75em (1100px) === = == ===== */  @media only screen and (min-width : 68.75em) {  }   /* ===== == = === 81.25em (1300px) === = == ===== */  @media only screen and (min-width : 81.25em) {  }