473,400 Members | 2,145 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,400 software developers and data experts.

How to align 'text' under each image?

How do I align each image text (i.e. <p>image2 text...) directly under the image? So image 'image2 text' would be under image2.jpg and 'image3 text' would be under image3.jpg.

[HTML]<html>
<body>

<img src="image1.jpg"
width="160" height="100">

<img src="image2.jpg"
width="160" height="100">

<img src="image3.jpg"
width="160" height="100">

<p>image1 text

</body>
</html>[/HTML]
Sep 24 '07 #1
4 60464
drhowarddrfine
7,435 Expert 4TB
[HTML]<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN"
"http://www.w3.org/TR/html4/strict.dtd">

<html>
<head>
<title></title>

<style type="text/css">
p{float:left}
</style>
</head>

<body>

<img src="1.png">
<p>text</p>

</body>
</html>[/HTML]
Sep 24 '07 #2
Still unable to place each text under each image Directly, please see my code below:

[HTML]<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN"

"http://www.w3.org/TR/html4/strict.dtd">

<html>

<head>

<title></title>

<style type="text/css">

p{float:left}

</style>

</head>

<body>

<img src="test.jpg"width="160" height="100">

<p>image 1 text</p>

<img src="test.jpg"width="160" height="100">

<p>image 2 text</p>

<img src="test.jpg"width="160" height="100">

<p>image 3 text</p>
</body>

</html>[/HTML]
Sep 24 '07 #3
Death Slaught
1,137 1GB
Still unable to place each text under each image Directly, please see my code below:

[HTML]<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN"

"http://www.w3.org/TR/html4/strict.dtd">

<html>

<head>

<title></title>

<style type="text/css">

p{float:left}

</style>

</head>

<body>

<img src="test.jpg"width="160" height="100">

<p>image 1 text</p>

<img src="test.jpg"width="160" height="100">

<p>image 2 text</p>

<img src="test.jpg"width="160" height="100">

<p>image 3 text</p>
</body>

</html>[/HTML]
change the "float: left" to "float: top" and if you want it centered just add margin width to your CSS. Like this


[HTML]<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN"

"http://www.w3.org/TR/html4/strict.dtd">

<html>

<head>

<title></title>

<style type="text/css">

p {float: top; margin-left: 100px;}

</style>

</head>

<body>

<img src="test.jpg"width="160" height="100">

<p>image 1 text</p>

<img src="test.jpg"width="160" height="100">

<p>image 2 text</p>

<img src="test.jpg"width="160" height="100">

<p>image 3 text</p>
</body>

</html>[/HTML]


Hope it helps, Death
Sep 24 '07 #4
drhowarddrfine
7,435 Expert 4TB
change the "float: left" to "float: top"
There is no such thing as 'float:top'.

I only assumed you had the images and text inside some sort of container. If not, then the text float all the way to the left. Here may be a better idea but I don't know if it fits into your scheme:
[HTML]<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN"
"http://www.w3.org/TR/html4/strict.dtd">

<html>
<head>
<title></title>

<style type="text/css">
li{list-style-type:none;float:left;}
p{text-align:center}
</style>
</head>

<body>

<ul>
<li><img src="1.png"><p>text</p></li>
<li><img src="1.png"><p>text</p></li>
</ul>
</body>
</html>[/HTML]
Sep 24 '07 #5

Sign in to post your reply or Sign up for a free account.

Similar topics

0
by: Abhijeet Kumar | last post by:
Hi How can i justify align text on Label Control. I am working in C# Desktop application
4
by: acko bogicevic | last post by:
Hi How can I align text in textbox to right, left or center Thanks alex *** Sent via Developersdex http://www.developersdex.com *** Don't just participate in USENET...get rewarded for it!
2
by: Tom McL. | last post by:
I would like to align text in a ListBox to achieve columns. In the past I could determine the text width in Twips and pad in required number of blank spaces. But now I'm using VB2005 and it...
6
by: tomasio | last post by:
Dear NG-readers, I want to align text right to an image. The last line of text should align with the bottom edge of the image. Unfortunately, the results using my poor CSS knowledge mounted in...
9
panachepad
by: panachepad | last post by:
I arrived here from a websearch that found this thread from your archives: http://www.thescripts.com/forum/thread97805.html It helped me to understand that I am on the right track, but I still have...
4
by: Yocheved | last post by:
Hellow, I want draw a text on screen and can rotate it by any degree. In addition, I need that this text will have not background. And I need also save edit properties for the text. For examlple: One...
3
by: ashraf02 | last post by:
hi i am trying to align text .... wel links to other pages on my website but i cant seem to get it in line with my table. the table falls below the navigation links i have created. Thanks for...
0
by: dreams | last post by:
hi :) i am trying to replace a text with image in the gridview.. the data source for my gridview is a sql table, i want to replace specific row from it with image depending on its original...
2
by: samvb | last post by:
Hi, I have this code: CSS: .onlineuserscon {width:98%; float:left; background-color:#fff;} .onlineusersul {list-style:none; margin:0; padding:0;} .onlineuserimg {width:150px; padding:7px;...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
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...
0
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,...
0
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...
0
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...
0
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,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

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.