Solved

3 pictures per row

Posted on 2011-03-01
6
275 Views
Last Modified: 2012-06-21
<div style="width:100px">

in this div I want 3 pictures per row with a description under picture


</div>

so if there are 4 pictures
1111
1
5 pictures
1111
11


all I need is the css for one picture
0
Comment
Question by:rgb192
  • 4
  • 2
6 Comments
 
LVL 40

Accepted Solution

by:
gurvinder372 earned 500 total points
ID: 35010792
try this one
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML>
<HEAD>
	<style>
		.pic
		{
			display:inline;
			width:28px;
		}
		.pic img
		{
			width:28px;
			height:30px;
		}
		.pic div.description
		{
			width:28px;
			overflow:hidden;
		}
	</style>
</HEAD>

<BODY>
	<div style="width:100px">
		<div class="pic">
			<img src="DSC_6481 copy.jpg">
			<div class="description">Desc1</div>
		</div>
		<div class="pic">
			<img src="DSC_6481 copy.jpg">
			<div class="description">Desc1</div>
		</div>
		<div class="pic">
			<img src="DSC_6481 copy.jpg">
			<div class="description">Desc1</div>
		</div>
	</div>
</BODY>
</HTML>

Open in new window

0
 

Author Comment

by:rgb192
ID: 35011020
is there a way to do this without overflow hidden

because I want to display the entire words
0
 
LVL 40

Expert Comment

by:gurvinder372
ID: 35013762
would you be ok with the words getting spanned across multiple lines then?
Since the width is just 28px, can you just try and reduce the font only?
0
Courses: Start Training Online With Pros, Today

Brush up on the basics or master the advanced techniques required to earn essential industry certifications, with Courses. Enroll in a course and start learning today. Training topics range from Android App Dev to the Xen Virtualization Platform.

 

Author Comment

by:rgb192
ID: 35031770
yes multiple lines is ok
0
 

Author Comment

by:rgb192
ID: 35097741
how to span words across multiple lines
0
 

Author Closing Comment

by:rgb192
ID: 35244559
thanks
0

Featured Post

Live: Real-Time Solutions, Start Here

Receive instant 1:1 support from technology experts, using our real-time conversation and whiteboard interface. Your first 5 minutes are always free.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
css, html 5 42
P tag not forcing line space 2 27
Input box width 6 25
Changing Color of Page Section 4 21
This is a how to build your own CSS3 slideshow and when I say CSS3 I mean just CSS with no javascript in sight! There a few examples online of how to do this but most just show you an example without any explanation, others make it more complicat…
Styling your websites can become very complex. Here I'll show how SASS can help you better organize, maintain and reuse your CSS code.
In this tutorial viewers will learn how to customize the background color and font color of highlighted text using the ::selection element in CSS Begin by defining the selected text as an element in CSS by typing "::selection": Style the ::selection…
Learn how to create flexible layouts using relative units in CSS.  New relative units added in CSS3 include vw(viewports width), vh(viewports height), vmin(minimum of viewports height and width), and vmax (maximum of viewports height and width).

786 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question