I've inherited an existing website to maintain and upgrade.<div><a /></div> instead of <button />?
One of the site's quirks is how it does buttons.
It has html like this:
<div class="btn">
<a id="dv_remCont" runat="server" href="#" onclick="removeContact();">remove contact</a>
</div>
and css like this:
div.btn a {
font-weight:bold;
display:inline-block;
border-radius: 2px;
padding: 0 1.2em 0 1.2em;
color:#ffffff;
background-color:black;
box-shadow: 0px 0px 5px 1px #898986, inset -1px -1px 1px rgba(0,0,0,0.5), inset 1px 1px 1px rgba(255,255,255,0.8), 0px 0px 1px 1px #000000;
}
div.btn a:hover {
box-shadow: 0px 0px 5px 1px #898986, inset 1px 1px 1px rgba(0,0,0,0.5), inset -1px -1px 1px rgba(255,255,255,0.8), 0px 0px 1px 1px #000000;
}
This creates a clickable button. It does cause some complications, though - not using a regular <button />
means default functionality for stuff like forms doesn't work. Also, there are some issues with alignment in IE8 and below.
What are the advantages of doing buttons like this? Have you seen them done in this style before?
''?它建立在什麼系統上? – BoltClock
asp.net,但這不是真的在這裏相關。基本上它只是錨定在div標籤內,然後定位錨點使其看起來像按鈕。 – Oliver
我想這與jQuery(javascript)有關。 http://webdesignerwall.com/tutorials/jquery-tutorials-for-designers – niktrs