Link Boxes

Example


2-up


3-up


4-up

Code

HTML

<p>2-up</p>
<ul class="link-box">
  <li class="link"><a href="#link">External Relations</a></li>
  <li class="link"><a href="#link">Web Services</a></li>
</ul>

<p>3-up</p>
<div class="three-up">
  <ul class="link-box">
    <li class="link"><a href="#link">External Relations</a></li>
    <li class="link"><a href="#link">Web Services</a></li>
    <li class="link"><a href="#link">Communications & Marketing</a></li>
  </ul>
</div>

<p>4-up</p>
<ul class="link-box four-up">
  <li class="link"><a href="#link">External Relations</a></li>
  <li class="link"><a href="#link">Web Services</a></li>
</ul>
<ul class="link-box four-up">
  <li class="link"><a href="#link">Communications & Marketing</a></li>
  <li class="link"><a href="#link">Government Relations</a></li>
</ul>
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24

CSS

.link-box {
  background-color: #fff;
  border: solid 1px rgba(0, 39, 76, 0.15);
  display: -webkit-box;
  display: -ms-flexbox;
  display: flex;
  -webkit-box-orient: horizontal;
  -webkit-box-direction: normal;
  -ms-flex-direction: row;
  flex-direction: row;
  -ms-flex-wrap: wrap;
  flex-wrap: wrap;
  -webkit-box-pack: start;
  -ms-flex-pack: start;
  justify-content: flex-start;
  list-style: none;
  padding: 1rem 1.5rem;
}

.link-box .link {
  -ms-flex-preferred-size: 50%;
  flex-basis: 50%;
}

.link-box .link a {
  color: #1c5184;
  display: inline-block;
  font-family: "Open Sans", sans-serif;
  font-size: 16px;
  font-weight: 700;
  font-style: normal;
  font-stretch: normal;
  line-height: 1.25;
  letter-spacing: 0.29px;
  padding-bottom: 1px;
  position: relative;
  -webkit-transition: all 0.2s ease-in-out;
  transition: all 0.2s ease-in-out;
}

.link-box .link a:before {
  background-color: rgba(172, 86, 0, 0.25);
  bottom: 0;
  content: "";
  left: 0;
  height: 1px;
  position: absolute;
  transition: all 0.2s ease-in-out;
  width: 0;
}

.link-box .link a:hover,
.link-box .link a:focus {
  color: #ac5600;
  text-decoration: none;
}

.link-box .link a:hover::before,
.link-box .link a:focus::before {
  background-color: #ac5600;
  width: 100%;
}

.three-up .link-box {
  -webkit-box-pack: justify;
  -ms-flex-pack: justify;
  justify-content: space-between;
}

.three-up .link-box .link {
  -ms-flex-preferred-size: auto;
  flex-basis: auto;
}

.four-up .link-box:first-child {
  margin-bottom: 0;
}

.four-up .link-box:last-child {
  border-top: 0;
  margin-top: 0;
}

.four-up .link-box .link {
  -ms-flex-preferred-size: 50%;
  flex-basis: 50%;
}

@media screen and (max-width: 39.9375em) {
  .link-box {
    display: block;
    padding: 0;
  }

  .link-box .link {
    border-bottom: solid 1px rgba(0, 39, 76, 0.15);
    padding: 1rem 1.5rem;
  }

  .link-box:first-child,
  .link-box:nth-child(2) {
    border-bottom: 0;
  }

  .link-box:nth-child(2) {
    padding-bottom: 0;
    padding-top: 0;
  }

  .link-box:nth-child(3) .link:last-child {
    border-bottom: 0;
  }
}
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