Need to create a shape attached.
Remove the icon border of an specific position and move that in the top left of the rectangle using css and html with bootstrap5. image is not positioning correctly inside the rectangle.
.node {
position: relative;
display: flex;
align-items: center;
background-color: #4CAF50;
/* Green background color */
color: white;
font-weight: bold;
border-radius: 15px;
width: 200px;
/* Adjust as needed */
height: 80px;
/* Adjust as needed */
padding-left: 50px;
/* Space for the image */
}
.node-image {
position: absolute;
left: -25px;
/* Half of the circle's diameter */
width: 50px;
height: 50px;
background-color: white;
border-radius: 50%;
display: flex;
align-items: center;
justify-content: center;
overflow: hidden;
}
.node-image i {
width: 40px;
height: 40px;
}
.node-text {
margin-left: 10px;
}
<div class="node">
<div class="node-image">
<i class="bi bi-box"></i>
</div>
<div class="node-text">Name</div>
</div>
2
Answers
Move to circle to top and add border with same color and it will look how you aspect. Below is working example of same.
Add
border
to the circle and applybox-shadow
to the top and left side of it usingbox-shadow: -1px -1px 0px 0px rgb(0, 0, 0);
andborder: 6px solid #4caf50;
to the circle to achieve your result.