CSS에 액세스 할 수없는 경우 인라인 CSS를 사용하고 의미가있는 'PUSH (푸시)'방법을 사용하여 페이지 아래로 콘텐츠를 푸시하여 겹치지 않게 할 수 있습니다. 여기 JsFiddle은 : 당신이 인라인 CSS를 싫어하는 경우
<div style="position: fixed; top: 0; left: 0; width: 100%; height: 40px;>
Hello, I am Menu, nice to meet you.
</div>
<div class="container" style="margin-top: 40px;">
This is where your existing content lives.
</div>
그때 당신은 단순히 HTML5 몸 후 <style>
을 추가 할 수 있습니다 https://jsfiddle.net/SimonHayter/090ar1u0/
<div style="position: fixed; top: 0; left: 0; width: 100%; height: 40px;>
Hello, I am Menu, nice to meet you.
</div>
<div style="height:40px;width:100%;">
Let's push the page down 40px, you can't see me!
</div>
<div>
Existing Content
</div>
아니면 그냥 즉, 기존의 HTML이 margin-top
추가, 편집 할 수 과 같이 :
<body>
<style>
.menu {
position: fixed;
top: 0;
left: 0;
width: 100%;
height: 40px;
}
.container {
margin-top: 40px;
}
</style>
<div class="menu">
Hello, I am Menu, nice to meet you.
</div>
<div class="container">
Existing Content
</div>
</body>
당신은 다음 Modifying static content using a CGI script에 아파치를 사용할 수 있습니다 중 하나를 HTML에 액세스 할 수없는 경우.
페이지의 CSS를 변경할 수 없다면 클래스를 추가하면 어떤 이점이 있습니까? 어쨌든 너비가 100 % 인 새 div를 추가 할 수 있으며 고정 된 위치와 상위 0이지만 확장 할 수있는 Z- 색인이 포함될 수 있습니다. 그게 무슨 뜻입니까? – Tularis
나는 모든 사이트에이 최고 막대를 삽입하는 WordPress 플러그인을 추가하고 있으므로 원본 사이트를 개정 할 수 없으므로 그 의미를 알 수 있습니다. Z- 색인은 계속해서 내 최상위 막대와 잠재적 위치를 겹치게합니다. 상단 : 0; 요소. 내 상단 바를 사이트 상단에 배치 한 다음 전체 사이트를 상단 바 아래에 배치하여 기본적으로 iframe없이 제공되는 예제를 시뮬레이트합니다. – human