jcp
jcp

Reputation: 11

CSS orientation media query

Can some one explain to me what the orientation media feature does in layman's terms?

Upvotes: 1

Views: 1217

Answers (2)

musaul
musaul

Reputation: 2341

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 */
}

Upvotes: 3

Karthik
Karthik

Reputation: 1091

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...

Upvotes: 1

Related Questions