如何解决使用 CSS 根据屏幕大小停止项目移动 - Wordpress/Divi
我正在尝试为我们的 Wordpress 网站上的 Divi Overlay 自定义关闭按钮代码。 我可以很好地定位按钮,但是当我调整窗口大小或在平板电脑上查看时,按钮会移动。我试过使用 Position:relative/fixed/absolute 但这些似乎都不起作用。
对于上下文 - 此代码位于 Divi 构建器中的代码模块中,该模块位于一行中的一个部分中。
这是按钮的代码;
<pee><a class="close-divi-overlay" href="#close">×</a></pee>
<style>
a.close-divi-overlay {
/* a) Control the position of the close button*/
right: 450px!important;
top: 150px !important;
z-index: 10010 !important;
display: block !important;
position: absolute !important;
/* b) Size of the close button - Adjust if is necessary*/
width: 46px !important;
height: 48px !important;
font-size: 28px !important;
line-height: 48px !important;
/* c) Background and border of the close button*/
background: none repeat scroll 0 0 #ffffff !important;
border: solid 0px #fff !important;
border-radius: 50% !important;
box-shadow: 0 2px 3px #888 !important;
/* d) Font styles*/
color: #0B3E5C !important;
font-family: !monospace !important;
font-weight: bold !important;
text-align: center !important;
text-decoration: none !important;
}
</style>
那么有没有办法让这个按钮在调整窗口大小时不会移动?
版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。