Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
Discussion GroupsGeneralPHPASPPerlColdFusionFlashHTML, CSS, ScriptsBrowsers

Webmaster Forum / HTML, CSS, Scripts / CSS / October 2005



Tip: Looking for answers? Try searching our database.

Image inline with text query

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
KiwiBrian - 29 Oct 2005 03:45 GMT
I wish to place an image of a word of text in the middle of a sentence, but
need to adjust the vertical position of the image so that it looks inline
with the text.
I have tried unsuccesfully to do this with margins and padding on both the
text and the image.
Can someone put me out of my misery and tell/show me how to do this.
TIA
Brian Tozer
Spartanicus - 29 Oct 2005 07:15 GMT
>I wish to place an image of a word of text in the middle of a sentence, but
>need to adjust the vertical position of the image so that it looks inline
>with the text.

img.class{vertical-align:middle}

Signature

Spartanicus

Els - 29 Oct 2005 10:37 GMT
>>I wish to place an image of a word of text in the middle of a sentence, but
>>need to adjust the vertical position of the image so that it looks inline
>>with the text.
>
> img.class{vertical-align:middle}

I think that only works if the image doesn't show any space below the
letters in the image, not even for the lower parts of g, j, y...
Maybe vertical-align:bottom; would be a better option if the image
does have that sort of letters in it?

Signature

Els                     http://locusmeus.com/
Sonhos vem. Sonhos vão. O resto é imperfeito.
                            - Renato Russo -

Roedy Green - 30 Oct 2005 06:46 GMT
>I wish to place an image of a word of text in the middle of a sentence, but
>need to adjust the vertical position of the image so that it looks inline
>with the text.

see http://mindprod.com/jgloss/htmlcheat.html#IMAGEDISPLAYING
I think what you want is ABSMIDDLE
Signature

Canadian Mind Products, Roedy Green.
http://mindprod.com Java custom programming, consulting and coaching.

kchayka - 30 Oct 2005 15:40 GMT
> see http://mindprod.com/jgloss/htmlcheat.html#IMAGEDISPLAYING
> I think what you want is ABSMIDDLE

1. Since this is a CSS discussion group, using HTML attributes
(align=absmiddle) when there is a CSS equivalent (vertical-align:middle)
is discouraged.

2. Non-standard code is also discouraged, especially when there is a
standard equivalent. ABSMIDDLE is an invalid value, according to the
HTML 4.01 specs. The fact that some browsers support it is irrelevant.
<URL:http://www.w3.org/TR/html401/struct/objects.html#adef-align-IMG>

Signature

Reply email address is a bottomless spam bucket.
Please reply to the group so everyone can share.

Alan J. Flavell - 30 Oct 2005 16:20 GMT
> > see http://mindprod.com/jgloss/htmlcheat.html#IMAGEDISPLAYING
> > I think what you want is ABSMIDDLE
[quoted text clipped - 6 lines]
> standard equivalent. ABSMIDDLE is an invalid value, according to the
> HTML 4.01 specs.

Fuly agree with all of that.

But there's also the question of whether it's the right answer.

We don't really know some important features of what the original
poster is doing (which is why a test URL is always welcome here).

Assuming (and IMHO that's a big assumption) that there is some genuine
reason why this image of a word has to be used in running text...

Then, presuming that the image includes descenders, then for sure the
lower edge of the image should not be aligned to the font baseline,
which is what's going to happen by default in Standards mode, right?

The most obvious feature of text, and what readers will visually take
to be the correct alignment, is the font baseline.  Ideally, that's
what one would want to line-up between the text and the image: but the
question is, how to do that well?  I.e without having to resort to
sizing things in absolute units?

If the lower edge of the image is aligned to the lower edge of the
font (vertical-align: bottom), there's no guarantee that the font
baseline as seen in the image, will align with the font baseline of
the surrounding text.

How about sizing the image in em units, in the hope of matching the
text?  Might help a bit.  In the end, if none of the keyword positions
prove suitable, it's allowed to specify vertical align (relative to
the *baseline*, remember, not to "bottom") in actual length units,
such as em units, or a percentage.  Positive values raise the box,
negative values lower it.  But unless the sizing unit is properly
chosen, then as soon as the reader starts zooming the text, the
author's careful computations will go pear-shaped.
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2009 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.