0

I am very new to web scripting. I have to cover up this defect asap that's why I am using patches instead of some permanent fix . I got a defect that a tab get selected only when the lettering of it get selected.

<div id='ErrorDictionarySearch_3' onclick='tab_click("0");' class='tab' style='position:absolute;z-index:15;border:none;left:0px;background-color:transparent;width:75px;' >
    <span style='position:absolute;text-align:left;width:100%'>Search</span>
</div>

There is an issue with z-index but fixing that create some further issues. So I got that the div is get selected when span is selected.
So how can I make whole span cover that div.

Update (from comment)

ok i will try to make it more clear to you as you can see there is an onclick event in that div so whenever you should click on that div some thing need to be loaded. but that tab got selected only when mouse cursor is taken over Search ie we can click only when mouse is on lettering

4

2 回答 2

1

添加display:inline-block;<span>

<div id='ErrorDictionarySearch_3' onclick='tab_click("0");' class='tab' style='position:absolute;z-index:15;left:0px;background-color:transparent;width:75px;border:1px solid blue;' >
    <span style='text-align:left;width:100%;border:1px solid red;display:inline-block;'>Search</span>
</div>

我已添加border:1px solid red;border:1px solid blue;供参考

演示:http: //jsfiddle.net/dfJFV/

于 2013-07-03T06:25:55.313 回答
0
<div id='ErrorDictionarySearch_3' onclick='tab_click("0");' class='tab' style='position:absolute;z-index:15;border:none;left:0;background-color:transparent;width:75px;' >
    <span style='position:absolute;text-align:left;width:100%;display:block;'>Search</span>
</div>

添加display: block<span>

于 2013-07-03T06:23:19.860 回答