Syntax: overflow: visible | auto | hidden | scroll
Visible: Do not cut the content or add a scroll bar. If this default value is explicitly declared, the object is cut to the size of the window or frame containing the object. In addition, the clip attribute settings are invalid.
Auto: The default value for the body object and textrea. Cut the content and add a scroll bar as needed
Hidden: content beyond the object size is not displayed.
Scroll: always displays the scroll bar.
Instance
| The code is as follows: |
Copy code |
Body {overflow: hidden ;} Div {overflow: scroll; height: 100px; width: 100px ;} |
Css
| The code is as follows: |
Copy code |
| <! Doctype html public "-// w3c // dtd xhtml 1.0 strict // en" "http://www.w3.org/tr/xhtml1/dtd/xhtml1-strict.dtd"> <Html xmlns = "http://www.w3.org/1999/xhtml"> <Head> <Meta http-equiv = "content-type" content = "text/html; charset = utf-8"/> <Title> 111cn.net </title> <Style type = "text/css"> # Yc { Width: 180px; Height: 100px; Overflow: hidden; } </Style> </Head> <Body> <Div id = "yc"> <Table cellspacing = "0" cellpadding = "0"> <Tr> <Td> 111cn.net professional div + css tutorial 111cn.net professional div + css tutorial 111cn.net professional div + css tutorial </td> </Tr> <Tr> <Td> 111cn.net professional div + css tutorial 111cn.net professional div + css tutorial 111cn.net professional div + css tutorial </td> </Tr> <Tr> <Td> 111cn.net professional div + css tutorial 111cn.net professional div + css tutorial 111cn.net professional div + css tutorial </td> </Tr> </Table> </Div> </Body> </Html> |