473,394 Members | 1,542 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,394 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 60463
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: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
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:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
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...

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.