Solved

need a floating title

Posted on 2006-11-24
9
157 Views
Last Modified: 2010-04-09
I need a title that wil always be in the same place (the top) regardless of whether the user has scrolled don to the bottom of the page.

Can someone tell me how to do this?



newbieweb
0
Comment
Question by:newbieweb
  • 5
  • 4
9 Comments
 
LVL 10

Accepted Solution

by:
ADSLMark earned 500 total points
ID: 18010600
You can use frames... and otherwise you need CSS.

--HTML--
<frameset rows="100, *">
<frame src="titlepage.html" />
<frame src="index.html" />
</frameset>

--CSS--
<head>
<style type="text/css">
div.content
{
  height: 100%;
  overflow: auto;
}
div.title
{
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
}
body
{
  overflow-y: hidden;
}
</style>
</head>
<body>
<div class="title"></div>
<div class="content"></div>
</body>

Good luck.
Mark
0
 

Author Comment

by:newbieweb
ID: 18011317
Mark,

Which parts go in the style sheet and which parts go in the HTML page?

My compiler didn't recognize: overflow-y: hidden;

"overflow-y" is not a known CSS property name.

newbieweb
0
 
LVL 10

Expert Comment

by:ADSLMark
ID: 18011334
div.content
{
  height: 100%;
  overflow: auto;
}
div.title
{
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
}

goes into the css file and

<div class="title"></div>
<div class="content"></div>

in the html file.

Mark
0
 

Author Comment

by:newbieweb
ID: 18017211
Mark,

I put the word "Glossary" into both the title and the content.  And in both cases the text scrolls with the window.

I need it to stay put, even when I scroll the window.

Any suggestions?

newbieweb
0
Better Security Awareness With Threat Intelligence

See how one of the leading financial services organizations uses Recorded Future as part of a holistic threat intelligence program to promote security awareness and proactively and efficiently identify threats.

 
LVL 10

Expert Comment

by:ADSLMark
ID: 18017342
What browser?

Mark
0
 

Author Comment

by:newbieweb
ID: 18017359
IE 6
0
 
LVL 10

Expert Comment

by:ADSLMark
ID: 18017398
I tried it, using IE6, it works in my opinion. Take a look:

<html>
<head>
<style>
div.content
{
  height: 100%;
  overflow: auto;
}
div.title
{
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
}
</style>
</head>

<body>
<div class="title">Glossary (this one should stay on top)</div>
<div class="content">
Glossary<br/><br/><br/><br/><br/><br/><br/>Glossary<br/><br/><br/><br/><br/><br/><br/>Glossary<br/><br/><br/><br/><br/><br/><br/>Glossary<br/><br/><br/><br/><br/><br/><br/>Glossary<br/><br/><br/><br/><br/><br/><br/>Glossary<br/><br/><br/><br/><br/><br/><br/>Glossary<br/><br/><br/><br/><br/><br/><br/>Glossary<br/><br/><br/><br/><br/><br/><br/>Glossary<br/><br/><br/><br/><br/><br/><br/>Glossary<br/><br/><br/><br/><br/><br/><br/>
</div>
</body>
</html>

Mark
0
 
LVL 10

Expert Comment

by:ADSLMark
ID: 18017403
Using external stylesheet:

==test.html==
<html>
<head>
<link rel="stylesheet" href="mystyle.css" type="text/css" />
</head>

<body>
<div class="title">Glossary (this one should stay on top)</div>
<div class="content">
Glossary
<br/><br/><br/><br/><br/><br/><br/>
Glossary
<br/><br/><br/><br/><br/><br/><br/>
Glossary
<br/><br/><br/><br/><br/><br/><br/>
Glossary
<br/><br/><br/><br/><br/><br/><br/>
Glossary
<br/><br/><br/><br/><br/><br/><br/>
Glossary
<br/><br/><br/><br/><br/><br/><br/>
Glossary
<br/><br/><br/><br/><br/><br/><br/>
Glossary
<br/><br/><br/><br/><br/><br/><br/>
Glossary
<br/><br/><br/><br/><br/><br/><br/>
Glossary
<br/><br/><br/><br/><br/><br/><br/>
</div>
</body>
</html>

==mystyle.css==
div.content
{
  height: 100%;
  overflow: auto;
}
div.title
{
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
}

Mark
0
 

Author Comment

by:newbieweb
ID: 18017407
Mark,

Yes it sure does work. I must have done something wrong when I integrated it.

Thanks.
0

Featured Post

IT, Stop Being Called Into Every Meeting

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

Join & Write a Comment

Suggested Solutions

Title # Comments Views Activity
Column Spacing 3 38
SVG Star 4 18
gif banner animation loads randomly in mobile 3 39
Create html table using xsl 8 12
Deprecated and Headed for the Dustbin By now, you have probably heard that some PHP features, while convenient, can also cause PHP security problems.  This article discusses one of those, called register_globals.  It is a thing you do not want.  …
This article discusses four methods for overlaying images in a container on a web page
In this tutorial viewers will learn how to position overlapping items using z-index in CSS. They will also learn the restrictions on the z-index property.  Create a new HTML document with an internal stylesheet.: Create a div in CSS and name it Red.…
In this tutorial viewers will learn how to embed an audio file in a webpage using HTML5. Ensure your DOCTYPE declaration is set to HTML5: : The declaration should display (CODE) HTML5 is supported by the most recent versions of all major browsers…

744 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

10 Experts available now in Live!

Get 1:1 Help Now