On Apr 22, 8:36 pm, Brent <writebr...@gmail.comwrote:
Take this small HTML fragment:
span.theClass{float:left;width:100px;cursor:pointe r;cursor:hand;}
------------------------
<div>
<span id="1" class="theClass"> <span>
<span id="2" class="theClass">Stuff in span<span>
<span id="3" class="theClass"><span>
</div>
------------------------
In Firefox, spans 1 & 2 will display a "hand" cursor for the width of
the span. Span 3 will not display the hand.
In IE, spans 1 & 2 will display a "hand" cursor for the width of the
inside text. Span 3 will not display the hand.
Is there any means by which to display the "hand" for the entire width
of the span, in both browsers, whether or not there is text inside the
span? The goal is to be able to activate an onClick function.
Thanks for any help.
--Brent
Hmmmm... I know.. I know... CSS isn't the subject of this topic...
But what you want!?
If you want only one value in the div... put only a <pwith onclick.
Then
set the width, height, text-align, vertical-align...etc.
But if you want spans clickable (something that pops a input and then
changes its value to a span again), so you put a temporary value to
Span
using underline or using display:block and set manually its width/
height to
fit your purpose.
The behavior you're experimenting is the same in inline
(<span><var><b><i>
etc.) elements and block (<p>,<div>,<ul>,<lietc.) elements. But only
when
you use block element or an inline element with display:block property
set
you can get some clickable area to an element. There are other display
values like 'table-cell' but its behavior is different on same
browsers.