Solved

need a floating title

Posted on 2006-11-24
9
185 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
Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

 

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
 
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

Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
Javascript_Set_dropdown_value 7 40
Html Table looping 4 25
parse url to form? 7 25
Copying table data to one another 15 29
SASS allows you to treat your CSS code in a more OOP way. Let's have a look on how you can structure your code in order for it to be easily maintained and reused.
This article discusses how to create an extensible mechanism for linked drop downs.
In this tutorial viewers will learn how to style a corner ribbon overlay for an image using CSS Create a new class by typing ".Ribbon":  Define the class' "display:" as "inline-block": Define its "position:" as "relative": Define its "overflow:" as …
In this tutorial viewers will learn how to embed Flash content in a webpage using HTML5. Ensure your DOCTYPE declaration is set to HTML5: "<!DOCTYPE html>": Use the <object> tag to embed Flash content.: To specify that the object is Flash content, d…

808 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