As you can see in the snippet below, I have some text in the <p>
element, now let's say the <p>
text changes (in the front-end) to something different like 'The night is dark, cold, chilly' for example with different width, how can I get the box to be responsive? So keeping the same padding all around the text? I've right now placed it there using margin-left: 55%;
.full {
width: 500px;
height: 400px;
background-color: grey;
}
p {
text-transform: uppercase;
text-align: right;
background-color: green;
color: white;
margin-left: 55%; /* THIS HAS TO edited out? */
padding: 15px;
}
<div class="full">
<p>The woods are green</p>
</div>