我正在使用 Moovweb SDK 并正在优化我的个人桌面网站以进行移动。
如何将所有<p>
标签转换为<div>
标签?我真的不想手动做!搜索和替换??哈哈
您可以使用 name() 函数来更改元素的名称。例如:
$("//p") {
name("div")
}
在此处查看实际操作:http: //tester.tritium.io/bd1be4f2c187aed317351688e23f01127d26343a
Cheap way: Add p{margin:0}
to your CSS, this will remove the only special styling of <p>
tags making them look like <div>
s.
This is only a visual effect, though. For instance, you're still not allowed to put a <form>
inside a <p>
, even with the above CSS. If that's what you're after, a simple search and replace will do:
<p>
with <div>
<p␣
(left angle, p, space) with <div␣
(there's a space at the end of that one too)</p>
with </div>
That should do it!