内容不会显示在所有,或离开<section>
元素周围的空白。部门元素不显示任何内容和/或有空格周围
这是与通过默认设置display: inline-block
风格做。所以我试图通过在所有子元素上设置display: block;
来覆盖该值,导致<section>
根本不显示在网站上。
所以,我该如何把它弄到一起。并删除空白。
下面是摘录:
* {
margin: 0;
padding: 0;
}
header, section, footer, aside, nav, article, hgroup {
display: inline-block;
}
html {
height: 100vh;
}
body {
font-family: 'Archivo Narrow', sans-serif;
width: 100%;
height: 100vh;
}
html, body {
overflow: hidden;
}
/* Main Content Page */
main {
width: 100%;
height: 100vh;
display: flex;
flex-wrap: wrap;
justify-content: center;
}
header {
width: 100%;
height: 18vh;
background-color: orange;
}
aside {
width: 20%;
height: 82vh;
background-color: orange;
}
section {
width: 79%;
height: 82vh;
background-color: darkgrey;
box-shadow: 5px 5px 5px inset;
}
<main id="content">
<header>
\t <h1>Just a random Header</h1>
</header>
<aside>
\t <p>Just alot of Random Text, Just alot of Random Text, Just alot of Random Text, Just alot of Random Text, Just alot of Random Text</p>
</aside>
<section>
\t <p>Just alot of Random Text, Just alot of Random Text, Just alot of Random Text, Just alot of Random Text, Just alot of Random Text</p>
\t <p>Just alot of Random Text, Just alot of Random Text, Just alot of Random Text, Just alot of Random Text, Just alot of Random Text</p>
\t <p>Just alot of Random Text, Just alot of Random Text, Just alot of Random Text, Just alot of Random Text, Just alot of Random Text</p>
\t <p>Just alot of Random Text, Just alot of Random Text, Just alot of Random Text, Just alot of Random Text, Just alot of Random Text</p>
</section>
</main>
奇怪的是,无论是片段或Codepen显示这个问题,所以这里是一个截图显示的问题,无论是在Firefox和Chrome:
你为什么不离开'宽度:80%'在PaulieD的回答'section'为您刚才的问题? –
在80%离开它意味着没有在浏览器上都显示,如果你看看上的评论有迹象表明截图,这又是:https://i.imgsafe.org/631ba0d94e.png –
Ricky
哦。那是因为'inline-block'。它增加了额外的空白。你可以改变你的HTML,以便在一旁,部分申报单,接连像来的权利之一,所以''不“进入”特征线或空格 –