Use float and display:block to convert inline elements to different points of block elements using float and display:block to convert inline elements to different points of block elements:
Inline elements can be converted to block-level elements, such as the use of the float property for inline elements to float inline elements, or to add display:block to inline elements. Although both can make inline elements into block-level elements, there are differences. The code example is as follows:
<! DOCTYPE html>
The above code uses float to achieve the conversion of a element to block-level elements, you can see that the width is based on the content. Let's look at a code example:
<! DOCTYPE html>
The above code adds display:block to the a element and converts it to an accounting element, but the width is not determined by the content, but by default it is width:100%.
There may be more differences between the two, welcome to add a message.
Convert inline elements to different points of block elements using float and display:block