Avatar of Neil Thompson
Neil ThompsonFlag for United Kingdom of Great Britain and Northern Ireland

asked on 

css positioning issues, cannot get items to line up as required

Hi

I've got an issue with the following code which is not lining up the images / removal links as I'm after, hoping some of you gurus can easily assist.

I'm after a framed box container, then each image will also have a border "frame" with the removal link in the top right hand corner, ideally later ill alter it for an image to look better as in the image below:

I'm trying to get something like this:
User generated image
But I'm actually getting this:
User generated image
Here is my current code:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Untitled Document</title>
<style>
#imageGalleryContainer {
	position: relative;
	border: 1px solid #CCC;
	padding: 4px;
	position: relative;
}
#imageGalleryContainer .singleImageContainer {
	border: 1px solid #CCC;
	padding: 4px;
	float: left;
	position: relative;
	margin-right: 6px;
}
.singleImageContainer a.remove_field {
	border: 1px solid #ff6600;
	padding: 0px;
	margin: 0px;
	position: relative;
	top: 10px;
	right: 10px;
	z-index: 200;
}
.singleImageContainer img.singleImageThumbnail {
	border: 1px solid #00ff00;
	padding: 2px;
	margin: 0px;
	position: relative;
	top: 0px;
	left: 0px;
	z-index: 100;
}
</style>
</head>

<body>

    <div id="imageGalleryContainer">
    
      <div class="singleImageContainer">
        <a class="remove_field" id="o_19aglfoja1nlqjo51vcu1q8993jf.jpg" href="#">Remove</a>
        <img height="120" class="singleImageThumbnail" src="../../uploads/user/plupload/2014/12/31/o_19aglfoja1nlqjo51vcu1q8993jf.jpg">
      </div>
      
      <div class="singleImageContainer">
        <a class="remove_field" id="o_19aglflr51kjdkr6td51qlmtdu7.jpg" href="#">Remove</a>
        <img height="120" class="singleImageThumbnail" src="../../uploads/user/plupload/2014/12/31/o_19aglflr51kjdkr6td51qlmtdu7.jpg">
      </div>
      
    </div>

</body>
</html>

Open in new window

CSS

Avatar of undefined
Last Comment
Neil Thompson
Avatar of COBOLdinosaur
COBOLdinosaur
Flag of Canada image

You have not closed the image tags, so the markup is structural flawed and invalid for an XHTML doctype.

Cd&
Avatar of Neil Thompson
Neil Thompson
Flag of United Kingdom of Great Britain and Northern Ireland image

ASKER

many thanks but that doesn't answer the question I posted, can you assist with that?
ASKER CERTIFIED SOLUTION
Avatar of Hagay Mandel
Hagay Mandel
Flag of Israel image

Blurred text
THIS SOLUTION IS ONLY AVAILABLE TO MEMBERS.
View this solution by signing up for a free trial.
Members can start a 7-Day free trial and enjoy unlimited access to the platform.
See Pricing Options
Start Free Trial
Avatar of Neil Thompson

ASKER

Perfect, thanks a million HagayMandel :)
CSS
CSS

Cascading Style Sheets (CSS) is a language used for describing the look and formatting of a document written in a markup language. Usually used to change web pages and user interfaces written in HTML, it can also be applied to any kind of XML document. CSS is designed primarily to distinguish the content of a document from its presentation.

43K
Questions
--
Followers
--
Top Experts
Get a personalized solution from industry experts
Ask the experts
Read over 600 more reviews

TRUSTED BY

IBM logoIntel logoMicrosoft logoUbisoft logoSAP logo
Qualcomm logoCitrix Systems logoWorkday logoErnst & Young logo
High performer badgeUsers love us badge
LinkedIn logoFacebook logoX logoInstagram logoTikTok logoYouTube logo