【问题标题】:Placing a button over an Image in a SharePoint webpart在 SharePoint Webpart 中的图像上放置一个按钮
【发布时间】:2016-07-25 15:08:20
【问题描述】:

在 SharePoint Webpart 中设置按钮样式以使其位于动态设置的图像上时遇到困难。

HTML:

    <div id="nhaole-header-eloqua" class="imageArea">
    <img id="headerImage" src="<%=headerImageURL%>" />
    <div id="applyArea">
        <input id="applyNowBtn" type="button" value="Apply Now" class="applyButton" />
    </div></div>

CSS

        #headerImage {
        position:relative !important;
    }
    #applyArea {
        position:absolute !important;
         width: 100px !important;
         left:10% !important;
         top:50% !important;
    }

这种方法一直有效,直到您缩放窗口然后按钮不与图像保持一致。

【问题讨论】:

  • 如果您需要支持多分辨率,请编写媒体查询。根据屏幕固定图像宽度和高度

标签: html css sharepoint


【解决方案1】:

我昨天可能需要更多的咖啡。

我发现我自己的问题是我需要使父 div 相对

#nhaole-header-eloqua { position:relative !important; } #applyArea { position:absolute !important; width: 100px !important; left:10% !important; top:50% !important; }

【讨论】:

    猜你喜欢
    • 2012-11-06
    • 1970-01-01
    • 2014-01-01
    • 2012-09-16
    • 2012-02-25
    • 1970-01-01
    • 2013-05-09
    • 1970-01-01
    • 2018-10-12
    相关资源
    最近更新 更多