Using only CSS, I need to make the dark boxes (the links) line up in one unbreaking line, and for the container (temporarily named div.hurrdurr) to have a horizontal scroll bar when the line of links gets longer than it. I also don’t want there to be any left over space when it’s scrolling. The links will be changed dynamically, so I can’t use a set width, as far as I know.
I only need this to work in the newest Firefox, as that’s the only thing I’ll be using to display the page.
This is what I have:
<!DOCTYPE html>
<html style="width: 1000px;">
<head>
<title>Hurrr</title>
<style>
div.contain {
background-color: #999999;
height: 90px;
width: 100%;
}
div.hurrdurr {
background-color: #CCCCCC;
white-space: nowrap;
width: 100%;
overflow: auto;
}
div.hurrdurr a {
width: 60px;
height: 20px;
margin-right: 8px;
margin-top: 4px;
background-color: #333333;
color: #CCCCCC;
text-align: center;
float: left;
display: inline-block;
}
</style>
</head>
<body>
<div class="contain">
<div class="hurrdurr">
<a class="durr">1/25</a>
<a class="durr">2/25</a>
<a class="durr">3/25</a>
<a class="durr">4/25</a>
<a class="durr">5/25</a>
<a class="durr">6/25</a>
<a class="durr">7/25</a>
<a class="durr">8/25</a>
<a class="durr">9/25</a>
<a class="durr">10/25</a>
<a class="durr">11/25</a>
<a class="durr">12/25</a>
<a class="durr">13/25</a>
<a class="durr">14/25</a>
<a class="durr">15/25</a>
<a class="durr">16/25</a>
<a class="durr">17/25</a>
<a class="durr">18/25</a>
<a class="durr">19/25</a>
<a class="durr">20/25</a>
<a class="durr">21/25</a>
<a class="durr">22/25</a>
<a class="durr">23/25</a>
<a class="durr">24/25</a>
<a class="durr">25/25</a>
</div>
</div>
</body>
</html>
Remove your
float:leftfrom yourdiv.hurrdurr aand that should give you scrolling.