I created this code, but I don't able to put the icon on the right corner of div with class valori.
Here the desired result :
Here the code :
HTML
<div class="circletop">
<div class="numberpr">3° anno</div>
<div class="lordo">Valore lordo stimato</div>
<!--I add div icon here-->
<div class="icon"></div>
<div class="valori"> <?=$min3_anno ." - " . $max3_anno?></div>
</div>
Here my fiddle : https://jsfiddle.net/5g42Lx7n/ I need to add the icon in the top right corner like image.
thanks
If you want to move the button to the right, you can also place the button within a <div> element and add the text-align property with its "right" value to the "align-right" class of the <div>.
Try using float: right; and a new div for the top so that the image will stay on top.
display: To display text and icons side by side, we will use the display: flex property. float: To set the icon on the right side of the div, we use float: right property.
If position: absolute; or position: fixed; - the right property sets the right edge of an element to a unit to the right of the right edge of its nearest positioned ancestor. If position: relative; - the right property sets the right edge of an element to a unit to the left/right of its normal position.
Check https://jsfiddle.net/bgo2e5zk/4/
.icon{position:absolute;right:0;top:-15px}
.valori{position:relative;}
I put the icon inside .valori
, then add position:relative
to .valori
and position:absolute
to .icon
, and to finish, set top and left
to the icon to positioning it.
You can add an icon like your showing image, here is the solution
HTML:-
<div class="circletop">
<div class="numberpr">3° anno</div>
<div class="lordo">Valore lordo stimato</div>
<!--I add div icon here-->
<div class="icon">my icon</div>
<div class="valori"> € 65.000 - € 67.000</div>
</div>
CSS:-
.circletop {
/* circle styles */
width: 300px;
height: 300px;
font-family: Raleway;
border: 1px solid #222;
border-radius: 50%;
margin: 0 auto;
box-shadow: 0 0 20px #ccc;
/* become a flex container */
/* its children will be flex items */
display: flex;
/* place items in column */
flex-direction: column;
/* center flex items horizontally */
align-items: center;
/* center all content vertically */
justify-content: center;
}
/* simulate one more item to "balance" dex text */
.circletop:before {
content: "\A0";
visibility: hidden;
}
.lordo {
color: #45cec8;
padding-top: 10px;
padding-bottom: 25px;
font-weight: bold;
font-size: 19px;
}
.valori {
border-radius: 50px;
background: #05c6bf;
padding: 14px;
width: 100%;
color: #fff;
text-align: center;
box-shadow: 0 0 9px #45cec8;
font-size: 25px;
font-weight: bold;
}
.icon {
position: relative;
bottom: -19px;
right: -162px;
}
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With