views:

33

answers:

3

I have a rect and have an X on the top right with items inside of it. The div with the X is clickable. The problem is the whole top area is clickable and not just the topright (the 'X') as i wanted. How do i make only the X clickable and still align to the right?

my css is

.itembox 
{
    float:left;
}

.itembox .RemoveMediaNotif
{
    text-align: right;
    text-decoration:underline;
    cursor: pointer;
}

my html is

<div class="itembox" id="i16"><div class="RemoveMediaNotif">X</div><div ...
+1  A: 

Your outer div has to float left ? Otherwise I'd go (untested ) :

<div class='outer'><div class='x'>X</div></div>

and

.outer {
   //
}
.x {
  float:right;
}
David V.
+1  A: 
.itembox .RemoveMediaNotif
{
    float:right;
    text-decoration:underline;
    cursor: pointer;
}

Should fix your problem.

path411
A: 

You could absolutely position it from the right. That's what I'd do (I'm assuming it's some sort of close button):

.itembox  
{ 
    position: relative;
    float:left; 
} 

.itembox .RemoveMediaNotif 
{ 
    position: absolute;
    right: 0px;
    top: 0px; 
    text-decoration:underline; 
    cursor: pointer; 
} 
Andy E