html - Div填充不遵循html

标签 html

所以基本上我是在尝试将我的 Div 400px 中的项目向右移动。我已经在源 html 中添加了“padding-left:400px”,但是每次我运行代码时,就像你在图片中看到的那样,它会回到 42px,当我将 inspect 元素中的数字更改为 400 时,它看起来正常,有什么理由这样做吗?

Inspect

这是我的 div 代码片段:

 <div class="content" style="border-bottom-width: 300px;margin-bottom: 0px;height: 430px !important;">
        <div class="footer-grids" style="
width: 1500px;
padding-left: 400px;
margin-top: 100px;

最佳答案

您的代码没有问题,您缺少关闭的 div,您需要检查关闭的 div 是否正确尝试使用下面的代码片段,只需检查一下

<div class="content" style="border-bottom-width: 300px;margin-bottom: 0px;height: 430px !important;">
	<div class="footer-grids" style="width: 1500px;padding-left: 400px;margin-top: 100px;"></div>
</div>

截图在这里

image here

关于html - Div填充不遵循html,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/42060751/

相关文章:

html - 具有 3 个固定宽度列的页面

html - 将 HTML 转换为 MJML?

html - 包含选项卡的 div block 和常规 div block 。并排放置,它们之间有空间

css - 带有渐变的文本淡入淡出的 div - 自动溢出

javascript - 垂直对齐 (HTML)

javascript - 触摸浏览器中的元素(如指针事件 : none)

html - 如何将一个div从某个位置拉伸(stretch)到页面底部?

javascript - 如何识别双击 SELECT 元素中的多个

html - 对齐嵌套的 Div 和 H2

html - 如何使iframe随页面缩放