September 1, 200818 yr Hi, We have a site which we are carrying out some SEO on. At the footer of the page we have added some anchor text links which target our main chosen keywords. We would ideally like to move the code for these to the top of the page in code view but have them displayed at the bottom of the page in the browser. All div's on the page are positioned relatively but if I position the footer links absolutely they will then be removed from the document flow and this will cause problems with the positioning on the page due to different page scrolling lengths. Below is a simple version of what I am working on. <div id="outer"> <div id="box1">Links go here which would display below box 2 in the browser</div> <div id="box2"> <p>Content Here</p> <p>Content Here</p> <p>Content Here</p> <p>Content Here</p> <p>Content Here</p> <p>Content Here</p> </div> </div> Box 1 needs to appear in the browser below box 2. Is this possible to achieve? Hope I've explained this ok.
September 1, 200818 yr Difficult to say without seeing an example of what you want. If the #outer div is positioned relatively, then positioning #box1 absolutely will place it in relation to the outer div. If you specified #box1 { position:absolute; bottom:0; } it will be at the bottom of the outer div. As you say, it will also be removed from the document flow and will therefore overlap/hide the other content. To get round that, add a bottom margin to #box2 that will leave enough room for #box1 to sit in. I hope that makes sense. If you have a live example it will be much easier to see exactly what you mean.
September 2, 200818 yr Author Thanks for that. I think it'll work a treat. What we are trying to do is an SEO test by getting some important links that use keyword anchor text to the top of the code. This is so we can see whether the links at the top of a page are given more weight than those further down the page.
Create an account or sign in to comment