Home > Article > Web Front-end > CSS overflow attribute (June 02, 2015)_html/css_WEB-ITnose
Very basic knowledge, get a small skill every day...
1. Meaning
overflow attribute: The attribute stipulates when the element box Events that occur when content overflows the element box
In layman's terms, it is what happens when a child element placed in a parent element is larger than it
2. Attribute values
3. Test example
We include a picture in a div, make the height of the picture greater than the width of the div, and then set different overflow values of the div to see the actual page effect
<!DOCTYPE html><html><head lang="en"> <meta charset="UTF-8"> <title>overflow测试</title></head><style> body{ margin:0px; padding:0px; } .pic_wrap { background-color: blue; height: 310px; width: 500px; margin:0 auto; overflow: hidden; }</style><body><div class="pic_wrap"> <img src="img/Chrysanthemum.jpg" width="320" height="320"></div></body></html>
1. Set the value to visible
2. Set the value to hidden
3. Set the value to scroll