gpt4 book ai didi

html - 前置标签添加新行

转载 作者:太空宇宙 更新时间:2023-11-04 00:14:45 24 4
gpt4 key购买 nike

段落中有一个表格。表格内的单元格有额外的换行符。以下是代码的相关部分。

<!DOCTYPE html>
<html>
<head>
<style type="text/css">
div.Page1773023 {}
.f31 {font-family:Times New Roman;font-size:12.00pt;font-style:normal;font-weight:normal;line-height:114%;}
.f1 {font-family:Arial;font-size:10.00pt;font-style:normal;font-weight:normal;line-height:114%;}
</style>
</head>
<body>
<div class="Page1773023" style="height:1056px;width:816px;">
<p class="normal"><pre>
<table class="normal" style="width:99.00px;border-spacing:0px;border-collapse:collapse;border:1.00px solid #000000;;">
<tr>
<td style="height:16.000px;width:96.000px;;;" >
<p class="normal"><pre>
<span class="f1" style="color:#FF0000;" >11111</span></pre></p>
</td>
</tr>
</table><br style="clear:left;"/>
</pre></p>
</div>
</body>
</html>

现在,当我删除 <pre>最外面的标签 <p> , 新行是看不到的。知道为什么会这样吗?

最佳答案

在 firefox 上下载 HTML Tidy Plugin 并修复错误...

顺便说一句,我会尽量减少您使用的标签。为什么需要 p、span、table、div、pre?

首先决定布局应该是什么,只写你真正需要的代码。

这是一个示例,说明如何实现相同的输出。确保你的浏览器上有 Firebug 或一些检查工具。它可以帮助您对边距进行微小的更改并找到正确的值。

<!DOCTYPE html>
<html>
<head>
<style type="text/css">
.box {
width:104px;
height:80px;
border:1px solid;
margin-top:10px;
}

.box td {
color: red;
font-family: Arial;
font-size: 10.00pt;
font-style: normal;
font-weight: normal;
line-height: 114%;
}
</style>
</head>
<body>
<table class="box">
<tr>
<td>
11111
</td>
</tr>
</table>
</body>
</html>

关于html - 前置标签添加新行,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/11771078/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com