如何在图像的右下角放置图像?

时间:2013-09-04 09:50:34

标签: html css

this page (Roman Umismatics)上,我想定位黄色' bid'各个框架右下方的按钮。

当前代码

<p><a href="<?= $product->page_url() ?>"><img border="0" alt="Bid" src="/themes/roma/resources/img/bid.png" style="margin:0" /></a></p>

我需要更改哪些代码才能实现此目的?

6 个答案:

答案 0 :(得分:2)

为段落添加Class并将该段落向右侧。

这将有效。

<p class="alignright">

.alignright { float: right; }

答案 1 :(得分:2)

制作容器元素

.breakl

position: relative;

并制作出价按钮

position: absolute;
right: 0;
bottom: 0;

答案 2 :(得分:0)

只需添加'float:right;'到图像。

答案 3 :(得分:0)

p{
   float:right:
   margin-top:10px;
 }

答案 4 :(得分:0)

你的HTML是:

<p><a href="/auction/lot/0003" class="actionBtn"><img border="0" alt="Bid" src="/themes/roma/resources/img/bid.png" style="margin:0;"></a></p>

CSS:

.actionBtn{float:right;}

答案 5 :(得分:0)

本教程将有所帮助:

<强> http://css-tricks.com/absolute-positioning-inside-relative-positioning/

当您将父级设置为position:relative时,您可以在子级上使用与该容器相关的绝对定位。

<div class="parent">
 <a class ="child" href="<?= $product->page_url() ?>"><img border="0" alt="Bid" src="/themes/roma/resources/img/bid.png" style="margin:0" /></a>
</div>

在你的CSS中:

.parent { position:relative; }
.child { display:inline-block; position:absolute; bottom:0; right:0; }
相关问题