-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathbottom_tab.html
More file actions
180 lines (162 loc) · 4.57 KB
/
bottom_tab.html
File metadata and controls
180 lines (162 loc) · 4.57 KB
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
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
<!DOCTYPE html>
<html>
<head>
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<style>
/*====================================================
Removing the Default look
=====================================================*/
.tabs .tab{
overflow: hidden;
width:100%;
margin:0;
}
.tabs .tab .radioClass{
display:none;
}
/*====================================================
Removing the Default look
=====================================================*/
body{
margin:0;
font-family: 'Saira Stencil One', cursive;
}
.header{
background-color:#EE6E73;
padding:1vh 1vw 1vh 1vw;
color:white;
text-align:center;
box-shadow: 0px 4px 4px grey;
}
h2{
font-size:3vh;
}
/*====================================================
Hide and Show the content
=====================================================*/
.tabs .content {
position: absolute;
opacity:0;
top:-70vh;
bottom: 0vh;
left:30vw;
width:45vw;
height:65vh;
box-shadow: 2px 4px 2px 4px rgba(0, 0, 0, 0.2)
}
.tabs>.tab .radioClass:checked ~ .content {
opacity:1;
transition: opacity 1s ease;
}
img{
width: 100%;
height:80%;
border-radius:4px 4px 0px 0px;
}
p{
text-align:justify;
}
/*====================================================
Fixing tabs menu to bottom
=====================================================*/
.tabs{
position:fixed;
bottom:0;
width:100%;
display:flex;
flex-direction:row;
margin:0;
padding:0;
box-shadow: 0px 0px 5px 0px black;
}
/*====================================================
Desigining the tabs menu
=====================================================*/
.tabs .tab label {
display:block;
text-align:center;
padding:4vh 4vw 4vh 4vh;
cursor: pointer;
font-size:1em;
color: WHITE;
background-color:#EE6E73;
}
/*====================================================
Adding the hover effect
=====================================================*/
.tabs .tab label:hover{
background-color:#C1474C;
color:black;
transition: all 0.3s ease;
}
/*====================================================
Adding the selection indicator
=====================================================*/
.indicator{
position:absolute;
bottom:0px;
width:0px;
height:4px;
background:black;
}
.tabs>.tab .radioClass:checked ~.indicator{
width:20vw;
transition:width 400ms ease;
}
.tabs>.tab .radioClass:checked + label {
color:black;
}
</style>
</head>
<body>
<div class="header">
<h2>Pure HTML CSS Built Tab</h2>
</div>
<ul class="tabs">
<li class="tab">
<input class="radioClass" type="radio" name="tabs" checked id="tab1" />
<label for="tab1">HTML</label>
<div class="content">
<img src="http://materializecss.com/images/sample-1.jpg">
<p>Hello there amigo. This is an example of bottom tab navigation built with Just CSS and HTML.</p>
</div>
<div class="indicator"></div>
</li>
<li class="tab">
<input class="radioClass" type="radio" name="tabs" id="tab2" />
<label for="tab2">CSS</label>
<div class="content">
<img src="http://materializecss.com/images/office.jpg">
<p>Hey there. This is an example of bottom tab navigation built with Just CSS and HTML.</p>
</div>
<div class="indicator"></div>
</li>
<li class="tab">
<input class="radioClass" type="radio" name="tabs" id="tab3" />
<label for="tab3">JavaScript</label>
<div class="content">
<img src="https://images.pexels.com/photos/302743/pexels-photo-302743.jpeg?auto=compress&cs=tinysrgb&dpr=2&h=650&w=940"/>
<p>Hi there. This is an example of bottom tab navigation built without the use of JS.</p>
</div>
<div class="indicator"></div>
</li>
<li class="tab">
<input class="radioClass" type="radio" name="tabs" id="tab4" />
<label for="tab4">Bootstrap</label>
<div class="content">
<img src="https://www.gettyimages.com/gi-resources/images/500px/983794168.jpg"/>
</div>
<div class="indicator"></div>
</li>
<li class="tab">
<input class="radioClass" type="radio" name="tabs" id="tab5" />
<label for="tab5">Material</label>
<div class="content">
<img src="https://cdn.pixabay.com/photo/2019/08/30/12/54/landscape-4441297__340.jpg"/>
<p>Hello there. In this tutorial we will built bottom tabs menu with Just CSS and HTML.</p>
</div>
<div class="indicator"></div>
</li>
</ul>
</body>
</html>