CYBER@GARDEN

『Web標準の教科書』各章

home > 『Web標準の教科書』読者サポートページ > 第3章 第15節

第3章 第15節(p.284-295)

body {
  color: navy;
  background: silver;
  }

@media print {
  body {
    color: black;
    background: white;
    }
  }
body {
  color: navy;
  background: silver;
  }

@media print, handheld {
  body {
    color: black;
    background: white;
    }
  }
<link rel="stylesheet" type="text/css" href="./css/default.css" />
<style type="text/css" media="screen, tv">
body {
  color: navy;
  background: silver;
  }
</style>
@import url("./css/default.css");
@import url('./css/default.css');
@import url(./css/default.css);
@import "./css/default.css";
@import './css/default.css';
<style type="text/css">
@import url("./css/default.css");
</style>
@import url("./css/default.css");
@import url("./css/default.css");
@import url("./css/print.css");
@import url("./css/default.css") screen, tv;
@import url("./css/print.css") print;
@import url("./css/default.css") screen, tv;
@import url("./css/print.css") print;
body {
  color: navy;
  background: silver;
  }
[悪いソース]
@import url("./css/default.css") screen, tv; p.desc { body { color: navy; background: silver; } @import url("./css/print.css") print;
[悪いソース]
@import url("./css/default.css") screen, tv; @media print { @import url("./css/print.css"); body { color: black; background: white; } }
@charset "Shift_JIS";

body {
  color: navy;
  background: silver;
  }
@page {
  size: 297mm 210mm;
  margin: 10mm; }
<style type="text/css" media="screen, print">
@font-face {
  font-family: "Robson Celtic";
  src: url("http://site/fonts/rob-celt")
  }
h1 { font-family: "Robson Celtic", serif }
</style>
<link rel="stylesheet" type="text/css" href="./css/default.css" />
<link rel="stylesheet" type="text/css" href="./css/preferred.css"
title="preferred" />
<link rel="alternate stylesheet" type="text/css"
href="./css/alternate.css" title="alternate" />
<?xml-stylesheet type="text/css" alternate="no"
href="./css/default.css"?>
<?xml-stylesheet type="text/css" alternate="no"
href="./css/preferred.css" title="preferred"?>
<?xml-stylesheet type="text/css" alternate="yes"
href="./css/alternate.css" title="alternate"?>
body {
  color: black !important;
  background: white !important;
  font-size: large !important;
  }
table  { border: 2px solid black !important }
th, td { border: 1px solid gray !important }
a      { text-decoration: underline !important }
img    { border: 1px solid #f00 !important }