Ask positioning the element?

I am positioning that would make the asterisk was always in the top left corner ?

styles such
.star {

 margin-top: -145px;
 position: absolute;
 font-size: 13px;
 color: #fff;
 margin-left: 160px;
}


?>
 <span class="star">
<?
 echo '<div id="car'.$row_Recordset1['id'].'"-->';
 if (!$_SESSION['cart'] || !in_array($row_Recordset1['id'], $_SESSION['cart']))
 echo '<a onclick="send_cart('.$row_Recordset1['id'].', 1, \".$absolut_path.'\')"><img border="0" src="'.$absolut_path.'/icon/favor_off.png" title="add to Notepad"></a>';
 elseif($_SESSION['cart'] && in_array($row_Recordset1['id'], $_SESSION['cart']))
 echo '<a onclick="send_cart('.$row_Recordset1['id'].', 1, \".$absolut_path.'\')"><img border="0" src="'.$absolut_path.'/icon/favor_on.png" title="Remove from Notepad"></a>';
 echo ";
 echo '</span>';


5afe864e94b21500411618.png
June 5th 19 at 21:09
1 answer
June 5th 19 at 21:11
The parent (whole unit):
.parent{
 position: relative;
}

The icons favorite:
.star { 
 position: absolute;
 top: 10px;
 left: 10px;
 font-size: 13px;
 color: #fff;
}
still not out where there are photos, they are still going
5afe899656f4a377866647.png - Charlene.Gibson commented on June 5th 19 at 21:14
Show the html of one block 5afe8a0693b0b599178598.png
For example here https://jsfiddle.net/ - clovis.Veum49 commented on June 5th 19 at 21:17
, enter just the container of the unit itself, not the pictures.
position: relative;

A star post in it
z-index:99 - allene_Lubowitz commented on June 5th 19 at 21:20
did not understand how did this

css
.star {

 position: absolute;
 top: -145px;
 left: 160px;
}

.parent{
 position: relative;
}


unit

?>
 <span class="parent">
<?
 echo '<div id="car'.$row_Recordset1['id'].'"-->';
 if (!$_SESSION['cart'] || !in_array($row_Recordset1['id'], $_SESSION['cart']))
 echo '<a onclick="send_cart('.$row_Recordset1['id'].', 1, \".$absolut_path.'\')"><img class="star" border="0" src="'.$absolut_path.'/icon/favor_off.png" title="add to Notepad"></a>';
 elseif($_SESSION['cart'] && in_array($row_Recordset1['id'], $_SESSION['cart']))
 echo '<a onclick="send_cart('.$row_Recordset1['id'].', 1, \".$absolut_path.'\')"><img class="star" border="0" src="'.$absolut_path.'/icon/favor_on.png" title="Remove from Notepad"></a>';
 echo ";
 echo '</span>';


5afe8f27a6797520095272.png - Charlene.Gibson commented on June 5th 19 at 21:23
You ready-made HTML block show. You show only an asterisk and have the entire unit.
That's what the browser already :) - clovis.Veum49 commented on June 5th 19 at 21:26
, position: relative should be on the card itself, which includes photogray item and block descriptions. And if you need it on the right side, write right: 10px, and you write about the left side - jett_Hilpert commented on June 5th 19 at 21:29
<div class="card"> is the card block
<img> - here is a photo
<div class="star"></div>
<div class="card_body" <h1>this is header
 <p>description Here</p>
</div>
</div>


And here is the card class you need to set position: relative;
And for the star position: absolute; - allene_Lubowitz commented on June 5th 19 at 21:32

Find more questions by tags CSSHTML