Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Westi on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

The right way to fluidly place images?

Status
Not open for further replies.

rockyroad

Programmer
Feb 22, 2003
191
US
Hello

I have searched hi and lo for a tutorial.

What I am seeking is the *correct* way to use CSS to place images.

I have a right column DIV, and inside that I want to place X number of images (it could vary) and some accompanying text (i.e the img floated left of a <p> element.. )
However, everything I try, when using a clearing <div> after the whole thing acauses a loss of contol of the attributes (i.e. padding) of the overall div, and.or never looks the same in all browsers...

Does anyone know of a tutorial or have examples of extensible CSS code for handling this common task?

THANKS! I have a headache from this!

rockyroad
 
Probably the major cause for HTML and CSS to look markedly different across browsers is the lack of a complete and valid DOCTYPE as the first line of your code.

Do you have a complete and valid DOCTYPE?

Dan

[tt]D'ya think I got where I am today because I dress like Peter Pan here?[/tt]
[banghead]

 
Hi,

thanks yes I am using this doctype

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"

I know that there must be a correct strategy for dealing with image placement with .css... resources on this is what I am looking for, any advice?

Thank you
 
Could you show us what you have so far? I usually had no problems with this. Best if you have a site on the net, because you say you use images and it is hard to debug without them.
 
Here's a link to abbreviated code ---


if you look at this in IE6, Opera, and Netscape -- the text looks different relative to the images --

I think the way I have coded this is overly complex and the result is not good!! :)

there must be better way...

Thanks
 
The links to the images on this page are broken so it is hard to say. I would personally make a following <br /> element clear both to begin the picture in a new line. If that is what you're after.
 
Yes, the <br> would seem to be a solution. I just keep thinking that I am missing something. Thanks!
 
You could always use tables to clear things up. either that or the <dt><dd> elements
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top