Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What is definition of "viewport" on CSS? [closed]

Tags:

I want to do responsive design for my website. I am confused about adding @media and @import in CSS.

What is the definition of "viewport" in CSS? How to measure the viewpoint of smartphones and iPad or iPhone?

like image 432
Steven Sugiarto Wijaya Avatar asked Apr 21 '16 09:04

Steven Sugiarto Wijaya


2 Answers

Viewport is browser area visible to user or you can say window visible to user.

If you want to target media queries, go through mydevice.io. For mobiles and tables use device width to write the media query.

But I will prefer to use write media queries using either min-width or max-width. Use breakpoints.

@import is to import the css

@media is to write media queries not only for responsive but you can write print media queries and lot more

like image 120
murli2308 Avatar answered Nov 15 '22 04:11

murli2308


This is a detailed explanation of what you wanted to know. The Viewport

If you are using chrome then follow the following steps to get the viewport of any device

Press F12 > then click on toggle device mode (its on the top right corner of the window that will appear after pressing F12) > from the drop down menu select the desired device then you can get your viewport's width and height

like image 35
Rasik Avatar answered Nov 15 '22 04:11

Rasik