I would like to add a padding around a text placed inside a div so that there is some place between the divs border and the text.
I have found an interesting post about that.
But somehow all the given examples expand my div so it does not fit in the entire layout anymore.
I have used that css code for the div:
.cell {
width:30%;
height:100%;
background-color:orange;
outline:10px solid black;
}
That code gives me the following result:
The orange colored area is the div I want to have the text positioned in. All the solutions keep expanding the div with borders so the layout expands and that is what I am trying to avoid to.
So I have tried to add padding (that should be inside the div):
.cell {
width:30%;
height:100%;
background:orange;
padding: 10%;
}
Gave me the result:
Perhaps the problem is that I am using jQuery BigText to make the text fitting into the div:
jQuery:
$(function() {
$(window).on('resize', function() {
$(".area_competences_text").bigText();
});
$(window).trigger('resize');
});
Html:
<div class ="cell">
<div class="area_competences_text text_software">
<div class="referencesProductHeader">
HEADER TEXT
</div>
<ul class="listStyle">
<li>Some Text</li>
<li>Some Text</li>
<li>Some Text</li>
<li>Some Text</li>
<li>Some Text</li>
</ul>
</div>
</div>