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 gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Forcing divs to a fixed left position 1

Status
Not open for further replies.

ChrisRChamberlain

Programmer
Mar 23, 2000
3,392
GB
Hi all

Have a test site with the main content of the page consisting of four divs.

Each div has a single thumbnail image and text description of the image.

The code for the div is :-
Code:
.maindiv {
[tab]position:relative;
[tab]top:-2;
[tab]left:-4;
}

All works as expected until the mouse is passed over the thumbnail. Courtesy of BillyRayPreachersSon, [smile], the image becomes a larger animated .gif enabling a prospective customer to appraise a vehicle without leaving the main page.

Unfortunately, because the descriptive text is shorter than the height of the animated .gif, the next div appears below the text of the current div to the right of the animated .gif.

Is it possible to force the divs to follow under each other without showing themselves as described?

The site is at
TIA

FAQ184-2483​
Chris [pc2]
PDFcommander.com
motrac.co.uk
 
If you add "clear:left" to your ".description" rule, all should work as expected.

P.S. The code you've got above needs unit specifiers (e.g. "-2px", not just "-2" to work properly across all browsers).

Hope this helps,
Dan



Coedit Limited - Delivering standards compliant, accessible web solutions

Dan's Page [blue]@[/blue] Code Couch:
Code Couch Tech Snippets & Info:
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top