如何使用 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?}
感谢您的宝贵时间
How can i align two images with CSS, the one in Upper Rigth position and the other in Down-right position?
Here is the markup
<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>
and the 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?}
Thank you for your time
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
杰克瑟珀是对的。使用绝对定位时,向包含元素添加另一件事通常是个好主意:
这将确保图像相对于其容器的绝对定位。
jacktheripper is right. It's usually a good idea to add one other thing to the containing element when using absolute positioning:
This will ensure that the images will be absolutely positioned relative to that of their container.
尝试
Try