Here is the code snippet I am working with:
.pa {
width: 400px;
background: #008000;
position: relative;
}
.icon-wrap {
height: 100%;
float: right;
width: 30px;
background: yellow;
padding: 5px;
position: absolute;
top: 0px;
right: 0px;
}
<div class="container">
<div class="pa">
Text Text Text Text Text Text Text Text Text Text Text Text Text Text Text Text Text Text Text Text Text Text Text Text Text Text Text Text Text Text Text Text Text Text Text Text Text Text Text Text Text Text Text Text Text Text Text Text Text Text
Text Text
<div class="icon-wrap">
<a><i class="fa fa-camera pull-right"></i></a>
</div>
</div>
</div>
The issue I am facing is that the yellow div
is overlapping the text of the parent div
. I want to find a solution to wrap the text in order to prevent this overlap. Can anyone help me with this?
Update Note:
I have tried adding padding-right:30px
which works, but ideally I would like to find a solution by only changing the .icon-wrap
class. Is there any way to achieve this?