Can't select text... why...
March 1, 2009 3:16 PM
Subscribe
I have a css/html question. Usually when I have a css question I google it and find that 100 people have already asked and answered it. In this case I'm having a hard time even figuring out what to put into Google or what to search on here in AskMe.
Is there any reason why, on a webpage I coded up, the text cannot be selected and the links can't be clicked on or hovered over? I have never seen anything like this before.
I don't think I can post a link to the page because it's a site I'm coding up for someone else and it's still under development. I hope I can describe it well enough that it's something somebody recognizes.
The doctype is HTML 4.0 transitional. It's a pretty simple design. There's a top div, which has the nav div layered over it. There's a sidebar div which overlaps the top div and floats to the left. The middle div is directly under the top div and slides under the left-hand sidebar div so its bg color pokes out on the far left. It does use some absolute positioning and some z-index stacking by necessity. However the divs that have the text and the links have the highest z-index numbers so they should be "on top"..right?
And when I say "by necessity" I mean that it took me forever to inch all the different pieces together until they sat right and sat consisently so if I have to unravel everything and piece it together again for the umpteenth time I'm going to be mad. (Not at you, just at the fact that this is so frustrating)
Browsers:
Opera, you can select the text but not click or hover on the links.
Firefox, you can't select any text or click or hover on the links.
In IE6 you can only select the sidebar text, AND the links work.
If you had asked me to make it so that text and links can't be selected, I would have no idea how to do it. From the googling I was able to do, I kind of have a feeling this has to do with the z-index and the absolute positioning, but I really need help figuring this out.
If it will help I've included the relevant CSS:
html {height:100%;}
body {margin: 0 auto; background-color:#ffffff; text-align:center; height:auto; width:970px;}
#wrapper { position:relative;
top:20px;
text-align:left;
width:970px;
height:300%;
margin:0 auto;
background-color:#ffffff;
z-index:-1;
}
#top {position:absolute;
height:213px;
width:970px;
top:0px;
left:0px;
z-index:-1;
display:block;
background-image:url('_img/bgtop.jpg');
background-repeat:none;
text-align:left;
}
#nav {position:relative;
height:46px;
width:970px;
top:190px;
left:0px;
z-index:0;
background-image:url('_img/bgnav.jpg');
}
#navlinks {position:relative;
height:44px;
width:615px;
left:330px;
top:7px;
z-index:1;
}
#left {position:relative;
width:300px;
height:100%;
left:20px;
top:-230px;
margin:0px;
z-index:3;
text-align:left;
padding-left:10px;
float:left;
}
#middle {position:relative;
top:190px;
left:20px;
width:950px;
text-align:left;
z-index:0;
padding:0px;
background-color:#EAEBDB;
height:100%;
}
posted by amethysts to computers & internet (5 comments total)
2 users marked this as a favorite
posted by robtoo at 3:19 PM on March 1, 2009