开发者

CSS orientation media query

开发者 https://www.devze.com 2023-02-26 18:57 出处:网络
Can some one explain to me what the orientation media feature does in layman\'s 开发者_开发知识库terms?It\'s mainly for mobile devices like a phone. You can control the style based on whether the devi

Can some one explain to me what the orientation media feature does in layman's 开发者_开发知识库terms?


It's mainly for mobile devices like a phone. You can control the style based on whether the device is being held upright, or sideways ...

@media all and (orientation:portrait)
{
  /* Your CSS here */
}

 

@media all and (orientation:landscape)
{
  /* Your CSS here */
}


Assuming you are asking about the media attribute in the link tag please find the answer below.

Media is to tell the browser or the device to pick the right stylesheet for that particular device or an action.

Eg. if a style sheet is linked with media as Print the stylesheet will work only when the page is been printed. This way you can minimise the graphic and media involved in the page for print purposes.

in simple terms it is a if conditions for stylesheet.

you have the following media types.

Screen - obviously computer browser screen. ttv - teletype tv- television projection - projectors handheld - small screen handheld devices print - for printer braille - Braille feedback devices aural - Speech synths all - picks the same stylesheets for all the above.

Hope this helps...

0

精彩评论

暂无评论...
验证码 换一张
取 消