相邻元素中有相邻的space时,html中显示的是哪个space?
Which space is shown in html when there are adjacent spaces in adjacent elements?
以下HTML个文件
<html><body>x <b> y</b></body><html>
看起来像
<html><body>x <b>y</b></body><html>
和
<html><body>x<b> y</b></body><html>
后两者的浏览器可视化效果与原来的相当?
它将显示:
<html><body>x <b>y</b></body><html>
这与自动换行有关。如果不使用不间断的 space:
,则不能在 HTML 中连续使用多个 space
<html><body>x <b> y</b></body><html>
您还可以更改白色-space 属性 以允许 CSS 中有多个 space:
body {
white-space:pre;
}
如chrome检查员所示:
以下HTML个文件
<html><body>x <b> y</b></body><html>
看起来像
<html><body>x <b>y</b></body><html>
和
<html><body>x<b> y</b></body><html>
后两者的浏览器可视化效果与原来的相当?
它将显示:
<html><body>x <b>y</b></body><html>
这与自动换行有关。如果不使用不间断的 space:
,则不能在 HTML 中连续使用多个 space<html><body>x <b> y</b></body><html>
您还可以更改白色-space 属性 以允许 CSS 中有多个 space:
body {
white-space:pre;
}
如chrome检查员所示: