473,778 Members | 1,804 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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 10656
"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{verti cal-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{verti cal-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=absmiddl e) 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#ad ef-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=absmiddl e) 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
30911
by: abracad | last post by:
Hi Is it possible to vertically align an image in the middle of a DIV of fixed height?
13
31765
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" lang="en"> Using CSS (not html since align=center and <center> are deprecated) I can get it to work in IE6 (but not NS 7 or Firefox) with. <div style="text-align:center; display:block; "><img src="myimg.gif"
2
6774
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 mouseOver instead of the popup I coded. The section of code below works perfectly in Firefox but not at all in IE (why am I not surprised?). The page is nearly 100% dynamic, so this is extracted from the source of a test page. The code in...
1
16513
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 - microlink pattern tutorial : A microlink is a link that opens up
4
17624
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" runat=server /> </asp:Label> </td> <td >
14
8330
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 difficult to achieve the same layout with HTML/css. The best result I can achieve is like this: gopher://sdf.lonestar.org/h/users/weiwu/Expectation.xml
2
2578
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" method="post" name="registrationform"> Choose a shows:
1
2833
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 that the first page is a login page. I have produced simple graphic for the login form and I want the controls to sit within this. Unfortunately this is all just local only at the moment and so I can show you the results. The code is as follows:...
2
2143
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 mysql_connect("localhost","root","12345"); mysql_select_db("pyz"); $str_sql="select * from xyz where id= '".$_GET."'";; $Colloquiums1 = array();
0
9464
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10292
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10122
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
10061
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
9923
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
8954
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
4031
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
3627
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2860
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.