I have a css that has a text-align: center
, as I want most of my elements centered, however there is an element that I want to be towards top left.
I could do it by changing the margin-right: ??px
. But I feel that this is not the best approach. Is there a better way to top left an element inside a text-align: center
div.
dropbox
contains the text-align: center
. I want the img
to be top left.
img {
text-align: left;/*(does not work)*/
margin-right: 95px;/*(works but dont think is the best approach)*/
}
.dropbox {
text-align: center;
}
<div class="dropBox">
<img src="pdf.jpg" id="pdf"/><br>
</div>