样式标签 [英] Style tag on
问题描述
我的问题是属性WIDTH / HEIGHT  
位于我的源代码中的"样式"标记中。 这些属性应位于 img标记中。
My problem is that the attributes WIDTH/HEIGHT are located in 'style' tag in my source code. These attributes should be in the img tag.
为什么EW以这种方式生成它?如何更改此问题的设置?
感谢Pete
推荐答案
这不是问题。它是指定img宽度和高度的两种标准方法之一(并且
仅 img宽度和高度;除了图像之外的所有内容都不推荐使用HTML表示属性)。你可以使用这个
It's not a problem. It is one of two standard ways of specifying img width and height (and only img width and height; HTML presentational attributes are deprecated for everything but images). You can use either this
< img src =" myImage.jpg"高度= QUOT; 300"宽度= QUOT; 200" />
<img src="myImage.jpg" height="300" width="200" />
或者
< img src =" myImage.jpg"类= QUOT; sidebarHeader" />
<img src="myImage.jpg" class="sidebarHeader" />
CSS为
.sidebarHeader {
身高:300px;
宽度:200px;
}
.sidebarHeader {
height:300px;
width:200px;
}
两者都同样有效,两者都符合标准。
Both are equally valid, and both are standards-compliant.
EW,by默认情况下,努力生成符合标准的标记和CSS。 "工具"|"页面编辑器选项"中的"CSS"选项卡上有一个设置,可让您选中使用图像而不是CSS的高度和宽度属性的选项。检查该框。
EW, by default, strives to produce standards-compliant markup and CSS. There is a setting on the CSS tab in Tools|Page Editor Options that will let you check the option to use height and width attributes for images instead of CSS. Check that box.
欢呼,
scott
cheers,
scott
这篇关于样式标签的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!