mySql文字上标_仅使用HTML标记的下标和上标对齐(Subscript and superscript alignment using only HTML markup)...

仅使用HTML标记的下标和上标对齐(Subscript and superscript alignment using only HTML markup)

使用乳胶渲染软件可以轻松生成以下图片:

4ff637931c80e0abd6847710512d88f6.png

特别是上标和下标部分是一个在另一个上面。

通过巧妙地使用标签,而不使用CSS或MathML,是否可以仅使用HTML 4语法获得相同的结果?

The following picture can be easily produced using a latex rendering software:

4ff637931c80e0abd6847710512d88f6.png

In particular superscript and subscript parts are one over the other.

Is it possibile getting the same result using only HTML 4 syntax by some clever use of and tags, without use of CSS or MathML?

原文:https://stackoverflow.com/questions/30549653

2020-03-14 12:03

满意答案

不,只能使用HTML同时拥有元素的子标题和上标。

但是,使用CSS,有解决方案。 如需灵感,请查看此主题 。

编辑: 来源。

HTML下标元素 ( )定义了一个文本范围,出于排版的原因,应该显示的文本范围比文本的主要范围更低,通常更小。

[...]

生成上标的 HTML元素。 请注意,您不能同时使用它们,并且需要使用MathML在元素的化学符号旁边生成上标和下标,表示其原子序数和核数。

另请注意以下关于同一页面中注释:

此元素仅用于排版原因,即改变文本的位置,改变其含义,如数学(如t2,尽管应考虑使用MathML公式)或化学公式(如H2O)。

No, it is not possible to have sub- and superscript for an element at the same time using only HTML.

However, using CSS, there are solutions. For inspiration, have a look at this thread.

The HTML Subscript Element () defines a span of text that should be displayed, for typographic reasons, lower, and often smaller, than the main span of text.

[...]

The HTML element that produces superscript. Note that you cannot use them both at the same time and you need to use MathML to produce both a superscript and a subscript next to the chemical symbol of an element, representing its atomic number and its nuclear number.

Also note the following remark about from the same page:

This element should be used for typographical reasons only, i.e. changing the position of the text changing its meaning like in mathematical (like t2, though the use of a MathML formula should be considered) or chemical formulas (like H2O).

2017-05-23

相关问答

您的问题与JSoup无关,而与您的rtfToHtml函数无关。 您的函数不会生成您期望的标记。 JSoup在此步骤中无法执行任何操作,因为预期的标记不在此处,因此您无法解析它们。 编辑:(和解决方案) 如果没有必要,您应跳过rtfToHTML步骤。 如果剪贴板包含已经是HTML格式的数据,那么在rtf中要求它然后将其转换回HTML意味着在转换期间丢失格式信息。 您可以直接以HTML格式获取剪贴板,以避免不必要的转换: DataFlavor dfHTML = new DataF...

您可以使用vertical-align: super标vertical-align: super (加上伴随的font-size缩小)。 但是,请务必阅读其他答案 ,特别是paulmurray和cletus的答案 ,以获取有用的信息。 You can do superscript with vertical-align: super, (plus an accompanying font-size reduction). However, be sure to read the other ans...

如果在WebView中显示文本,则可以使用html标记设置上标。 它还具有在较旧的iOS版本上运行的优势,您可以重复使用邮件中的文本。 NSString *myText=@"This text contains subscript and superscript text.";

[self.myWebView loadHTMLString:myText baseURL:nil];

If you display the text in a WebView...

在Codename One中没有内置的支持,我们希望在不久的将来提供更丰富的文本工具,但对于没有一些开发人员只是嵌入WebBrowser组件并使用HTML,如果他们有很多富文本。 There is no builtin support for that in Codename One, we hope to provide richer text tools in the near future but right not some developers just embed a WebBrows...

@Manoj我认为你的问题是,你不知道HTMLeditor是如何处理你在textfield(又名WebPage )中输入的任何文本。 出乎意料的是,它将您的标签应用于您输入的下一个文本(添加1并在12之后输入正常的2后结果):

1

习惯了 在你的最后一个td

=====
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值