HTML对象标记 - 我可以指定宽度和高度为百分比吗? [英] HTML object tag - can I specify width and height as percentage?

查看:112
本文介绍了HTML对象标记 - 我可以指定宽度和高度为百分比吗?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

对象标签是否将百分比视为有效的高度和宽度?我正在查看对象的MDN描述,它表示高度和宽度都在 - CSS像素中指定。

Does object tag take percentage as valid height and width? I'm looking at MDN description of object and it says that height and width are both specified in - CSS pixels.

推荐答案

HTML5草稿
$ b

From the HTML5 draft:


作者要求宽度 height 属性 img iframe embed object video ,当它们类型属性
处于图像按钮状态, input 元素可以指定为
给出可视内容的维度的元素(宽度分别为
和height,相对于
输出介质的名义方向),以CSS像素为单位。 这些属性(如果指定的话)必须包含有效的非负整数
值。

Author requirements: The width and height attributes on img, iframe, embed, object, video, and, when their type attribute is in the Image Button state, input elements may be specified to give the dimensions of the visual content of the element (the width and height respectively, relative to the nominal direction of the output medium), in CSS pixels. The attributes, if specified, must have values that are valid non-negative integers.

属性的值被认为是像素,所以没有办法提供一个百分比。

The attributes' values are assumed to be pixels, so there's really no way to provide a percentage.

这篇关于HTML对象标记 - 我可以指定宽度和高度为百分比吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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