CSS Example: Overflow Property
x
<title>Example</title>
<style>
.clipped {
width: 150px;
height: 110px;
padding: 20px;
background-color: gold;
border: 5px solid orange;
overflow: scroll;
}
</style>
<div class="clipped">
<p>Change the value to see the difference between <code>visible</code>, <code>scroll</code>, <code>auto</code>, and <code>hidden</code>. Browser support for <code>no-display</code> and <code>no-content</code> is limited or non-existent at the time of writing, so they may not work as expected.</p>
<p>Oh, and don't forget to visit Taumatawhakatangihangakoauauotamateapokaiwhenuakitanatahu!</p>
</div>
In this example, the left side provides the code used to render the output in the right side.
Feel free to copy and paste the code into your own project and modify as you wish.
About CSS
CSS stands for Cascading Style Sheets. It's used to add styles to web pages. It's typically added to HTML pages using the <link>
tag, so that we can have the CSS in a separate file to the HTML file. However, we also have the option of embedding the CSS in the actual HTML file by using the <style>
HTML tag, or by using the style
attribute within an individual HTML tag.