问题描述:

<div id="registerb"><div id="rtext">Register</div></div>

#registerb {

font-size:21px;

}

#rtext {

cursor:pointer;

text-align:center;

}

I want when I point the "Register" text the cursor to change to pointer.But in changes to pointer on the all width of the div.I've tried adding some width to the divs but without result.

网友答案:

This should do it:

<div id="registerb"><span id="rtext">Register</span></div>

#registerb {
    font-size:21px;
    text-align:center;

}
#rtext {
    cursor:pointer;
}
网友答案:

Adding a width to #rtext seems to work as it should.

Demo: http://jsfiddle.net/Marcel/skCae/ (border added to #rtext for clarity)

相关阅读:
Top