When I give a line-height
to the text div
(span
, p
, etc.) and drag it in the browser, the selection box has an ugly empty space like this:
I want to lift up the text itself inside of the selection box for looking more better when the user is dragging it. I've searched about this topic on Google but couldn't find any clues to do this.
Are there any ways to solve this problem?
Code:
* {
margin: 0 auto;
padding: 0;
}
div, section {
position: relative;
}
.text {
width: 400px;
height: 600px;
font-family: Helvetica;
line-height: 2rem;
/* giving flex doesn't work to the text itself. */
display: flex;
flex-flow: row;
justify-content: center;
align-items: center;
/* again, align-self or content doesn't affected to the text. */
align-self: center;
align-content: center;
border: 1px solid black;
}
p {
display: inline-flex;
vertical-align: center; /* vertical align doesn't work to the text */
align-self: center;
align-content: center;
}
<div class="text">
<p>
Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.
</p>
</div>