Jump to content

[SOLVED] Top of page problem


ballouta

Recommended Posts

Hello

 

I have a small image with a link to the top of the page, it does NOT work on Internet Explorer but it works on Firefox.

 

the code in html page that displays this small top image is:

<div id="footer">
              <div id="fLeft">
              	<div id="fRight">
            	<div id="inside">
                	<span class="top"><a href="#top">#top</a></span>
<!-- of course there's more code after this !-->

 

I noticed that there's a bookmark in the page names top, its code is:

    	<div id="wrap"><a name="top" id="top"></a>

 

Going to CSS code, this part of it:

 

#wrap{
padding:0;
width:797px;
margin:0 auto;

}

/**********************
footer Style
**********************/
#footer{
float:left;
background:url(../images/footer_bg.gif) repeat-x;
padding-bottom:50px;
}
#footer #fLeft{
background:url(../images/footer_bg_left.gif) no-repeat left top;
float:left;
}
#footer #fLeft #fRight{
background:url(../images/footer_bg_right.gif) no-repeat right top;
float:right;
}

#footer #fLeft #fRight #inside{
float:left;
padding:33px 20px;
width:757px;

}

 

Actually I removed the book mark and set this top image hyperlink to #top, it worked on Internet Explorer but didn't work on Mozilla!!

 

Would you please help me fix it, I don't care if there's bookmark or not, if I were using an old html file in the past, I used to make a hyperlink #top and it used to work but never tried it on Mozilla.

 

Thank you

Link to comment
Share on other sites

The #top is the standard way to link to the top of the page, as far as i know atleast.

 

But it would still make more sense to throw in a few ids on your headings, the first heading (the h1) could be considered the top of the page, so you could name it section1.

<h1 id="section1">Main Subject / First Heading<h1>

You would then link to this section, by adding #section1 to the end of the URL.

 

There is rarely any reason to link Directly to the top anyway, so linking to the first heading is fine.

 

You could also simply throw in id="top" on the body opening tag, that should make it work in IE.

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.