html - 如何用 CSS 对齐两张图片,一张在右上角,另一张在右下角?

标签 html css

如何使用 CSS 对齐两张图片,一张在右上角位置,另一张在右下角位置?

这是标记

<th class="X" scope="col">
Time
<input id="ORAAsc" class="up" type="image" style="border-width:0px;" src="" name="ctl00$ContentPlaceHolder1$GridView1$ctl02$ORAAsc">
<input id="Desc" class="down" type="image" style="border-width:0px;" src="" name="ctl00$ContentPlaceHolder1$GridView1$ctl02$ORADesc">
</th>

和 CSS

.X {
    height:33px;
    background-color:#DEDEDD;
    width:75px;
    bottom:0;
    top:0;
    left:0;
    right:0;
    margin-top:20px;
    margin-bottom:20px;
    margin-right:80px;
    margin-left:80px;
}





.up{What should i place here?}

.down{What should i place here?}

谢谢你的时间

最佳答案

jacktheripper 是对的。使用绝对定位时,向包含元素添加其他内容通常是个好主意:

   .x{
    position:relative;
}

这将确保图像相对于容器的位置绝对定位。

关于html - 如何用 CSS 对齐两张图片,一张在右上角,另一张在右下角?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/9144847/

相关文章:

html/css 响应式 3 列布局 - 将右列堆叠在左列下方

css - 选择具有相同属性值的元素

html - 制作文本并选择水平下拉菜单

javascript - 使用 JS/jQuery 获取未显示图像的宽度

javascript - 使用 $.post 获取数据后使用 jQuery 调用 click 函数

javascript - SVG 元素在 Opera 和 IE 中不接收事件

css - 背景图像未在 Web 浏览器中呈现

javascript - Kendo UI 股票图表导航器损坏

jquery - 自动完成下拉列表未正确显示

php - 将用户信息插入mysql数据库