在 Strict 1.0 中验证图像属性 -
我正在创建我的第一个网页,希望有人能提供帮助!
我正在尝试严格验证页面,但我被告知这些属性无效:
align="left" hspace="10px"
有什么方法可以以验证的方式获得相同的结果吗?
非常感谢一个绝对的初学者。
I'm creating my very first webpage, and I hope someone can help!
I'm trying to validate a page in Strict, but I'm told that these attributes aren't valid:
align="left" hspace="10px"
Is there any way I can get the same results in a way that will validate?
Many thanks from an absolute beginner.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
style="margin-left:10px"
可能就是您想要的。然而,
hspace="10px"
可能根本没有在那里放置额外的空间,因为它应该只是hspace="10"
。style="margin-left:10px"
is probably what you're after.However
hspace="10px"
might not have been putting the extra space there at all as it should just behspace="10"
.使用 CSS,您可以完成同样的事情。你会想要尽可能多地学习 CSS,因为你会非常需要它。我建议从介绍性教程开始。
取决于您的方式HTML 看起来,您可以将
img
与 CSS 属性(例如float
和text-align
)对齐。对于图像周围的间距,您可以使用padding
和margin
(在这种情况下可能是 padding)。Using CSS, you can accomplish the same thing. You'll want to learn as much as you can about CSS, as you'll be needing it a lot. I would suggest starting with an introductory tutorial.
Depending on how your HTML looks, you can align the
img
with CSS properties such asfloat
andtext-align
. For spacing around the image you can usepadding
andmargin
(probably padding in this scenario).通常 XHTML 1.0 Transitional 就足够了,您不需要选择 Strict。
如果你确实需要 Strict,你可以用 css 来实现。
Usually XHTML 1.0 Transitional is good enough, and you don't need to go for Strict.
If you really need Strict, you can do it with css.