...

View Full Version : A Links not working when positioned



swiltch
02-24-2011, 09:02 PM
Hi guys, I'm building my website and I tried positioning some links above my navigation bar, but when I moved them they no longer work.

(The links themselves are currently set to w3schools just for testing)

Live example - www.swiltch.com

Any help appreciated.
EDIT - It also makes the page unnecessarily big?


HTML -



<div id="links"
<a href="http://www.w3schools.com/" target="_blank">About Us</a>
<a href="http://www.w3schools.com/" target="_blank">Contact</a>
<a href="http://www.w3schools.com/" target="_blank">Site Map</a>
</div>


CSS -



#links {
position: relative;
top: 120px;
right: -970px;
}

Excavator
02-24-2011, 09:24 PM
Hello swiltch,
You should check that in the validator, you've probably just copy/pasted a couple times and missed something.
Should be more like this maybe -
<div id="links">
<a=href="http://www.w3schools.com/" target="_blank">About Us</a>
<a href="http://www.w3schools.com/" target="_blank">Contact</a>
<a href="http://www.w3schools.com/" target="_blank">Site Map</a>
</div>

swiltch
02-24-2011, 09:32 PM
The text appears on the page like it should, but they are not clickable. The page is also a lot bigger than it needs to be.

Excavator
02-24-2011, 09:45 PM
The text appears on the page like it should, but they are not clickable. The page is also a lot bigger than it needs to be.

Yes, I saw the links were broke. That's why I pointed out the broken #links.

You page is very wide because of that huge negative margin.

For positioning to work reliably, you should not be using so much relative. One containing element that is relative and the other positioned elements absolutely positioned is much more predictable.

Do you really need all that positioning though?

swiltch
02-24-2011, 09:47 PM
Yes, I saw the links were broke. That's why I pointed out the broken #links.

You page is very wide because of that huge negative margin.

For positioning to work reliably, you should not be using so much relative. One containing element that is relative and the other positioned elements absolutely positioned is much more predictable.

Do you really need all that positioning though?

Thankyou excavtor, i'll have a play round with the positioning and see if I can make them work in that area.



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum