Liên kết tới file css theo media="print"

HTML viết như sau:

<p class="screen">Text hiển thị.</p>

CSS viết như sau:

p.media {
	color: red;
}

Hiển thị trên trình duyệt (layout)

Text hiển thị.

Hiển thị trên trang print

Để xem trang print, bạn chọn trên trình duyệt (firefox hay IE): file/Print Preview.

Khi xem dạng print, chúng ta sẽ thấy dòng text: "Text hiển thị" sẽ có màu đỏ.