如何在XML中使用Meta Viewport?

问题描述:

我试图使用依赖于设置用户代理initial-scale的XML创建响应式设计布局.在HTML中,我会使用<meta viewport>标签的一些变体,例如:

I am trying to create a responsive design layout using XML that relies on setting the initial-scale of the user agent. In HTML I would use some variation of the <meta viewport> tag such as this:

<meta name="viewport" content="width=320, initial-scale=1">

但是,对于XML来说,缺少结束标记是一个问题.

however the lack of a closing tag is a problem for XML.

我有没有办法以有效的XML来做到这一点,而这种XML也可以在浏览器中使用?

Is there a way for me to do this in valid XML that would also work in browsers?

给出

Given this answer (which is specifically about closing the <meta> tag) I think the simplest thing to do here would be to just close the meta element with /> as browsers will not complain.