CSS - 导致空白的原因(CSS - What is causing the Whitespace)
当我将图像插入
<aside>
元素时,它现在将<section>
元素“推”到屏幕上大约50%,这会在屏幕上留下50%的空白,我完全不知道是什么导致它,开发者控制台没有选择任何错误,但在我的所有浏览器上:Firefox,Chrome,Edge,都用这个空白显示它。以下是该问题的屏幕截图:
。
这是一个片段:
* { margin: 0; padding: 0; } header, section, footer, aside, nav, article, hgroup { display: inline-block; } html { height: 100vh; } body { font-family: 'Archivo Narrow', sans-serif; margin: 0 auto; width: 100%; height: 100vh; } html, body { overflow: hidden; } /* Main Content Page */ main { width: 100%; height: 100vh; } header { width: 100%; height: 18vh; background-color: orange; } aside { width: 20%; height: 82vh; background-color: orange; } .hello { width: 70%; height: 40vh; } section { width: 80%; height: 82vh; background-color: darkgrey; box-shadow: 5px 5px 5px inset; }
<body> <main id="content"> <header> <h1>Just a random Header</h1> </header> <aside> <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> <img src="Images/Businessman/Hello.png" alt="Welcome" class="hello" /> </aside><!-- This comment is to help remove the whitespace between these elements :/ --><section> <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> <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> <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> <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><!-- This comment is to help remove the whitespace between these elements :/ --></main> <script src="script.js"></script> </body> </html>
When I insert an image into the
<aside>
element, it now "pushes" the<section>
element roughly 50% down on the screen, this leaves 50% of whitespace on the screen, I have absolutely no idea what is causing it, the Dev console doesn't pick any errors up, Yet on all my browsers: Firefox, Chrome, Edge, all display it with this whitespace.Here is a screenshot of the issue:
.
And here is a snippet:
* { margin: 0; padding: 0; } header, section, footer, aside, nav, article, hgroup { display: inline-block; } html { height: 100vh; } body { font-family: 'Archivo Narrow', sans-serif; margin: 0 auto; width: 100%; height: 100vh; } html, body { overflow: hidden; } /* Main Content Page */ main { width: 100%; height: 100vh; } header { width: 100%; height: 18vh; background-color: orange; } aside { width: 20%; height: 82vh; background-color: orange; } .hello { width: 70%; height: 40vh; } section { width: 80%; height: 82vh; background-color: darkgrey; box-shadow: 5px 5px 5px inset; }
<body> <main id="content"> <header> <h1>Just a random Header</h1> </header> <aside> <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> <img src="Images/Businessman/Hello.png" alt="Welcome" class="hello" /> </aside><!-- This comment is to help remove the whitespace between these elements :/ --><section> <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> <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> <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> <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><!-- This comment is to help remove the whitespace between these elements :/ --></main> <script src="script.js"></script> </body> </html>
原文:https://stackoverflow.com/questions/39897303
最满意答案
当然VA是作为可视工作室附加组件实现的,我想这可以访问某种视觉工作室API,我想这会暴露代码编辑器内容等内容。
有关详细信息,请参阅此链接: http : //www.microsoft.com/downloads/details.aspx? FamilyId = 59EC6EC3-4273-48A3- BA25-DC925A45584D& displaylang = en
心连心
surely VA is implemented as a visual studio add-on, which i guess would have access to some sort of visual studio API which i suppose would expose stuff like code editor content etc.
see this link for more info: http://www.microsoft.com/downloads/details.aspx?FamilyId=59EC6EC3-4273-48A3-BA25-DC925A45584D&displaylang=en
hth
相关问答
更多-
Eclipse Code Recommenders项目包括子词完成 ,这似乎正是您正在寻找的。 The Eclipse Code Recommenders project includes subwords completion which seems to be exactly what you are looking for.
-
伙计,你不在“代码”区域; 你正在尝试在一个领域进行代码完成 - 它期待一种类型。 在方法中尝试: public call Test { String str_test = "hello world"; void someMethod() { str_tes|... <-- it will complete this } 奥卡姆剃刀 - 选择: Eclipse的一个基本功能不起作用,但尽管每天都有无数的程序员使用Eclipse,没有人抱怨它或创建了一个错误报告,但 ...
-
间距在VA Snippets中定义,其标题以“Refactor”开头 - 请参阅VA 文档中的“编辑VA Snippets”。 在这里和这里 ,整个番茄支持论坛也提出了类似的问题。 The spacing is defined in the VA Snippets whose titles start with "Refactor" - see "Editing VA Snippets" in the VA documentation. Similar questions have been raised ...
-
选择类变量,然后从上下文菜单中选择Refactor(VA X) - > Encapsulate Field 。 您可以通过修改Refactor Encapsulate Field代码段来自定义格式。 您可以在此处找到有关自定义代码段的更多信息 。 我个人使用的片段与doxygen文档存根一起产生类似Java的访问器: //! \return $end$$SymbolType$ get$GeneratedPropertyName$() const { return $SymbolName$; } / ...
-
VS 2013可以使用默认片段为enum构建一个switch语句。 (注意:使用默认的VS片段,而不是VA片段。) 当你输入“swit”时,接受来自VS的建议代码片段。 将“switch_on”替换为您的枚举,然后按Enter键。 您的声明将会扩大。 (如果从列表框中选择了枚举,则需要两个输入。) VS 2013 can build a switch statement for an enum using a default snippet. (Note: use a default VS snippet, ...
-
如何使用Visual Assist“转到定义”函数?(How to “Go to definition” of a function using Visual Assist?)[2021-08-07]
感谢Whole Tomato Software支持团队,我得到了一张票的答案。 使用文本输入进行“ 转到定义 ”的键盘快捷键是: Alt + Shift + S. 它非常快速和准确。 要获得完全匹配或严格匹配,请使用.symbolname. 在查找符号提示中作为文本输入。 Thanks to the Whole Tomato Software support team, I got the answer upon raising a ticket. Keyboard shortcut to "Go To D ... -
我看到的唯一简单(但丑陋的方法)是添加一些预处理器指令,以使Visual Studio忽略它 #if 0 /*! your comment */ #endif 您可能希望在#endif之后添加一些内容,以便您可以通过研究轻松删除它,并在不删除所需内容的情况下进行替换。 至少在VS2013中,它忽略了#if 0块。 有了这个,你应该可以把它们放在同一个文件中,这样可以减轻痛苦。 The only simple (but ugly way) I see is to add some preprocessor ...
-
有人使用Visual Assist吗?(Anyone using Visual Assist? How does VA get the source code content?)[2022-09-18]
当然VA是作为可视工作室附加组件实现的,我想这可以访问某种视觉工作室API,我想这会暴露代码编辑器内容等内容。 有关详细信息,请参阅此链接: http : //www.microsoft.com/downloads/details.aspx? FamilyId = 59EC6EC3-4273-48A3- BA25-DC925A45584D& displaylang = en 心连心 surely VA is implemented as a visual studio add-on, which i gue ... -
我一直认为每个用户而不是每个机器的许可证更加公平,因为就像多车保险政策一样,你可能会在两个安装之间分配时间而不是同时使用它们。 然而,在软件的情况下,这并不像驾驶汽车那样明显。 执行每用户许可证也是无法实现的,而每台机器许可在很大程度上是可行的。 无论如何, Whole Tomato采购常见问题解答说明在Visual Assist X的情况下,许可是按用户: 我想在我的桌面和笔记本电脑上使用Visual Assist X. 我需要两个许可证吗? 没有.Visual Assist X按用户许可; 欢迎您使用单 ...
-
虽然功能有限,VA也可以与VC6配合使用。 但我不认为有更好的选择。 VA works with VC6 also, though functionality is limited. But I don't think there is a better alternative.