HTML/CSS中的粗体标记

2024-09-28 21:37:05 发布

您现在位置:Python中文网/ 问答频道 /正文

我使用在线转换器将一个文件从PDF转换为HTML,目的是从HTML文档中提取粗体特征。但是,我在HTML脚本上找不到任何粗体标记(HTML或CSS),但当我在web浏览器上打开HTML文件时,粗体字符以粗体显示

请看这个示例HTML摘录,了解加粗的特性

<div class="t m0 x3 h3 y9 ff2 fs0 fc0 sc0 ls11 ws0">1.<span class="ls0"> <span class="_ _1"> </span><span class="ls1">My Laptop</span> </span></div>

上面的HTML脚本输出**1. My Laptop**

下面是一个未绑定特性的HTML摘录

<div class="t m0 x3 h4 y15 ff3 fs0 fc0 sc0 ls11 ws0">2<span class="ls0"> <span class="_ _2"> </span><span class="ls8">Laptops <span class="ls4">are</span></span> <span class="ls13">grea</span>t <span class="ls7">tools </span> <span class="lsd">in codi<span class="_ _3"></span>ng with<span class="_ _3"></span> the <span class="ls0">C<span class="ls1f">ommand </span>L</span>ine.  <span class="ls0"> </span></span></span></div>

上面的脚本打印 2. Laptops are great tools in coding with the Command Line

如您所见,它们都共享许多相似的类标记。然而,以下是他们的不同标签:

(h3, h4), (y9, y15), (ff2, ff3)

这些是我从HTML文件标题中获得的标记的描述

**h3:** .h3{height:29.275313px;} Looks like a tag for height
**h4:** .h4{height:28.940625px;} Looks like a tag for height

**y9:** .y9{bottom:891.946667pt;} Looks like a tag that measures the vertical position of the character on the HTML page
**y15:** .y15{bottom:655.928000px;} Looks like a tag that measures the vertical position of the character on the HTML page


**ff2:** .ff2{font-family:ff2;line-height:0.904297;font-style:normal;font-weight:normal;visibility:visible;} 
**ff3:** .ff3{font-family:ff3;line-height:0.895996;font-style:normal;font-weight:normal;visibility:visible;}

我主要用Python编写代码,所以我是HTML和CSS的新手。我在网上搜索识别HTML/CSS文件中粗体标记的方法,我的研究将其缩小为三种方法:

- **font-weight: bold|bolder**

如上所示,对于粗体和未绑定的字符,标记字体重量都显示为正常

- **the <b> Element**

文件上没有HTML标记

- **the <strong> Element**

文件上没有HTML标记

还有什么我没看的吗?我对不同编程语言(Python、JavaScript等)的解决方案持开放态度,我期待着回答您的任何问题


Tags: 文件the标记divhtmlh4h3class
1条回答
网友
1楼 · 发布于 2024-09-28 21:37:05

CSS可以通过另一个页面(如bootstrap)生成一些粗体字母

好吧,也许有一些标签被过滤,并放入一个样式,如在js中检查哪些内容包含正确的粗体内容

这也和转换器有关

相关问题 更多 >