Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

HTML and alignment

Status
Not open for further replies.

samesale

Programmer
Sep 15, 2003
133
0
0
US
I have the following HTML statements that show pictures and text title. I would like the text to be in the middle of the bar instead of at the bottom. Is it possible? Thanks for your help.

<table bgcolor="red" border="0" cellpadding="1" width="100%">
<tr><td > <img src="images/apart1.jpeg" width="95" height="75"> <img src="images/apart2.jpeg" width="95" height="75"><b> <font size=8 color="white"> Apartments for Rent</font><img src="images/apart3.jpeg" width="95" height="75"> <img src="images/apart4.jpeg" width="100" height="75"></td></tr></table>
 
Images alignment in the text is by default bottom. You could try adding align="middle" to your <img> tags and see if that gives desired result:
Code:
<img src="images/apart1.jpeg" [b]align="middle"[/b] width="95" height="75" />
 
You could remove the table all together and use DIVs and SPANs as follows:
Code:
<style>
div.container {
	background-color: #FF0000;
	vertical-align: middle;
	height: 75px;
}
.text {
	vertical-align: middle;
}
.item {
	vertical-align: middle;
}
</style>

<div class="container">
<span class="item"><img src="images/apart1.jpeg" width="95" height="75"></span>
<span class="item"><img src="images/apart2.jpeg" width="95" height="75"></span>
<span class="text">Apartments for Rent</span>
<span class="item"><img src="images/apart3.jpeg" width="95" height="75"></span>
<span class="item"><img src="images/apart4.jpeg" width="100" height="75"></span>
</div>

Hope this helps.

Pete.


Web Developer & Aptrix / IBM Lotus Workplace Web Content Management (LWWCM) Specialist
w: e: Pete.Raleigh(at)lclimited.co.uk
 
Thank you to all of you for your help. I now have a good idea how to create alignment. Thanks.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top