A basic CSS/HTML question. As shown in my screenshot, there is an image of an arrow in the left, I want to move it in such a way that the mid point of the arrow is slightly above the mid point of the text following that. Probably this is basic stuff, but what property in css will help me do that?
I have a css class for the image something like this.
<img src="images/block_arrow.png" class="t-image imagestyle1" alt="image"/>
Thanks,Adarsh
To center an image vertically, you can wrap it in a block element like a div and use a combination of the CSS position property, the left and top properties, and the transform property.
To center both vertically and horizontally, use padding and text-align: center : I am vertically and horizontally centered.
For example, if you're trying to align something horizontally OR vertically, it's not that difficult. You can just set text-align to center for an inline element, and margin: 0 auto would do it for a block-level element.
Add following css..
.t-image {
position: relative /* Declared position allows for location changes */
top: -2px; /* Moves the image 2px closer to the top of the page */
}
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With