simple html question about anchors

C

cronoklee

Is it possible to set an anchor to jump to the middle of the screen
rather then the top when it is called? Needless to say I cannot just
move the anchor higher up the page ;c)

cheers,
Ciaran
 
T

tbar

Is it possible to set an anchor to jump to the middle of the screen
rather then the top when it is called? Needless to say I cannot just
move the anchor higher up the page ;c)

cheers,
Ciaran

Not that I've heard of.
 
C

code_wrong

Is it possible to set an anchor to jump to the middle of the screen
rather then the top when it is called? Needless to say I cannot just
move the anchor higher up the page ;c)



Do you mean something like this:
<a href="#tips">Jump to the Useful Tips Section</a>
blah
blah
blah
blah
blah
blah
blah
blah
blah
<a name="tips"></a>
blah
blah
blah
blah
blah
blah
blah
blah
blah
Useful Tips Section
blah
blah
blah
blah
blah
blah
blah
blah
blah
 
D

dorayme

code_wrong said:
Do you mean something like this:
<a href="#tips">Jump to the Useful Tips Section</a>
blah
blah
blah
blah
blah
blah
blah
blah
blah
<a name="tips"></a>
blah
blah
blah
blah
blah
blah
blah
blah
blah
Useful Tips Section
blah
blah
blah
blah
blah
blah
blah
blah
blah

Its hard enough to understand what OP wants without supposing he
wants to jump to the useful tips section well before that
section?
 
C

code_wrong

dorayme said:
Its hard enough to understand what OP wants without supposing he
wants to jump to the useful tips section well before that
section?

yes it is a bit of a stab in the dark
 
C

CRON

Hi, Thanks for the replies: regarding code_wrong's post (quoted below).
I am looking for the this exact effect but the line:
<a name="tips"></a>
MUST be next to or beside the line:
Useful Tips Section

I cannot simply move the anchor up the page because it is generated as
part of a database list from PHP. So I need a way for the anchor to
find the centre of the screen rather then the top when called.

Any ideas?
Thanks
Ciaran
 
J

Jonathan N. Little

Ciaran, please don't top post.
Hi, Thanks for the replies: regarding code_wrong's post (quoted below).
I am looking for the this exact effect but the line:
<a name="tips"></a>
MUST be next to or beside the line:
Useful Tips Section

I cannot simply move the anchor up the page because it is generated as
part of a database list from PHP. So I need a way for the anchor to
find the centre of the screen rather then the top when called.

Long ago I once experiment to do the very same thin in order to clear an
absolute positioned header at the top of the page. The bottom line was
it required JavaScript. The JavaScript got very complicated and results
was hardly satisfactory. Cross browser differences problem, trapping the
scroll via a link using a hash vs. just a page scroll, determining the
proper offset and then not triggering page scroll adjustment....it goes
on and on... There just is no really good way to accomplish what you
wish. The best solution is to adjust your php that outputs the db
results to make the anchor at the very top of the output and maybe tweak
your CSS to provide extra space to push the output into view.

A[name] { display: block; margin-bottom: 2em; }


<snipping the rest>
 
C

CRON

Jonathan,
Thanks for the reply - it's good to have an answer even tho its not
what I wanted to hear ;c) I'll try the CSS margin. Cheers,

Not sure what top posting is, but if you let me know I'll try to avoid
it!

Ciaran


Ciaran, please don't top post.
Hi, Thanks for the replies: regarding code_wrong's post (quoted below).
I am looking for the this exact effect but the line:
<a name="tips"></a>
MUST be next to or beside the line:
Useful Tips Section

I cannot simply move the anchor up the page because it is generated as
part of a database list from PHP. So I need a way for the anchor to
find the centre of the screen rather then the top when called.

Long ago I once experiment to do the very same thin in order to clear an
absolute positioned header at the top of the page. The bottom line was
it required JavaScript. The JavaScript got very complicated and results
was hardly satisfactory. Cross browser differences problem, trapping the
scroll via a link using a hash vs. just a page scroll, determining the
proper offset and then not triggering page scroll adjustment....it goes
on and on... There just is no really good way to accomplish what you
wish. The best solution is to adjust your php that outputs the db
results to make the anchor at the very top of the output and maybe tweak
your CSS to provide extra space to push the output into view.

A[name] { display: block; margin-bottom: 2em; }


<snipping the rest>
 
C

CRON

tbar said:
Geez, there's no way except tables to know in advance the width of
things, is there?

Why are you posting on the board at all if you're too lazy to make any
sense?
 
D

dorayme

Its hard enough to understand what OP wants without supposing he
wants to jump to the useful tips section well before that
section?

yes it is a bit of a stab in the dark[/QUOTE]

You mean that when you put the "named" part in, you put on a
blindfold and moved the mouse to paste in "<a name="tips"></a>"
like in playing 'Pin the tail on the donkey'?
 
C

CRON

dorayme said:
yes it is a bit of a stab in the dark

You mean that when you put the "named" part in, you put on a
blindfold and moved the mouse to paste in "<a name="tips"></a>"
like in playing 'Pin the tail on the donkey'?
[/QUOTE]


....yes. thats exactly what I mean.
 
B

Beauregard T. Shagnasty

CRON said:
tbar wrote:
[using User-Agent: Thunderbird 1.5.0.4 (Windows/20060516)]
Geez, there's no way except tables to know in advance the width of
things, is there?

tbar: when replying, do not erase the quoted material. Instead,
carefully trim it and reply inline as you see everyone else doing here.
Why are you posting on the board at all if you're too lazy to make
any sense?

It is not a board, it is a Usenet newsgroup. Google Groups is merely a
(bad) interface to it. Why don't you find a good newsreader?
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,769
Messages
2,569,581
Members
45,057
Latest member
KetoBeezACVGummies

Latest Threads

Top