如何在图像中对齐以将其垂直移动?(CSS,HTML)? [英] How do I align in my image to move it vertically up?(CSS,HTML)?

查看:91
本文介绍了如何在图像中对齐以将其垂直移动?(CSS,HTML)?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

一个基本的CSS / HTML问题。正如我的屏幕截图所示,左侧有一个箭头图像,我想以箭头的中点略高于文本中点的方式移动它。也许这是基本的东西,但在CSS的什么属性会帮助我做到这一点?

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?

我有一个css类的图像是这样的。

I have a css class for the image something like this.

<img src="images/block_arrow.png" class="t-image imagestyle1" alt="image"/>

谢谢,Adarsh

推荐答案

添加以下css。

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 */
}

这篇关于如何在图像中对齐以将其垂直移动?(CSS,HTML)?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆