Html 我的标题图像在向下滚动之后

Html 我的标题图像在向下滚动之后,html,css,Html,Css,我正在尝试为手机创建一个左侧菜单,但我遇到了一个问题: 当我滚动我的内容时,标题图像跟随滚动并隐藏一些内容。我需要把我的头球固定在它的位置上 下面是我的问题的一个例子: 我的Html: 下面是一个与您的需求相关的示例。滚动页面时,页眉区域将粘在顶部。根据您的要求做一些更改。希望它能帮助你 您的标题标签是否添加了样式?谢谢您的回答naresh kumar。但是我已经试过了你的例子,但是在我的例子中不起作用!如果您尝试我的JSFIDLE中的内容,您将看到我的标题消失了! <header id=

我正在尝试为手机创建一个左侧菜单,但我遇到了一个问题:
当我滚动我的内容时,标题图像跟随滚动并隐藏一些内容。我需要把我的头球固定在它的位置上

下面是我的问题的一个例子:

我的Html:


下面是一个与您的需求相关的示例。滚动页面时,页眉区域将粘在顶部。根据您的要求做一些更改。希望它能帮助你


您的标题标签是否添加了样式?谢谢您的回答naresh kumar。但是我已经试过了你的例子,但是在我的例子中不起作用!如果您尝试我的JSFIDLE中的内容,您将看到我的标题消失了!
<header id="top">   
    <span id="logo"><a href="index.php"><img  src="http://placehold.it/350x150" /></a></span>
</header>
<div id="menu">
    <ul>
        <li><a href="#">Menu Item 1</a>
        </li>
        <li><a href="#">Menu Item 2</a>
        </li>
        <li><a href="#">Menu Item 3</a>
        </li>
    </ul>
</div>
<div id="right">
    <div id="menubar">
        <div id="button">Menu</div>
    </div>
    <p>Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since the 1500s, when an unknown printer took a galley of type and scrambled it to make a type specimen book. It has survived not only five centuries, but also the leap into electronic typesetting, remaining essentially unchanged. It was popularised in the 1960s with the release of Letraset sheets containing Lorem Ipsum passages, and more recently with desktop publishing software like Aldus PageMaker including versions of Lorem Ipsum.</p>
    <p>Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since the 1500s, when an unknown printer took a galley of type and scrambled it to make a type specimen book. It has survived not only five centuries, but also the leap into electronic typesetting, remaining essentially unchanged. It was popularised in the 1960s with the release of Letraset sheets containing Lorem Ipsum passages, and more recently with desktop publishing software like Aldus PageMaker including versions of Lorem Ipsum.</p>
    <p>Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since the 1500s, when an unknown printer took a galley of type and scrambled it to make a type specimen book. It has survived not only five centuries, but also the leap into electronic typesetting, remaining essentially unchanged. It was popularised in the 1960s with the release of Letraset sheets containing Lorem Ipsum passages, and more recently with desktop publishing software like Aldus PageMaker including versions of Lorem Ipsum.</p>
</div>
 * {
     padding: 0px;
     margin: 0px;
 }
 #top {
     width:226px;
     margin:10px auto 10px auto;
 }
 #logo {
     float:left;
 }
 #menubar {
     width:100%;
     background-color:#444;
     color: #fff;
     padding: 10px;
 }
 #button {
     cursor:pointer;
 }
 #menu, #right {
 }
 #menu li a {
     padding: 10px;
     display: block;
     color: white;
     text-decoration: none;
 }
 #right {
     width:100%;
     background-color: #fff;
     z-index: 5;
     position: fixed;
     overflow: scroll;
     left: 0px;
     height: 100%;
     -webkit-box-shadow: -5px 0px 4px 0px rgba(0, 0, 0, 0.2);
     moz-box-shadow: -5px 0px 4px 0px rgba(0, 0, 0, 0.2);
     o-box-shadow: -5px 0px 4px 0px rgba(0, 0, 0, 0.2);
     box-shadow: -5px 0px 4px 0px rgba(0, 0, 0, 0.2);
 }
 #right p {
     padding: 10px;
 }
 #menu {
     float:left;
     width: 350px;
     height: 100%;
 }
 #menu li {
     background-color:#444;
     border-bottom: 1px solid #888;
 }