 |
HTML Code Clinic Do you have some HTML code you'd like to share and get suggestions from others for tweaking or improving it? This discussion is the place. |
Welcome to the p2p.wrox.com Forums.
You are currently viewing the HTML Code Clinic section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
|
|
|

April 7th, 2004, 09:14 AM
|
Friend of Wrox
|
|
Join Date: Nov 2003
Posts: 1,285
Thanks: 0
Thanked 2 Times in 2 Posts
|
|
Align IMG with text
Ugh, this has been bugging me for days.
I have an image on the left side of a cell, and text after it. I want the text to be aligned in the middle of the image, not the top, not the bottom, the middle. I can't seem to get anything to work.
+----+ This is how it looks
|IMG |
+----+
+----+
|IMG | This is how I want it to look
+----+
Thanks.
----------
---Snib---
----------
<><
|

April 7th, 2004, 11:10 AM
|
 |
Wrox Author
|
|
Join Date: Jun 2003
Posts: 17,089
Thanks: 80
Thanked 1,576 Times in 1,552 Posts
|
|
Hi Snib,
Did you try align="middle" on the image? e.g.:
<img src="SomeImage.gif" width="200" height="200" align="middle" /> This text will appear in the middle....
Cheers,
Imar
---------------------------------------
Imar Spaanjaars
Everyone is unique, except for me.
|

April 7th, 2004, 11:15 AM
|
Friend of Wrox
|
|
Join Date: Nov 2003
Posts: 1,285
Thanks: 0
Thanked 2 Times in 2 Posts
|
|
Imar: Thanks, I'll try it.
----------
---Snib---
----------
<><
|

April 7th, 2004, 03:15 PM
|
 |
Wrox Author
|
|
Join Date: Jun 2003
Posts: 1,706
Thanks: 0
Thanked 6 Times in 6 Posts
|
|
Personally, I'd use CSS to accomplish that.
<img src="images/hands.jpg" style="width: 225px; height: 169px; vertical-align: middle;" />Some text
The align="", width="" and height="" attributes are all deprecated.
: )
Rich
::::::::::::::::::::::::::::::::::::::::::
The Spicy Peanut Project
http://www.spicypeanut.net
::::::::::::::::::::::::::::::::::::::::::
|

April 7th, 2004, 03:16 PM
|
Friend of Wrox
|
|
Join Date: Nov 2003
Posts: 1,285
Thanks: 0
Thanked 2 Times in 2 Posts
|
|
I tried vertical-align: middle; and it didn't work. I've still yet to try Imar's suggestion.
----------
---Snib---
----------
<><
|

April 7th, 2004, 03:33 PM
|
 |
Wrox Author
|
|
Join Date: Jun 2003
Posts: 1,706
Thanks: 0
Thanked 6 Times in 6 Posts
|
|
Uh, it works for me.
Can you post an snippet of mark-up in its natural context?
Are you using a DOCTYPE? And what browser?
: )
Rich
::::::::::::::::::::::::::::::::::::::::::
The Spicy Peanut Project
http://www.spicypeanut.net
::::::::::::::::::::::::::::::::::::::::::
|

April 7th, 2004, 03:51 PM
|
Friend of Wrox
|
|
Join Date: Nov 2003
Posts: 1,285
Thanks: 0
Thanked 2 Times in 2 Posts
|
|
Rich, I'm really sorry. I've been applying the suggestions you gave me to the table cell, not the image. I tried how you said it and it worked. Thanks a lot!
FYI: My browser: IE6. I did not use a DOCTYPE.
Thanks again.
----------
---Snib---
----------
<><
|

April 7th, 2004, 03:59 PM
|
 |
Wrox Author
|
|
Join Date: Jun 2003
Posts: 1,706
Thanks: 0
Thanked 6 Times in 6 Posts
|
|
No worries!
: )
Rich
::::::::::::::::::::::::::::::::::::::::::
The Spicy Peanut Project
http://www.spicypeanut.net
::::::::::::::::::::::::::::::::::::::::::
|

April 7th, 2004, 04:12 PM
|
 |
Wrox Author
|
|
Join Date: Jun 2003
Posts: 17,089
Thanks: 80
Thanked 1,576 Times in 1,552 Posts
|
|
Yeah, very true, Rich.
Sorry for posting old and deprecated code. Old habits die hard, although I really try..... ;)
Cheers,
Imar
---------------------------------------
Imar Spaanjaars
Everyone is unique, except for me.
|

April 7th, 2004, 04:25 PM
|
Friend of Wrox
|
|
Join Date: Nov 2003
Posts: 1,285
Thanks: 0
Thanked 2 Times in 2 Posts
|
|
I personally use this type of depreciated code a lot.... Do all browsers support it (I only own IE6)?
----------
---Snib---
----------
<><
|
|
 |