如何冻结页面的标题 [英] How to freeze header of the page

查看:133
本文介绍了如何冻结页面的标题的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我的网络模板基于div标签。我想冻结标题部分(标题,徽标等),我的意思是当你滚动页面标题应该在固定位置。

My web template is based on div tags. I want to freeze header part (Header, logo etc), I mean when you scroll the page the header should be in fixed position.

 <!--Header and Logo -->
 <div id="outer">
 <div id="header">
   <h1><a href="#">Some Application</a></h1>
   <img src="/media/images/logo.gif"  height="95" width="190">
 </div>

以下是我的css

#outer
{

}
/* Header */
#header
 {
height: 95px;
background-image: url();
background-repeat:no-repeat;
background-position: bottom left;
padding-left: 20px;
padding-top: 15px;
padding-bottom: 15px;
}

有人能帮我吗?感谢

推荐答案

尝试使用 position:fixed; 属性。下面是一个例子:
http://jsfiddle.net/austinbv/2KTFG/

Try using the position: fixed; property. Here is an example fiddle: http://jsfiddle.net/austinbv/2KTFG/

这篇关于如何冻结页面的标题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆