forked from bluebits-academy/language-switcher
-
Notifications
You must be signed in to change notification settings - Fork 0
/
style.css
133 lines (111 loc) · 2.54 KB
/
style.css
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
/*
^ Styling the drop-down menu for language switcher
* Auther : Fadi Nouh
* URL : https://bluebit.dev
* Repository: https://github.com/bluebits-academy/language-switcher
*/
@import url('https://fonts.googleapis.com/css2?family=Didact+Gothic&display=swap');
@import url('https://cdnjs.cloudflare.com/ajax/libs/normalize/8.0.1/normalize.css');
body {
font-family: 'Didact Gothic', sans-serif;
color:#333;
box-sizing: border-box;
}
* {
box-sizing: border-box;
}
a {
text-decoration: none;
}
header {
background-color: #f2f2f2;
height: 110px;
padding: 10px 0;
}
nav {
width: 960px;
margin: 0 auto;
display: flex;
justify-content: space-between;
}
.logo {
width: 100px;
}
.logo img {
width: 100px;
}
.lang-menu {
width: 100px;
text-align: right;
font-weight: bold;
margin-top: 25px;
position: relative;
}
.lang-menu .selected-lang {
display: flex;
justify-content: space-between;
line-height: 2;
cursor: pointer;
}
.lang-menu .selected-lang:before {
content: '';
display: inline-block;
width: 32px;
height: 32px;
background-image: url(https://www.countryflags.io/us/flat/32.png);
background-size: contain;
background-repeat: no-repeat;
}
.lang-menu ul {
margin: 0;
padding: 0;
display: none;
background-color: #fff;
border: 1px solid #f8f8f8;
position: absolute;
top: 45px;
right: 0px;
width: 125px;
border-radius: 5px;
box-shadow: 0px 1px 10px rgba(0,0,0,0.2);
}
.lang-menu ul li {
list-style: none;
text-align: left;
display: flex;
justify-content: space-between;
}
.lang-menu ul li a {
text-decoration: none;
width: 125px;
padding: 5px 10px;
display: block;
}
.lang-menu ul li:hover {
background-color: #f2f2f2;
}
.lang-menu ul li a:before {
content: '';
display: inline-block;
width: 25px;
height: 25px;
vertical-align: middle;
margin-right: 10px;
background-size: contain;
background-repeat: no-repeat;
}
.de:before {
background-image: url(https://www.countryflags.io/de/flat/32.png);
}
.en:before {
background-image: url(https://www.countryflags.io/us/flat/32.png);
}
.fr:before {
background-image: url(https://www.countryflags.io/fr/flat/32.png);
}
.ar:before {
background-image: url(https://www.countryflags.io/ae/flat/32.png);
}
.lang-menu:hover ul {
display: block;
}