我有一个带导航栏的html5页面.完全划痕编码.我刚刚在项目中添加了一个doctype,现在我的导航栏下面有额外的空间.如果我删除doctype声明,它将恢复正常.我已经完全重置了所有内容的填充,边距等,并将其缩减为少量代码来说明问题.
该页面可以在http://hackthetruth.org/webdesign/broken上看到
有谁知道为什么声明doctype会弄乱div的高度?
一个简单的问题:为什么我能这样做
var start = function() {
$('#element').animate({}, 5000, 'linear', start);
}
Run Code Online (Sandbox Code Playgroud)
但不是这个
function start() {
$('#element').animate({}, 5000, 'linear', start());
}
Run Code Online (Sandbox Code Playgroud)
?
第一个工作完美,完成后重新启动动画.第二个简单地导致无限循环.
我一直在研究一些基于模板的CSS.不是我的选择,但这是我所拥有的.
在清理CSS的过程中(有人使用CSS预处理器将其列入列表,使其成为一个主要的PITA),我遇到了一个完全无法解释的CSS属性:nowhitespace.
在我所拥有的文档中,它nowhitespace: afterproperty;在单个规则中显示为并且经常重复多次.在浏览网页后,我发现这个神秘的属性在左右两侧的样式表中出现,但从未对它的作用或作者认为它做了什么做了一点解释.
所以,我在吸引你,Stackoverflow社区,请解释这个属性的来源,据我所知,它绝对没有任何东西,并且没有已知的浏览器识别.
在美化之后,这是我所拥有的文件的片段:
ul.nav a, ul.nav a:visited {
/* grouping these selectors makes sure that your links
retain their button look even after being visited */
padding: 5px 5px 5px 15px;
nowhitespace: afterproperty;
nowhitespace: afterproperty;
nowhitespace: afterproperty;
nowhitespace: afterproperty;
nowhitespace: afterproperty;
nowhitespace: afterproperty;
display: block; /* this gives the link block properties
causing it to fill the whole LI containing it. This
causes the entire area to react to a mouse click. */ …Run Code Online (Sandbox Code Playgroud)