473,322 Members | 1,538 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,322 software developers and data experts.

Image inline with text query

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
Oct 29 '05 #1
5 10612
"KiwiBrian" <br******@ihug.co.nz> wrote:
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}

--
Spartanicus
Oct 29 '05 #2
Els
Spartanicus wrote:
"KiwiBrian" <br******@ihug.co.nz> wrote:
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?

--
Els http://locusmeus.com/
Sonhos vem. Sonhos vão. O resto é imperfeito.
- Renato Russo -
Oct 29 '05 #3
On Sat, 29 Oct 2005 15:45:51 +1300, "KiwiBrian" <br******@ihug.co.nz>
wrote, quoted or indirectly quoted someone who said :
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...MAGEDISPLAYING
I think what you want is ABSMIDDLE
--
Canadian Mind Products, Roedy Green.
http://mindprod.com Java custom programming, consulting and coaching.
Oct 30 '05 #4
Roedy Green wrote:

see http://mindprod.com/jgloss/htmlcheat...MAGEDISPLAYING
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>

--
Reply email address is a bottomless spam bucket.
Please reply to the group so everyone can share.
Oct 30 '05 #5
On Sun, 30 Oct 2005, kchayka wrote:
Roedy Green wrote:

see http://mindprod.com/jgloss/htmlcheat...MAGEDISPLAYING
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.


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.
Oct 30 '05 #6

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

8
by: abracad | last post by:
Hi Is it possible to vertically align an image in the middle of a DIV of fixed height?
13
by: Mike | last post by:
We are using: <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en"...
2
by: Tyrone Slothrop | last post by:
I am coding a site which involves uploading images. All of the PHP and display is OK but the client wants to be able to display the image thumbnail on the upload page and show the full image on...
1
by: www.web20developers.com | last post by:
http://www.web20developers.com http://www.web20developers.com/index.php?option=com_content&task=view... Ajallerix : AJAX, simple, fast Web image gallery demo ; at Novell AJAX -...
4
by: Jason | last post by:
Is that possible? How? <td > <asp:Label ID="StartDateLabel" runat="server" Text="Start Date:"> <asp:imagebutton ID="Imagebutton1" width=18 Height=18 CommandName=SetDate imageUrl="../cal.jpg"...
14
by: Zhang Weiwu | last post by:
Hello. I have been using word processor like OOO for nearly 10 years and such layout is very usual to me: gopher://sdf.lonestar.org/I/users/weiwu/ooo_wrap_correctly.png but I found it's very...
2
by: Tarik Monem | last post by:
OK! I've gone through a few tutorials and I cannot understand what I'm doing wrong casting_registration.php <table> <tr> <td> <form enctype="multipart/form-data" action="thankyou.php"...
1
nathj
by: nathj | last post by:
Hi, I'm surrently struggling with something I'm certain should be very simple. I'm working on a new web application that requires every user to login before they do anything else. This means...
2
pradeepjain
by: pradeepjain | last post by:
hii guys, I am storing a image in a database in form of blob and now i want to send that image as a inline image in a mail ..how to do it.. this is the code ..plzz help <?php...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.