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.
大家好,我在我的页面中有一个背景图像,并且想将我的所有超链接移动到屏幕右侧 5 厘米,这样它就不会覆盖背景图像。你们能告诉我如何完成这项任务吗?目前我的页面中只有几个超链接,但后来我想添加更多内容,并希望将所有这些内容缩进屏幕右侧 5 厘米。
<body id="ct600_bodytag" style="background:url(./images/bg.jpg) no-repeat fixed top center #fff;">
如果您想在正文中提供所有内容,只需将其添加到标签中
body{ margin-left:5cm; }
http://jsfiddle.net/gH2eP/
你为什么不在你的标签中使用这样的东西<head>?
<head>
<style> body * { margin-left: 5cm; } </style>
甚至更简单
<style> body { padding-left: 5cm; } </style>