Jump to content

How to keep viewport size and window size identical?

Is there a way to do that? I found it confusing when coding. 
I have two windows here, the 1st one is the template I downloaded online. The 2nd one is my own duplicate.

590c7ca39d49e_ScreenShot2017-05-05at6_53_02PM.thumb.png.e32e61afb61f9bcbedb1570ffb8a2f5e.png

The problem I am facing is the 1st one's viewport width is identical with its windows width, while the second one is not.
1.png.e37e6afd20693d2aabcbeff70f0f1193.png2.png.e6b9dbe11d6de4bcf737f197fd5be482.png

How do I set the second one so that the windows size = viewport size?

If it is not broken, let's fix till it is. 

Link to comment
Share on other sites

Link to post
Share on other sites

All my projects start with several default tags. This one goes in the head and it helps with most viewport and scaling issues you have when dealing with mobile devices and such

 

<meta name="viewport" content="initial-scale=1.0, user-scalable=no" />

 

I am good at computer

Spoiler

Motherboard: Gigabyte G1 sniper 3 | CPU: Intel 3770k @5.1Ghz | RAM: 32Gb G.Skill Ripjaws X @1600Mhz | Graphics card: EVGA 980 Ti SC | HDD: Seagate barracuda 3298534883327.74B + Samsung OEM 5400rpm drive + Seatgate barracude 2TB | PSU: Cougar CMX 1200w | CPU cooler: Custom loop

Link to comment
Share on other sites

Link to post
Share on other sites

(I guess) Window size is the size of the chrome Window on your monitor. The viewport is the part of chrome which is actually rendering the website. 

To make containers as big as your viewport you can use relative units like vh and vw

Link to comment
Share on other sites

Link to post
Share on other sites

3 minutes ago, Hazy125 said:

 

Thanks for the tip, I 've already included those, not working. 

Also there shouldn't be a / at the end of the code. 

If it is not broken, let's fix till it is. 

Link to comment
Share on other sites

Link to post
Share on other sites

Just now, mrchow19910319 said:

Thanks for the tip, I 've already included those, not working. 

Also there shouldn't be a / at the end of the code. 

The meta tage, like br and input tags are self closing or void tags. If you're using HTML5 which you should be it's the current spec, it doesn't matter if you have the tag like this <br> or like this <br />. Both are valid. But if you want to use earlier than HTML5 or XHTML, the spec for that version required the slash. So having the slash is always valid no matter what standards you're coding to and what browsers people are using to view your site(there are plenty of older browsers that have never heard of HTML5)... So yeah, I try and always make sure I close void tags that way when I can

I am good at computer

Spoiler

Motherboard: Gigabyte G1 sniper 3 | CPU: Intel 3770k @5.1Ghz | RAM: 32Gb G.Skill Ripjaws X @1600Mhz | Graphics card: EVGA 980 Ti SC | HDD: Seagate barracuda 3298534883327.74B + Samsung OEM 5400rpm drive + Seatgate barracude 2TB | PSU: Cougar CMX 1200w | CPU cooler: Custom loop

Link to comment
Share on other sites

Link to post
Share on other sites

1 minute ago, Hazy125 said:

 

Oh... didn't know that. opps. sry

If it is not broken, let's fix till it is. 

Link to comment
Share on other sites

Link to post
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

×