JS Bin
// source https://jsbin.com/yuvibitazu
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width">
<title>JS Bin</title>
<style id="jsbin-css">
html,body {
height: 100%;
}
header, footer {
/* position: relative; */
height: 50px;
background-color: #333;
display:flex;
justify-content: center;
align-items: center;
color: #fff;
}
.parent {
position: relative;
background-color: #333;
/* width: 80px; */
height: 30px;
color: #fff;
}
.child {
position: absolute;
background-color: red;
width: 20px;
height: 20px;
top: -10px;
left: -10px;
}
li {
display:inline-block;
padding: 0 5px;
width: 200px;
/* margin-top: -10px; */
}
ul {
display: flex;
overflow-x:scroll;
/* height: 120px; */
/* align-items: center; */
/* margin-top:-10px; */
}
</style>
</head>
<body>
<div>
<header>header</header>
</div>
<ul>
<li>Football</li>
<li>Golf</li>
<li>Rugby</li>
<li>Football</li>
<li>Tennis</li>
<li>Basket-Ball</li>
<li class="parent">Horse Race
<div class="child"></div>
</li>
</ul>
<footer>
footer
</footer>
<script id="jsbin-source-css" type="text/css">html,body {
height: 100%;
}
header, footer {
/* position: relative; */
height: 50px;
background-color: #333;
display:flex;
justify-content: center;
align-items: center;
color: #fff;
}
.parent {
position: relative;
background-color: #333;
/* width: 80px; */
height: 30px;
color: #fff;
}
.child {
position: absolute;
background-color: red;
width: 20px;
height: 20px;
top: -10px;
left: -10px;
}
li {
display:inline-block;
padding: 0 5px;
width: 200px;
/* margin-top: -10px; */
}
ul {
display: flex;
overflow-x:scroll;
/* height: 120px; */
/* align-items: center; */
/* margin-top:-10px; */
}</script>
</body>
</html>
html,body {
height: 100%;
}
header, footer {
/* position: relative; */
height: 50px;
background-color: #333;
display:flex;
justify-content: center;
align-items: center;
color: #fff;
}
.parent {
position: relative;
background-color: #333;
/* width: 80px; */
height: 30px;
color: #fff;
}
.child {
position: absolute;
background-color: red;
width: 20px;
height: 20px;
top: -10px;
left: -10px;
}
li {
display:inline-block;
padding: 0 5px;
width: 200px;
/* margin-top: -10px; */
}
ul {
display: flex;
overflow-x:scroll;
/* height: 120px; */
/* align-items: center; */
/* margin-top:-10px; */
}