我试图在我的测试页(在桌面视图中)的右侧栏目中找到一个按钮,以占据移动视图中页面的整个页脚。
这是我正在使用的css和js代码:
@media screen and (max-width: 768px) {
#register_text_container {
position: fixed;
bottom: 0px;
}
}
$(function() { //doc ready
if (!($.browser == "msie" && $.browser.version < 7)) {
var target = "#register_text_container", top = $(target).offset().top - parseFloat($(target).css("margin-top").replace(/auto/, 0));
$(window).scroll(function(event) {
if (top <= $(this).scrollTop()) {
$(target).addClass("fixed");
} else {
$(target).removeClass("fixed");
}
});
}
});
js代码不是我的,它是我在搜索stackoverflow时发现的,并且运行良好,只是似乎无法弄清楚如何使其填充页面。我试过使用,width: 100%
但是没有用。
我在CSS代码中调用的容器是我没有直接访问权限的容器,它内置于CMS中,并作为按钮弹出。
当我检查“注册”按钮以查看html代码以查看应该在css文档中调用的内容时,这就是我发现的内容:
<div class="entry-page-button-container" id="register_link_container">
<div class="manageable-content" data-container="edit_register_text_container">
<a class="entry-text-link secondary-step step-button" id="register_text_container" href="">Register</a>
</div>
</div>
我已经在每个类和id上进行了尝试,到目前为止,仍然无法获取注册按钮来占用页面的整个宽度。
感谢我能得到的任何帮助。
谢谢!
您width: 250px !important
在此链接上有一个将其.entry-text-link secondary-step step-button
更改为width:100%;
(并删除!important
,不需要)。
然后在这个元素中添加left:0;
和right:0;
fixed
.entry-page-button-container
并且它应该可以正常工作。
本文收集自互联网,转载请注明来源。
如有侵权,请联系[email protected] 删除。
我来说两句