tags:

views:

163

answers:

3

Hi

I have a web page. It has too much height; in that page I have a div in the bottom of the page. I want to display the div in the center portion of the page. It’s appearing in the center of the page at the bottom position as in a way i like , but scrolling is needed. Is it possible to set focus on that div without scrolling? Does any one help me urgently?

+1  A: 

Place an anchor tag on top of the div. And add a bit of code in the page load [if it is to be shown when the page loads]

location.href = "#youranchorid";
rahul
A: 

You can use javascript to accomplish this by writing:

document.getElementById("your_element_id").focus();
BraedenP
A: 

You can put an href like this on top of the page Link to My Div

and put another href href=# name="mydiv" like this with a name called mydiv in the div tag you want to link to.

mepo