当前位置: 动力学知识库 > 问答 > 编程问答 >

css - cursor:pointer and text align

问题描述:

<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)

分享给朋友:
您可能感兴趣的文章:
随机阅读: