teratail header banner
teratail header banner
質問するログイン新規登録

質問編集履歴

1

ソースコードの追加

2019/03/27 02:48

投稿

ironman
ironman

スコア20

title CHANGED
File without changes
body CHANGED
@@ -4,6 +4,105 @@
4
4
 
5
5
  しかし、単にoutline:noneとするとキーボードで操作しているユーザがbuttonにアクセスできなくなると知りました。そこで、マウス操作ではoutlineを表示させずに、キーボードではアクセスできるようにする方法を教えていただきたいです。よろしくお願いいたします。
6
6
 
7
+ ###該当するソースコード
8
+ ```HTML
9
+ <!-- nav -->
10
+ <div class="nav-list">
11
+ <nav>
12
+ <ul class="nav-ul">
13
+ <!-- list -->
14
+ <li class="nav-li">
15
+ <div>
16
+ <button type="button" class="btn-cls" aria-haspopup="true", aria-expanded="false" aria-busy="false">
17
+ <div class="li-box">
18
+ <div class="li-outer">
19
+ ホストをはじめる
20
+ </div>
21
+ </div>
22
+ </button>
23
+ <div>
24
+ </li>
25
+ <!-- list -->
26
+ <li class="nav-li">
27
+ <button type="button" class="btn-cls" aria-haspopup="true", aria-expanded="false" aria-busy="false">
28
+ <div class="li-box">
29
+ <div class="li-outer">
30
+ ヘルプ
31
+ </div>
32
+ </div>
33
+ </button>
34
+ </li>
35
+ <li class="nav-li">
36
+ <button type="button" class="btn-cls" aria-haspopup="true", aria-expanded="false" aria-busy="false">
37
+ <div class="li-box">
38
+ <div class="li-outer">
39
+ 登録する
40
+ </div>
41
+ </div>
42
+ </button>
43
+ </li>
44
+ <li class="nav-li">
45
+ <button type="button" class="btn-cls" aria-haspopup="true", aria-expanded="false" aria-busy="false">
46
+ <div class="li-box">
47
+ <div class="li-outer">
48
+ ログイン
49
+ </div>
50
+ </div>
51
+ </button>
52
+ </li>
53
+ </ul>
54
+ </nav>
55
+ </div>
56
+ ```
57
+
58
+ ```CSS
59
+ /* nav */
60
+ .nav-list {
61
+ display: table-cell;
62
+ vertical-align: middle;
63
+ }
64
+ .nav-ul {
65
+ display: table;
66
+ padding: 0;
67
+ margin: 0;
68
+ height: 64px;
69
+ }
70
+ .nav-li {
71
+ display: table-cell;
72
+ }
73
+ .btn-cls {
74
+ display: inline-block;
75
+ margin: 0;
76
+ padding: 0 8px;
77
+ positive: relative;
78
+ background: transparent;
79
+ border-width: initial;
80
+ border-style: none;
81
+ border-color: initial;
82
+ border-image: initial;
83
+ height: 80px;
84
+ line-height: 80px;
85
+ white-space: nowrap;
86
+ }
87
+ .li-box {
88
+ height: 100%;
89
+ vertical-align: middle;
90
+ border-bottom: 2px solid transparent;
91
+ }
92
+ .li-box:hover {
93
+ border-bottom: 2px solid #9F9EAA;
94
+ }
95
+ .li-outer {
96
+ display: inline-block;
97
+ vertical-align: middle;
98
+ line-height: 1;
99
+ padding: 8px;
100
+ border-bottom: 2px solid transparent;
101
+ }
102
+
103
+ ```
104
+
105
+
7
106
  ###問題が発生した環境
8
107
  - Bootstrap
9
108
  - HTML5