473,385 Members | 1,720 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,385 software developers and data experts.

How to lay out side-by-side paragraphs without tables?

This one ought to be simple, but I have dug myself deeper and deeper,
and gone farther and farther from what I wanted and I'm giving up. And
my html that I've written is so bolloxed up now that it's not worth
posting.

I would like to have two paragraphs, side by side, across the browser
window (everything I say here assumes that the browser window is sized
wide enough to accomodate things of course). The left paragraph is to
have a jpg aligned with the top left of the paragraph, and a bolded,
centered caption underneath it. The right paragraph is to have a jpg
aligned with its top right and a bolded, centered caption underneath it
(by "centered caption" I mean the caption is centered across the width
of the jpg). The paragraphs should both have text left-justified, and
there should be enough whitespace between the two paragraphs that they
are clearly distinct and separate.

Below is a fragment from an early cut at what I wanted, which yielded
results closer to what I wanted than anything I'd gotten since. I don't
have access to a Windows computer today, but in Macintosh, here are the
issues that I have with the results:

Internet Explorer 5.5: Why does the top edge of paragraph text fall
below the top edge of the image for the left paragraph? Why, no matter
how wide I make the window, does the right paragraph text come under the
right image, rather than with its top edge even with that of the left
paragraph, and with the right image aligned with the right top edges of
the paragraph text?

Netscape 7.1: Why do the top edges of the images align not with the top
of the paragraphs, but with the second line of the paragraphs?
Otherwise, everything looks okay.

Yes, I'm using a Mac, but I had similar problems on Windows computers
yesterday (IE 6.0, Netscape 7.1). I assume that if I do this correctly,
it will show up as I'd like in both browsers on both platforms.

The question is... how do I do it correctly???

html snippet follows:
=====================

<style>
div.photo_l {
float: left; margin: 2px;
}
div.photo_r {
float: right; margin: 2px;
}
div.photo_l, div.photo_r p {
text-align: center; font-size: 80%; font-weight: bold;
}
</style>

<body>

<div style="width: 47%; float: left;">
<div class="photo_l">
<p style="width: 200"><img alt="leftfoo.jpg" src="leftfoo.jpg"
height="310" width="200"><br>
The caption for the left photo</p>
</div>
<p>And this is where the text of the left paragraph would go. It is
supposed to be so that the leftfoo.jpg aligns with its top and its left.
If the paragraph text were long enough, I'd like it to wrap under the
leftfoo.jpg image.</p>
</div>

<div style="width: 48%; float: right; ">
<div class="photo_r">
<p><img alt="rightfoo.jpg" src="rightfoo.jpg" height="240"
width="160"><br>
The caption for the right photo</p>
</div>
<p>And this is where the text of the right paragraph would go. It is
supposed to be so that the rightfoo.jpg aligns with its top and its
right. If the paragraph text were long enough, I'd like it to wrap
under the rightfoo.jpg image. Assuming a wide-enough browser window,
left to right we should have the left paragraph, with the leftfoo.jpg
picture at its upper left, some whitespace, and the right paragraph with
the rightfoo.jpg picture aligned with its upper right. Both photos
should have bolded captions centered under them.</p>
</div>

</body>
Jul 20 '05 #1
2 15221
needhelp wrote:
Below is a fragment from an early cut at what I wanted, which yielded
results closer to what I wanted than anything I'd gotten since. I don't
have access to a Windows computer today, but in Macintosh, here are the
issues that I have with the results:


any chance of an actual URL so I can see what is happening

Jul 20 '05 #2
In article
<re*********************************@syrcnyrdrs-01-ge0.nyroc.rr.com>,
needhelp <re***********@noemailplease.com> wrote:
This one ought to be simple, but I have dug myself deeper and deeper,
and gone farther and farther from what I wanted and I'm giving up. And
my html that I've written is so bolloxed up now that it's not worth
posting.
Without a live page, it's impossible to say what's ging on.

But try using the code from sites such as this one as your starting
place:

http://www.glish.com/css/

Internet Explorer 5.5: Why does the top edge of paragraph text fall
below the top edge of the image for the left paragraph?


Try setting the top margin on <p> to zero.

--
Jim Royal
"Understanding is a three-edged sword"
http://JimRoyal.com
Jul 20 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

54
by: Max Quordlepleen | last post by:
Apologies for the crossposting, I wasn't sure which of these groups to ask this in. I have been lurking in these groups for a week or so, trying to glean what I need to design a simple, clean...
16
by: Jeremy Clulow | last post by:
One disadvantage of designing with CSS and without tables appears to be that selecting specific block of text from a web page to copy and paste, or in order for it to be read by a text-to-speech...
8
by: kaeli | last post by:
I have had a little free time lately to revisit a problem I have with the 3 column layout plus a header and footer. See this example: http://glish.com/css/7.asp There is a header and 3...
24
by: Daphne Tregear | last post by:
Is anyone able to improve on this solution, and enable me to do without tables completely? http://www.cs.man.ac.uk/~daf/i-p-c-s.org/faq/gallery_old.php uses a table to lay out the thumbnails...
3
by: dave | last post by:
Hello, I've got a site project that i've got to design a layout without resorting to tables. I want to use a table for tabular data not any formatting layout, i am uncertain as to how to...
9
by: effendi | last post by:
Is is possible for me to place to images side by side one -one right align and another left align on the same horizontal plane using CSS without tables? Thanks for any suggestion/advice.
7
by: lotusny78 | last post by:
Hi all, I'm trying to lay out 3 text boxes with associated labels horizontally, as in the following pseudocode: <form> TITLE label1 label2 label3 edit1 ...
6
by: davidgordon | last post by:
Hi, I regularly code in standard asp with MySQL. I have a page which displays records with the background colour of each record table row in a different colour. There are 2 table rows per...
5
by: Markus Ernst | last post by:
Hello This is a test example: http://www.markusernst.ch/anthracite/ http://www.markusernst.ch/anthracite/living_divani.html After googling and experimenting for several hours, I ended up...
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
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
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: 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
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
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

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.