" in CSS? How to emulate I start at the top right corner of the image!

HTML "<img align = top>" in CSS?

How to emulate

<img align='top' src='huge_image.jpg'>
<span>I start at the top right corner of the image!</span>

in CSS?

It may be embarrassingly simple, but I really don't know.

+5
source share
5 answers

It depends on the container of your items. The vertical-alignCSS property does not exactly match the attribute valign. I recommend checking out this link for an explanation of how to achieve this using CSS. http://phrogz.net/CSS/vertical-align/index.html

+5
source

float: left , img , align="top" - ( ) style="vertical-align: top;"

+5

, vertical-align.

<img style="vertical-align: top;" alt="blah" src="blah.jpg" />

<img>, CSS.

+2
<style="text/css">

.top_aligned_image {vertical-align: top; /* or text-top, I can't remember for sure which works better */}

</style>

<img class="top_aligned_image" src='huge_image.jpg' /><span>I start at the top right corner of the image!</span>

.

+2

:

, , . , : inline .

vertical-align: text-top .

+1

All Articles