FOLLOW US ON TWITTER



FOLLOW US



img/blogimg/css3.jpg


@coder 1277

How to use CSS3 Overflow Property?


2021-11-16 18:53 · 5 min read

Web Designers use the overflow property to add a scrollbar when the width or height of the content is bigger than the container size.

 

What is the CSS3 Overflow property?

The overflow property is used to fit the content inside the containers with horizontal or vertical scrollbars

  • CSS3 Overflow syntax
    overflow: auto | scroll | visible | hidden | initial | inherit;
  • Clearfix
    The overflow property is also used in float clearing (clearfix).

 

<style>
/*example*/
.tdb-overflow{
width:100px;
height:100px;
overflow:auto;
}
</style>

 

<head>
<style>
.tdb-overflow{
width:60px;
height:100px;
overflow:auto;
}
</style>
</head>

<body>
<h1 class="tdb-overflow">Overflow property</h1>
</body>

 

OVERFLOW-X

Overflow-x property is used to fit the content inside the containers with a horizontal scrollbar.

  • CSS3 Overflow syntax
    overflow-x: auto | scroll | visible | hidden | initial | inherit;
<style>
/*example*/
.tdb-overflow{
width:100px;
height:100px;
overflow-x:auto;
}
</style>
<head>
<style>
.tdb-overflow{
width:60px;
height:100px;
overflow-x:auto;
}
</style>
</head>

<body>
<h1 class="tdb-overflow"Overflow property</h1>
</body>

 

OVERFLOW-Y

Overflow-y property is used to fit the content inside the containers with vertical scrollbar.

  • CSS3 Overflow syntax
    overflow-y: auto | scroll | visible | hidden | initial | inherit;
<style>
/*example*/
.tdb-overflow{
width:100px;
height:100px;
overflow-y:auto;
}
</style>
<head>
<style>
.tdb-overflow{
width:60px;
height:50px;
overflow-y:auto;
overflow-x:hidden;
}
</style>
</head>

<body>
<h1 class="tdb-overflow">Overflow property</h1>
</body>

 

OVERFLOW VISIBLE

Overflow: visible is the default value of the CSS3 Overflow property. The overflow is rendered outside the container box.

<style>
/*example*/
.tdb-overflow{
width:100px;
height:100px;
overflow: visible;
background-color:black;
color:orange;
}
</style>
<head>
<style>
.tdb-overflow{
width:100px;
height:100px;
overflow: visible;
background-color:black;
color:orange;
}
</style>
</head>
<body>
<h1 class="tdb-overflow">Overflow property</h1>
</body>

 

OVERFLOW SCROLL

By using this property. The overflow is clipped, and the vertical and horizontal scroll bars are added to the HTML container classes.

  • CSS3 Overflow syntax
    overflow-y: scroll;
<style>
/*example*/
.tdb-overflow{
width:100px;
height:60px;
overflow: scroll;
background-color:black;
color:orange;
}
</style>
<head>
<style>
.tdb-overflow{
width:100px;
height:60px;
overflow: scroll;
background-color:black;
color:orange;
}
</style>
</head>

<body>
<h1 class="tdb-overflow">CSS3 overflow property</h1>
</body>
TAGS:






POST COMMENTS
No Comment

Please login to post comment




POPULAR POSTS

best free web hosting services...
what is new in miui 11?...
free website ssl security using cloudfla...
do you want to make money online?...
CSS3 @IMPORT RULES...
What is HTML Anchor Tag and Hyperlinks?...
CSS3 RESPONSIVE UI...
How to host a web page in 10 minutes....
Tables HTML...
CSS3 FUNCTIONS...
How to use CSS3 Overflow Property?...
CSS3 FILTERS...


RECENT COMMENTS

2022-03-05 11:05
By coder on XAMPP - MySQL shutdown unexpectedly | How to fix MySQL crash unexpectedly
2021-10-12 12:34
By abnongoke on do you want to make money online?
2021-10-12 12:34
By abnongoke on how to get a free website domain name?
2021-10-12 12:34
By solar panel for shed on what is new in miui 11?
2021-10-12 12:34
By solar panel for shed on best free web hosting services
2021-10-12 12:34
By amos tanui on free website ssl security using cloudflare


SOCIAL SHARE



FOLLOW US ON TWITTER



FOLLOW US ON FACEBOOK



FOLLOW US







Recent Blogs



Contact Us

Subscribe Our News-Letter



Kashipur, 244713
Uttarakhand, India



© blog.theprodevelopers.com 2024. All Rights Reserved. Powered by Pro Developer