Tycoon Talk
Become a Big fish!
The number 1 forum for online business!
Post topics, ask questions, share your knowledge.
Tycoon Talk is part of Freelancer.com - find skilled workers online at a fraction of the cost.

CSS Forum


You are currently viewing our CSS Forum as a guest. Please register to participate.
Login



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

Posts: 7
Trades: 0
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
 
 
Register now for full access!
Old 05-02-2005, 07:57 PM
CasaPages's Avatar
SillyPhilly

Posts: 758
Location: between here an somewhere else
Trades: 0
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

Please login or register to view this content. Registration is FREE
CasaPages is offline
Reply With Quote
View Public Profile Visit CasaPages's homepage!
 
Old 05-02-2005, 08:11 PM
chrishirst's Avatar
Missing! presumed drunk.

Posts: 41,519
Name: Chris Hirst
Location: Blackpool. UK
Trades: 0
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!! <<-
A foolish consistency is the hobgoblin of little minds
Thought for today:- I SEO the only industry where all the cowboys are Indians?
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 Search this Thread
Search this Thread:

Advanced Search

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

BB 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.11111 seconds with 12 queries