Jump to content

Width = 70% viewport


Sunamena

Recommended Posts

Greetings,



Question 1: I want a width of example: 70% on my viewport, resizing will not alter the wiidth. I tried 70vw, but this did not do the trick. How can i achieve this?

Question 2: When my screen gets smaller, I want to change the % used on certain DIV widths, how can I achieve this?


Thanks in advance =D

Link to comment
Share on other sites

You cant change viewport width of a device :-), only html elements, any element given 70vw will always be 70% of total width device viewing area.

 

You would have use media queries to adjust percentage width depending of device viewport width.

Link to comment
Share on other sites

vw = viewport width

vh = viewport height

 

70vw, 70vh = 70% width and height of viewport area size.

 

Ah thanks, more modern secret codes.

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...