Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Dragging mouse over HTML text within DIV tag

Status
Not open for further replies.

snakehips2000

Programmer
Nov 10, 2003
95
0
0
GB
I've got a text highlighting ptoblem (see simple example below).

When viewing the page and I try to drag my mouse (right to left or vice-versa) over some static text within a DIV tag, the text highlights either from the start of the paragraph to the mouse-point or from the mouse-point to the paragraph end.

This doesn't happen when the text is simply placed inthe body of the document, i.e. outside the DIV tag. In this instance I can highlight my chosen characters/words as I drag. Why is this happening?

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "<html xmlns="<head>
<title>Untitled Document</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
</head>

<body>
<div id="Layer4" style="position:absolute; width:330px; height:101px; z-index:2; left: 60px; top: 53px;">
The quick brown fox jumped over the lazy dog.
</div>
</body>
</html>
 
Are you talking in Dreamweaver or a browser? It works fine for me in DW when I use your code, unless I'm not understanding you question.
 
It's the absolute positioning. Remove the positioning from the div and it works as you expect. I can select all of the text or any one word or what you're describing. Gotta love IE/Windows.

Greg
"Personally, I am always ready to learn, although I do not always like being taught." - Winston Churchill
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top