Describe the float, clear, and overflow properties. Show an example of each.
What will be an ideal response?
Float: The float property lets you position an element to the left or right edge of its parent element. You can float an image to the left or right of text.?The style rule for the floating image floats the image to the left and adds a margin to offset the text from the image. The style rule looks like this:?img {float: left;margin-right:10px;}?The float property can also be used to float a content box to the left or right of text. Used with the width element, you can create a content box.?Clear: The clear property lets you control the flow of text around floated elements. You only use the clear property when you are using the float property. Use the clear property to force text to appear beneath a floated element, rather than next to it.?The clear property lets you clear from either left- or right-floating images using the left or right values. The both value lets you control text flow if you have floating images on both the left and right sides of the text.Example:
?Overflow: The overflow property lets you control when content overflows the content box that contains it. This can happen when the content is larger than the area it is designed for, especially when a height property is set for a content element.?To solve this problem, you can add an overflow property to the element. You can choose to show scroll bars or to hide the overflow content.Example for automatic scroll bars:div {overflow: auto;}
Computer Science & Information Technology
You might also like to view...
________ is the process of taking data from a sample of the population and making predictions about the entire population
Fill in the blank(s) with the appropriate word(s).
Which of the following protocols is used to send mail to another server on the Internet?
A. RTP B. SNMP C. POP D. SMTP