css3 ??? ????? ??
css3? ??? ?? ??? ?? ??? ??:
?? ?? ?? ????? ????? ??? ????? ???? ??? ?? ?? ? ?? ?????.
??? ????? ?? ???? ??? ?????? ???? ? ??? ? ??? ?????(??? ?? ???? ???? ?? ? ??).
??? ???? ??? ??? ??? ??? ?? ?????? ?? ??? ???? ?? ???, ??? ?? ????? ? ???? ????? ????? ???.
??? ?? ??? ?? ??? ???? ? ??? ? ????. ???? ??? ??? ???????.
1. CSS2? ??? ??:
??? CSS2?? ??? ?? ?? ????? ??? ??? ?????. ?? ??? ?????.
<link href="css/reset.css" rel="stylesheet" type="text/css" media="screen" /> <link href="css/style.css" rel="stylesheet" type="text/css" media="all" /> <link href="css/print.css" rel="stylesheet" type="text/css" media="print" />
? ??? ?? ??? ? ?? ??? ??? ?? ? ?? CSS ??? ?????. ??? ???.
2. ??? ?? ?? ??:
????? CSS ??? ??? ??? ??? ???? ??? ??? ????.
?? ?? ??:
<link href="css/reset.css" rel="stylesheet" type="text/css" media="screen" />
xml ?? ??:
<?xml-stylesheet rel="stylesheet" media="screen" href="css/style.css" ?>
@ ??? ???? ??:
@import url("css/reset.css") screen;
CSS ??? ??:
@media screen{ 選擇器{ 屬性:屬性值; } }
??? ??? ??:
<style type="text/css" media="screen"> /*code*/ </style>
3. ??? ?? ??:
Css2? ??? ??? ?? ???? ??? ??? ??? ? ????.
CSS3? ??? ???? ??? ???? ??? ??? ???? ?? ??? ??? ??????.
?? ?? ??? ???:
<link rel="stylesheet" media="screen and (max-width: 600px)" href="softwhy.css" />
??? ??? 600px ???? ??? ???? Softwhy.,css? ?????. ?? ??:
??? ??? ? ?? ?? ??(?: ?? ?? ??)? ???? ?? ??? ???? ?????.
??? ?? ??, @media ?? ? ?? ??? ??? ??? ??? ???? ??? ???? ??? ?????.
(1). ??? ??:
@media all and (min-width:800px) { /*code*/ }
?? ?? ?? ??? 800??? ?? ??? ?? CSS ??? ?????.
?? ?? ??: ??? ??? all? ?? all? ?? ????, ?? ??? ??? ????.
@media (min-width:800px) { /*code*/ }
(2) ??? ?? ??:
@media (min-width:800px) and (max-width:1200px) { /*code*/ }
(3) . ? ? ??:
and? ??? ??? ????? ?? ???? ? ?????. ??? ??? ????.
@media screen (min-width:800px) and (max-width:1200px) { /*code*/ }
??? 800px ?? 1200px ??? ??, ?? CSS ??? ?????.
(4).or ???:
or? ??? ??? ???? ? ??? ??? ?? ???? ? ?????.
@media screen (min-width:800px) or (orientation:portrait) { /*code*/ }
?? ??? ?? 800px? ??? ??? ??? ?? ?? CSS ??? ?????.
(5).not ???:
not? ??? ??? ???? ?? ? ??? ? ??? ???? ? ?????.
@media not print{ /*code*/ }
??? ??? ?? ?? ?? CSS ??? ?????.