The inline-block element cannot be placed on one line. Font-size:0, has been set up and initially suspected that height:100vh caused it.

the code is as follows:

   

solve: why not on the same line?

Mar.10,2021

intra-line block-level elements have gaps
method one does not wrap
< div class= "site-page" >

    <div class="site-nav"></div><div class="site-body"></div>

< / div >
if you must wrap the line in order to be beautiful
connect
< div class= "site-page" > with comments

    <div class="site-nav"></div><!--
    --><div class="site-body"></div>

< / div >
Please search for other methods


first of all, let's say that it has nothing to do with hight:100vh.
vw is relative to the width of the window. The width of "window" is 100vw, and "window" refers to the size of the visual area inside the browser, that is, window.innerWidth,. I just tested it on my browser as 1186
if you put

.site-page .site-nav {
    width:100%;
}

look at the width of the first box (that is, the width of body). Here is 1169, which shows that 100vw is not the width of body, so the second box will squeeze down. If you set the width of the second box to calc (100vw-347px), the two boxes will be on one line.

.site-page .site-body {
       width: calc(100vw - 347px);
       }

in this case, the width of the two boxes plus magin is the width of body, but not 100vw.
the two are different.


.site-page {
    height: 100vh;
    width: 100vw; // 
    font-size: 0;
}
MySQL Query : SELECT * FROM `codeshelper`.`v9_news` WHERE status=99 AND catid='6' ORDER BY rand() LIMIT 5
MySQL Error : Disk full (/tmp/#sql-temptable-64f5-1b37dc2-2ae0f.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
MySQL Errno : 1021
Message : Disk full (/tmp/#sql-temptable-64f5-1b37dc2-2ae0f.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
Need Help?