It is used when content overflow vertically from an element box.
Syntax -
overflow-y: value ;
values
For example -
<!DOCTYPE html>
<html>
<head>
<title>CSS Overflow Vertically</title>
<link rel="stylesheet" type="text/css" href="E:/style.css">
<style>
body{
display: flex;
justify-content: space-between;
}
.visible {
background-color: lightblue;
height: 40px;
width: 200px;
overflow-y: visible;
}
.hidden {
background-color: lightblue;
height: 40px;
width: 200px;
overflow-y: hidden;
}
.scroll {
background-color: lightblue;
height: 40px;
width: 200px;
overflow-y: scroll;
}
.auto {
background-color: lightblue;
height: 40px;
width: 200px;
overflow-y: auto;
}
</style>
</head>
<body>
<p class="visible">Web design refers to the design of websites that are displayed on the internet. It usually refers to the user experience aspects of website development rather than software development. </p><br>
<p class="hidden"> Web design refers to the design of websites that are displayed on the internet. It usually refers to the user experience aspects of website development rather than software development. </p><br>
<p class="scroll">Web design refers to the design of websites that are displayed on the internet. It usually refers to the user experience aspects of website development rather than software development. </p><br>
<p class="auto"> Web design refers to the design of websites that are displayed on the internet. It usually refers to the user experience aspects of website development rather than software development. </p>
</body>
</html>
Output