Add a horizontal scrollbar to <div>. - HTML CSS CSS

HTML CSS examples for CSS:Quiz

Description

Add a horizontal scrollbar to <div>.

Demo Code

ResultView the demo in separate window

<!DOCTYPE html>
<html>
<head>
<style>
div {<!--from  w  w  w .j a v a 2  s .  c o m-->
    background-color: #eee;
    width: 150px;
    height: 70px;
    border: 1px dotted black;
    white-space: nowrap;
    overflow-x: scroll;
}
</style>
</head>
<body>

<div>
  <p>This is a test. This is a test. This is a test.</p>
</div>

</body>
</html>

Related Tutorials