如何在XML中使用Meta Viewport? [英] How to use Meta Viewport in XML?

查看:84
本文介绍了如何在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.

这篇关于如何在XML中使用Meta Viewport?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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