Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
重现这种效果的最佳方法是什么
在任何决议?有什么办法可以强制这些元素(页眉、内容区域、菜单项和页脚)彼此之间始终具有相同的相对位置,以便它们始终保持完美对齐而不会破坏弯曲效果,或者我应该去CSS 掩码?
到目前为止,所有元素都是图像,除了文本。
这很简单。要让元素始终出现在中心,请添加到其 css
margin: 0 auto;
至于页脚,首先制作一个背景 div(将您的图像设置为背景)
width: 100%;
并在其中再次放置一个div:
然后将所有这些 div 和图像放在主容器中
position: absolute; bottom: 0px;
根据我的经验,在处理布局时,使用边距、填充和固定宽度总是比使用相对或固定定位更好。