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