很多人的HTML标记看起来像这样:
<html>
<body>
<div id="wrapper">
<p>Stuff in here</p>
</div>
</body>
</html>
Run Code Online (Sandbox Code Playgroud)
大多数情况下,在这里的示例或网络上,人们建议您应该将宽度设置应用于#wrapper,而不是<body>.
这有什么潜在的原因吗?
例如,在一篇关于优雅降级媒体查询的技术的文章中,并为您提供技术1的一些上下文:什么都不做:
房间里的大象是桌面的Internet Explorer.借助移动优先解决方案,大屏幕将在一列中显示内容,从而为用户带来痛苦的阅读体验,超过既定的最大舒适度:50到75个字符. 可能值得在主容器中设置max-width属性,然后在媒体查询中增加max-width.
他们的CSS:
#wrapper {
_width: 460px; /* Take that, IE6! */
max-width: 460px;
}
@media only screen and (width) {
#wrapper {
max-width: 1200px;
}
}
Run Code Online (Sandbox Code Playgroud)
以下是IE的结合方式(媒体查询已被注释掉).
是否有任何差异,而不是应用它#wrapper,我们会应用它<body>- 考虑到标准网站?
任何潜在的错误?我在这里尝试过,似乎没问题.如果布局变得更先进,那该怎么办...
<figure>元素的语义是否只包含一个<figcaption>?它确实验证了 ......
<figure>
<img src="example.jpg">
<figcaption>Image and caption</figcaption>
</figure>
<figure>
<figcaption>Caption only</figcaption>
</figure>
Run Code Online (Sandbox Code Playgroud)
在这种情况下,它会对CSS样式产生影响:
figure figcaption { color: red; }
Run Code Online (Sandbox Code Playgroud) 是否有官方API或半专业API在Yandex.com上进行搜索?
在iOS 6设备上,如iPhone和iPad,以及最新的Mac,在Apple的原生地图应用程序中打开了一个指向maps.apple.com/maps?q=cupertino的链接.
在非Mac计算机和其他设备上,它会导致使用maps.google.com/maps?q=cupertino.
对于开发人员来说,这是一个受欢迎的功能,但Google Maps是否支持Apple的API?
换句话说,以下所有Apple Maps参数是否完全转换为网络上Google地图中的内容?
q= The query parameter.
near= The location part of the query.
ll= The latitude and longitude points for the map center point.
sll= The latitude and longitude points from which a business search should be performed.
spn= The approximate latitude and longitude span.
sspn= A custom latitude and longitude span format used by Apple.
t= The type of map to display.
z= The zoom level. …Run Code Online (Sandbox Code Playgroud) 如果a <div>或任何其他元素跟随a <img>,则它们之间会出现~3px的空格 - 即使margins它们为零.
<img src="example-fractal-art.png">
<div>What is with that gap?<div>
Run Code Online (Sandbox Code Playgroud)
这是一些CSS的样子.

现在很容易display: block进入CSS并解决问题.但为什么会这样呢?没有计算的边距,填充,边框或类似的东西.
浏览器在做什么?有人甚至称它为"神奇".
我有一个可怕的,分散的页面,有很多JavaScript:
它有一个列表视图,如果您愿意,您可以详细查看列表中的一个项目.
现在的问题是,如果我想通过使用浏览器后退按钮从详细信息视图返回到列表视图,我会得到不同的结果.
在Chrome和Firefox中,即使在IE7中,我也会在我点击的地方结束,但在IE8中却不是这样.
为了让它更加混乱,如果我关闭JavaScript,它也适用于IE8.
问题是现在我现在不在哪里搜索.有人知道这个问题,或者至少是一个可能影响这个问题的JavaScript方法或函数吗?
javascript internet-explorer cross-browser internet-explorer-8
我真的不喜欢使用select/option元素进行链接:

但他们已经找到了进入设计师组合的方式作为一种选择,并尽可能地阻止他们使用它们,我知道如果没有谷歌的力量和"它对SEO的坏处"我将失去战斗.
我在网上搜索,找不到任何具体的支持或揭穿我的想法.
我写的选择列表将最终具有完全可访问性,后端脚本可以跟踪链接,但是有人知道搜索引擎是否会遵循或忽略URL?
<form action="/redirect-script" method="post">
<label for="url-selection">Redirect to: </label>
<select id="url-selection" name="url_redirect">
<option value="http://example.com/" >Example.COM</option>
<option value="http://example.net/" >Example.NET</option>
<option value="http://example.org/" >Example.ORG</option>
</select>
<input type="submit" value="Go to URL" />
</form>
Run Code Online (Sandbox Code Playgroud) 我通常使用以下链接实践,相对URL与绝对URL路径:
<a href="/relative/path/to/document.html">
Run Code Online (Sandbox Code Playgroud)
但我将实现绝对URL:
<a href="http://example.com/relative/path/to/document.html">
Run Code Online (Sandbox Code Playgroud)
对我来说,改变它们并不是问题(HTML文档中的自动查找和替换).
但是,确保它可以在我的localhost(支持PHP)以及Web上运行的最佳实践是什么?为什么?
例如,这里是我如何做PHP包括:
<?php include($_SERVER['DOCUMENT_ROOT']."/relative/path/to/document.html"); ?>
Run Code Online (Sandbox Code Playgroud)
对hrefURL 采用相同的方法?不同的PHP技术更好吗?很想知道为什么.
<table>
<tbody>
<tr>
<th>Phone</th>
<td>+1234567</td>
</tr>
<tr>
<th>Email</th>
<td><a href="mailto:name@example.com">name@example.com</a></td>
</tr>
<tr>
<th>Fax</th>
<td>+1234568</td>
</tr>
</tbody>
</table>
Run Code Online (Sandbox Code Playgroud)
未格式化,它将如下所示:

似乎是我的表格数据.(因此,不仅为布局做了 - 虽然副作用是它有助于拥有相同的列.)
html ×4
css ×3
css3 ×2
html5 ×2
javascript ×2
semantic-web ×2
apple-maps ×1
figure ×1
google-maps ×1
html-select ×1
html-table ×1
hyperlink ×1
image ×1
localhost ×1
margin ×1
option ×1
php ×1
python ×1
seo ×1
url ×1
w3c ×1
webserver ×1