Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17


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

Posted on 2014-12-31
Medium Priority
Last Modified: 2015-01-01

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:
But I'm actually getting this:
Here is my current code:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "">
<html xmlns="">
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Untitled Document</title>
#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;


    <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 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">


Open in new window

Question by:Neil Thompson
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
LVL 53

Expert Comment

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


Author Comment

by:Neil Thompson
ID: 40525848
many thanks but that doesn't answer the question I posted, can you assist with that?
LVL 16

Accepted Solution

HagayMandel earned 2000 total points
ID: 40526467
My suggestion:
1. In singleImageContainer class replace the 'float:left;' with 'display:inline-block;'
2. For the .singleImageContainer a.remove_field use the following:
color: #fff;
border-radius: 50%;
font: 22px/100% arial, sans-serif;
text-decoration: none;
text-align: center;	
line-height: 18px;
white-space: nowrap;

Open in new window

3. Add the following css rule:
.singleImageContainer a.remove_field:before {

Open in new window

4. Remove the text Remove from your a tags.

good luck

Author Closing Comment

by:Neil Thompson
ID: 40526632
Perfect, thanks a million HagayMandel :)

Featured Post

Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

As a result of several questions about how to use Bootstrap I thought it would be a good idea to write down the development aspect of creating a Bootstrapped website in as little time as possible. Part 1 of this article will only concentrate on g…
Building a website can seem like a daunting task to the uninitiated but it really only requires knowledge of two basic languages: HTML and CSS.
In this Micro Tutorial users will learn how to embed custom fonts into websites using @font-face in CSS Select a font: Ensure the EULA allows you to use @font-face: Download the font: Get the browser-compatible files you need: Edit your CSS       - Name …
In this tutorial viewers will learn how to embed custom externally-hosted Google Fonts using the Google Font API in CSS Go to the Google Fonts website at Browse or search based on font properties or name to find a suitable font for…
Suggested Courses

704 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question