jquery - 图像上的 div float 位置

标签 jquery html css

我的问题是 .figure 字段是 100%,但是 .recomddo 在不去 .figure 的 Angular 的情况下在图像上没有位置> ,我想要的是位置 img 上的 .recomddo

如何用 jQuery 或 css 实现这种效果,我们感谢帮助

        figure.envoltura {
            position: relative;
            display: block;
            margin-bottom: 40px;
        }
        figure {
            margin: 0;
        }
        .page_img {
            border: 2px solid #ddd;
            background-color: #fff;
        	max-width: 100%;
        }
        .recomddo, .recomddo:before {
            width: 40px;
            height: 40px;
            line-height: 40px;
            text-align: center;
            color: #fff;
        }
        .recomddo {
            position: absolute;
            background-color: #F1C40F;
            top: 10px;
            right: -10px;
            border-radius: 5px 5px 0 5px;
            font-weight: bold;
        }
        .recomddo:after {
            width: 0;
            height: 0;
            border-top: 10px solid #C19D0C;
            border-right: 10px solid transparent;
            content: '';
            position: absolute;
            bottom: -10px;
            right: 0;
        }
      <figure id="fig_solo" class="envoltura">
            <img class="page_img" src="http://placehold.it/350x150">
        	<span class="recomddo">1</span>
        </figure>

最佳答案

.recomddo {
    position: absolute;
    background-color: #F1C40F;
    top: 0px;
    left: 322px;
    border-radius: 5px 5px 0 5px;
    font-weight: bold;
}

希望这对你有用。

关于jquery - 图像上的 div float 位置,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/34573031/

相关文章:

jquery - 如何将纪元转换为 Javascript 日期以及将日期转换为纪元?

html - 在 html/css 中显示包括颜色的卡片套装

html - !default css font-family 特异性标签

javascript - HTML 选择列表 - 如何使用 jQuery 添加水印?

javascript - 模式中的表单以相同的操作提交(相同的 PHP 文件)

javascript - 当 javascript 值插入到 .net 文本框时,document.getElementsByName(...)[0] 未定义

c# - 如何获取在按钮按下事件期间创建的信息以显示在我的 html 页面上?

html - css 分割宽度 100% 到 3 列

php - 使用 PHP 在 CSS 文件中生成部分背景 URL

仅在一侧的 CSS3 轮廓虚线边框