HTML对象标记 - 我可以指定宽度和高度为百分比吗? [英] HTML object tag - can I specify width and height as percentage?
问题描述
对象标签是否将百分比视为有效的高度和宽度?我正在查看对象的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
andheight
attributes onimg
,iframe
,embed
,object
,video
, and, when theirtype
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屋!