Using media types in CSS you can have a page one layout for screen, another one for print, and one for devices, etc.. Some CSS properties are designed only for a certain medias and other properties can be used more than one media like screen and print media, but maybe with different values.
Ex. the @media Rule allows having a different style rule for each media inside the same style shoot.
In the example below the browser will display 16 pixels Times font on the screen. But The printing will be in 12 pixels Verdana font. The font is set to bold, for both screen and printin:
<html>
<head>
<style>
@media screen
{
p.test {font-family:Times,sans-serif;font-size:16px;}
}
@media print
{
p.test {font-family: verdana,serif;font-size:12px;}
}
@media screen,print
{
p.test {font-weight:bold;}
}
</style>
</head>
<body>
....
</body>
</html>
CSS Media Types
Using media types in CSS you can have a page one layout for screen, another one for print, and one for...
css media types
&nsbp;
#3
Posted 26 November 2012 - 09:26 AM
Each CSS property definition specifies which media types the property applies to. Since properties generally apply to several media types, the "Applies to media" section of each property definition lists media groups rather than individual media types. Each property applies to all media types in the media groups listed in its definition.
1 user(s) are reading this topic
0 members, 1 guests, 0 anonymous users