Reply
Ignoramus in need of CSS sledgehammer to brain-pan
Old 05-02-2005, 05:11 PM Ignoramus in need of CSS sledgehammer to brain-pan
Novice Talker

Posts: 7
Hello,

I'm trying to do a simple layout where I have text and a right-aligned photo. I can get it to work with one photo/text combination, but not more than one, as they start betting pushed down when image or text block differs in height.

Here's my test file:

Code:
<html>
<head>
<style type="text/css">
#content{
	border:solid 1px;
	padding: 30px 0 0 10px;
	width: 310px;
}
#photo {
	border: solid 1px;
	padding: 50px 0 0 0;
	width: 190px;
	float: right;
	text-align: center;
}

</style>
</head>

<body>

<div id="photo">image</div>
<div id="content">content goes here</div>

<div id="photo">image</div>
<div id="content">content goes here</div>

<div id="photo">image</div>
<div id="content">content goes here</div>

<div id="photo">image</div>
<div id="content">content goes here</div>

</body>
</html>
The problem is when the content or image goes long. I want everything underneath it to get pushed down, but I want each image to be top-aligned with it's corresponding content item.

Basically I have a fixed width content column, a fixed width image column (that centers differing width images within it) and I need to have gallery-style composition, where a block of text and it's corresponding image are always adjacent to each other.

I appreciate the help, thanks!
cathode is offline
Reply With Quote
View Public Profile
 
When You Register, These Ads Go Away!
Old 05-02-2005, 06:57 PM
CasaPages's Avatar
SillyPhilly

Posts: 758
Location: between here an somewhere else
you need to use different division ids.... i.e. u need to use photo, photo2 etc.... and content, content2, etc.....

only classes can be used multiple times each division(div id) may only be used once it is unique.....
__________________
It Happens
FreelanceKillers.com
CasaPages is offline
Reply With Quote
View Public Profile Visit CasaPages's homepage!
 
Old 05-02-2005, 07:11 PM
chrishirst's Avatar
Super Moderator

Latest Blog Post:
Javascript alert
Posts: 13,688
Location: Blackpool. UK
float both the text and photo divs then put a clearing div between each content/photo pair
Code:
<div id="photo">image</div>
<div id="content">content goes here</div>
<div class="clearing"></div>
<div id="photo">image</div>
<div id="content">content goes here</div>
and your photo and content divs should be using class as any id's should be unique in the document.


Code:
.clearing {
    clear:both;
}
__________________
Chris. ->> Links are advertising NOT optimising!! <<-
Indifference will be the downfall of mankind, but who cares?
Code Samples | People Counting System
chrishirst is offline
Reply With Quote
View Public Profile Visit chrishirst's homepage!
 
Reply     « Reply to Ignoramus in need of CSS sledgehammer to brain-pan
 

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off




   
RSS Feed  Feeds: RSS   JS   XML
RSS Feed  Feeds for this forum: RSS   JS   XML

 


Page generated in 0.12112 seconds with 12 queries