CSS中的HTML"<img rel="nofollow noreferrer" align = top>"?

Pek*_*ica 5 html css image alignment

我该如何模仿

<img align='top' src='huge_image.jpg'>
<span>I start at the top right corner of the image!</span>
Run Code Online (Sandbox Code Playgroud)

在CSS?

也许这简直令人尴尬,但我真的不知道.

dda*_*ngo 5

float: left将它定位,使得img元素将位于跨度的左侧,但如果align="top"由于垂直对齐问题(右下角与右上角的跨度)想要复制,则尝试style="vertical-align: top;"


Chr*_*ris 5

这取决于元素的容器.该vertical-alignCSS属性并不完全映射到valign属性.我建议查看此链接以获取有关如何使用CSS实现此目的的说明.http://phrogz.net/CSS/vertical-align/index.html