Image showing the desired result
I have three lines of text describing a user, which are centrally aligned.
Now I seek to add an icon to the username, which I have done using ::after styling in CSS (see below).
However, this then is considered when centering the first line. What I'd ideally like is for the username to be aligned centrally with the rest of the text and to then place the icon to the right of that without affecting the alignment at all.
How can I do this?
HTML
<div class="user-name">
<p> David Wood </p>
</div>
<p class="user-type"> Teacher </p>
<p class="user-email"> d.wood@school.ac.uk</p>
(part of my) CSS
.user-name p::after {
content: '';
background: url('homeimages/dropdown-black.png') left center no-repeat;
vertical-align: middle;
background-size: 10px auto;
padding-left: 20px;
padding-top:-20px;
white-space:pre;
}