Solved

need a floating title

Posted on 2006-11-24
9
167 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
Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

 
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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Introduction The Google Maps API offers various ways to draw dynamic and static maps.  Using a combination of PHP and JavaScript, you can draw active JavaScript maps that allow pan-and-zoom in the client browser window.  You can also draw "static" …
Not sure what the best email signature size is? Are you worried about email signature image size? Follow this best practice guide.
In this tutorial viewers will learn how to style transparent/translucent elements using alpha transparency in CSS Start with a normal styled element, such as a div.: Define its "background-color" property as "rgba (255, 255, 255, .5): The numbers in…
The viewer will learn the basics of jQuery including how to code hide show and toggles. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery…

919 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

17 Experts available now in Live!

Get 1:1 Help Now