-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.htm
50 lines (43 loc) · 3.33 KB
/
index.htm
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<meta http-equiv="content-type" content="text/html; charset=utf-8" />
<title>Custom Buttons 3.0 (demo)</title>
<link rel="stylesheet" href="screen.css" type="text/css" media="screen" title="no title" charset="utf-8">
</head>
<body>
<h1>Custom Buttons 3.0 (demo)</h1>
<p class="s0"><strong>Updated:</strong> 27 Feb 2008</p>
<p>This doc attempts to show how custom buttoms with a 1px radius could be created without corner images. The gradient requires an image, but is optional. Ideally, the <code><button></code> element should be used if possible (instead of <code><a></code>) for semantic and accessibility reasons. Note that the hover state will not work on <code>button</code> elements for IE6 and lower without using JavaScript to detect a mouseOver event.</p>
<form action="#">
<p>
<a href="#" class="btn"><span><span>button</span></span></a> <code><a></code>
</p>
<p>
<button type="button" class="btn"><span><span>button</span></span></button> <code><button></code>
</p>
<p>
<a href="#" class="btn"><span><span>longer button text</span></span></a> <code><a></code>
</p>
<p>
<button type="button" class="btn"><span><span>longer button text</span></span></button> <code><button></code>
</p>
<p>
<button type="button" class="btn"><span><span>button</span></span></button> <button type="button" class="btn"><span><span>button</span></span></button> <button type="button" class="btn"><span><span>button</span></span></button> <code><button> <button> <button></code>
</p>
<p>
<button type="button" class="btn primary"><span><span>Save</span></span></button> <button type="button" class="btn"><span><span>Cancel</span></span></button>
<code><button class="primary"> <button></code>
</p>
<p>
<button type="button" class="btn pill-l"><span><span>Left</span></span></button><button type="button" class="btn pill-c"><span><span>Center</span></span></button><button type="button" class="btn pill-r"><span><span>Right</span></span></button>
<code><button class="pill-l"><button class="pill-c"><button class="pill-r"></code>
</p>
</form>
<h2>Reasons for 2 nested spans:</h2>
<ol>
<li>The inner <code>span</code> creates the top and bottom borders. Because <code>button</code> and <code>a</code> are inline elements, top/bottom borders and padding do not affect the height of parent elements (such as the outer <code>span</code>). So with the same top/bottom padding of both <code>span</code> elements, the left/right borders of the outer <code>span</code> stop short of the top/bottom borders of the inner <code>span</code>.</li>
<li>The outer <code>span</code> is necessary to fix bugs in Gecko-based browsers and in IE (separate issues for both). Gecko browsers add an extra 3px of padding inside <code>button</code> elements which can't be eliminated. Without the outer span, top/bottom and left/right borders wouldn't connect. IE just has trouble styling <code>button</code>s and nested elements inside them, so the majority of visible styles are applied to two inner <code>span</code>s.</li>
</ol>
</body>
</html>