无效的span标记。预计关闭br标签 [英] Invalid span tag. Expected closing br tag

查看:412
本文介绍了无效的span标记。预计关闭br标签的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试使用iText将html转换为pdf并获得以下错误。



无效的span标记。预期结束标签



这是一个无效的xhtml?

 < span style =font-size:10pt; line-height:14.2667px;>< br />< / span> 


解决方案

span是内联元素,是最小的元素xhtml树。
样式标记,例如< u>,< i>,< strong> 可以驻留在那里。



A < br> < hr> 是一个全宽元素。因此建议在< div>< / div> < br> >

I am trying to convert html to pdf using iText and getting below error.

Invalid span tag. Expected closing br tag

How is this an invalid xhtml ?

<span style="font-size: 10pt; line-height: 14.2667px;"><br/></span>

解决方案

A span is an inline element, and a smallest element of xhtml tree. styling tags like <u>, <i>, <strong> can be reside there.

A <br> or a <hr> is a full width element. Hence it is suggested to use <br> inside a <div></div>

这篇关于无效的span标记。预计关闭br标签的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆