Tutorials Point


  CSS Home

  CSS Reference
  Pseudo Classes & Elements

Copyright © 2014 by tutorialspoint



  Home     References     Discussion Forums     About TP  

CSS - overflow


previous next AddThis Social Bookmark Button


Advertisements

Description:

The overflow property determines how content which overflows its element's content area should be handled.

Possible Values:

  • visible: Overflowing content should be displayed.
  • hidden: Overflowing content should not be displayed.
  • scroll: Overflowing content should not be displayed, but the user agent should provide some means of accessing the hidden content (e.g., a set of scrollbars).
  • auto: The behavior caused by this value is dependent on the browser.

Applies to:

All the HTML elements

DOM Syntax:

object.style.overflow="scroll";

Example:

Here is the example:

<style type="text/css">
.scroll{
	display:block;
	border: 1px solid red;
	padding:5px;
	margin-top:5px;
	width:300px;
	height:50px;
	overflow:scroll;
	}
.auto{
	display:block;
	border: 1px solid red;
	padding:5px;
	margin-top:5px;
	width:300px;
	height:50px;
	overflow:auto;
	}
</style>
<p>Example of scroll value:</p>
<div class="scroll">
I am going to keep lot of content here just to show
you how scrollbars works if there is an overflow in
an element box. This provides your horizontal as well
 as vertical scrollbars.
</div>
<br />
<p>Example of auto value:</p>
<div class="auto">
I am going to keep lot of content here just to show
you how scrollbars works if there is an overflow in
an element box. This provides your horizontal as well
as vertical scrollbars.
</div>

This will produce following result:

Example of scroll value:

I am going to keep lot of content here just to show you how scrollbars works if there is an overflow in an element box. This provides your horizontal as well as vertical scrollbars.

Example of auto value:

I am going to keep lot of content here just to show you how scrollbars works if there is an overflow in an element box. This provides your horizontal as well as vertical scrollbars.

To Become more comfortable - Do Online Practice



previous next Printer Friendly

Advertisements


  

Advertisements