gpt4 book ai didi

css - 左边距 css 不工作

转载 作者:行者123 更新时间:2023-11-28 04:20:53 24 4
gpt4 key购买 nike

我正在使用 jquery 日期选择器,我将日期选择器添加到我的 jsp 页面,我想将它向左移动,但它不起作用..
在我的 jsp 页面中,我有

<div id="datepicker" class="datepicker">
<script>
$("#datepicker").datepicker();
</script>
</div>

在我的 css 文件中有

.datepicker{

margin-top:20px;
margin-left:600px;
position: fixed;

}

但是元素总是在左上角。有人对此有解决方案吗?当我想定位元素时,我总是使用 margin-top 和 margin-left,而且它总是有效。提前致谢!

最佳答案

我无法让日期选择器函数在 codepen 上运行,但 CSS 格式化部分工作正常:https://codepen.io/anon/pen/OWdXKL

<style>
.datepicker{
margin-top:20px;
margin-left:600px;
position: fixed;
};
</style>

<div id="datepicker" class="datepicker">this div is 600 px from the left; 20 px from the top</div>

<script>
$( "#datepicker" ).datepicker();
</script>

我的猜测是您的样式表中的其他地方覆盖了您提供的片段中定义的边距。

关于css - 左边距 css 不工作,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/42214210/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com