Skip to content
View in the app

A better way to browse. Learn more.

Web Designer Forum

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

CSS ordering problem

Featured Replies

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.

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.

  • 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

Account

Navigation

Search

Search

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.