Hi all!
I have a problem with not being able to mark and copy text from my sites made with CSS. Up until now I have thought that this is the bad side of CSS, and you just have to eat it if you want to skip your table systems. Although I have looked for an answer now and then.
But today I stepped into a CSS based site where there was no problem to mark text. I am confused.
Took me a moment to figure out what you were talking about, but I think you mean select text, no?
I never really gave the problem much thought, but now that you mention it, it does seem to be a problem on some sites. On my site, for example, if you try to select text it will select everything before or after the cursor (depending on which way you try to select).
A quick comparison of the html on your site and ALA shows no structural differences. From what I can see, it's the same basic markup. Let's check out the CSS...
Hmm... I don't see anything special in the ALA styles (either the imported styles or the page-specific styles). I am stumped. I'm not really familiar with selection behavior, so I really don't know what to tell you. That's an excellent question, though, and I'm also eager to here the answer.
On a high profile case I handled, I had the same problem. Turned out to be an issue with absolutely positioned DIVs. Strange though. It would always happen on any page that used the same template. But I couldn't always recreate the problem on other pages with absolute DIVs....
Thanks all for your inputs. Sorry for not coming back earlier. Had a concert yesterday and was home late...
And yes, Suho, of course I mean select text, not mark text. Just a stupid mix between Swedish and English that I didn't think of when writing my first post. And the way you describe the selection problem is exactly how it is. Either everything before the cursor or everything after the cursor is selected. Impossible to select just one sentence or one word.
So what I understand from your replies is, that it could either be a browser problem or a phenomena of absolutely positioned divs. Either way it is not good. I am rebuilding a table based huge page into CSS. It is important that the text is selectable for copying, since music agents, newspapers and concert producers must be able to use the information on the site for concert programs etc. Currently that site is table based and HUGE. Must be easier to update - therefore the rebuild to CSS.
Does anyone know where to search for an answer for this problem, if there is a way to fix it without violating the html code? I would like to have it validated by W3C.
I will also check with other browsers on my other computer, as soon as my husband has put it back in order after rebuilding it.
Just to weigh in on the absolutely positioned divs... I don't really think that's an issue. My site does not have a single absolutely positioned div, yet I still have problems selecting the text. However, I tried selecting text on my site in both Netscape and Opera, and I had no problems. My conclusion: it's yet another bug in IE. That still leaves us with the question of what causes it in IE, of course, to which I have no answer...
I'm only going by my own experiences, which seem to be similar to Kartis'. In my experience, absolutely positioned divs are not related to the problem. Your experiences, however, would seem to indicate that browsers aren't the problem either.
If it's not the layout and it's not the browsers, what could it be? Is it possible that my IE is screwed up in some way? I know that I've had some rather unique problems in the past...
i had a similar problem some time ago and although uncertain, think i resolved this by removing a z-index or line hight or letter-spacing attribute. then again maybe even putting the ?xml prolog back sorted it. play
I don't think this is a problem on the coding end... we've established that the same site can produce different reactions, even using the same browser.
I think my IE is just channeling a really ornery spirit...
I have similar problems on some sites (Opera works IE doesn't) so I'll keep an eye out for the absolutely positioned divs. I always tend to avoid them anyway as they are more trouble than they are worth
fwiw I've always (since the proliferation of CSS based designs anyhow) had intermittent problems selecting text on some web sites. Sometimes I drag from top left to bottom right, it does nothing, or starts in the middle and selects backwards etc, just general ornery spiritedness.
I have the same problem on some sites. It looks like it has something to do with DIV's which are positioned in such a way that the overlap eachother. However I haven't found out what's the problem exactly. When I removed the following code from the top of the document, however, the page is displayed correctly and selection is possible. Disadvantage of that is that the page doesn't validate without a little help.
code:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">