When we use <img>
inside <p><img style="float:left">dummy text dummy text dummy text dummy text</p>
then how can we have the same margin at right and bottom of the image?
http://jitendravyas.com/image-margin.htm
Adjusting the Margin Size of an HTML Element With CSS You can remove this margin by setting the top and left margin to zero. Like the padding and border, the sizes of specific sides of the margin can be set using margin-left , margin-right , margin-top , and margin-bottom .
none (default): The element doesn't float. It is simply displayed where it occurs in the text. left: The element floats to the left of its container. right: The element floats to the right of its container. inherit: The element inherits the float value of its parent.
The float CSS property places an element on the left or right side of its container, allowing text and inline elements to wrap around it. The element is removed from the normal flow of the page, though still remaining a part of the flow (in contrast to absolute positioning).
Floats for layout Aside from the simple example of wrapping text around images, floats can be used to create entire web layouts. Floats are also helpful for layout in smaller instances.
Use property vertical-align: bottom; to image, then the extra space from bottom will be deleted.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With