Why does the span element have width and height attributes after setting float in css?
P粉301974093
P粉301974093 2023-06-02 22:34:48
0
3
1951

Why does the span element have width and height attributes after setting float in css?

P粉301974093
P粉301974093

reply all(1)
WBOY

For the span element, it is an inline element and does not have width and height attributes by default. But when the span element is set to float, it will become a floating box of a block-level element. At this time, its width will be adjusted according to the width of the content, and the content will expand the height of the element. Therefore, the span element that is floated will have width and height attributes.

  • reply Master, can you add us on WeChat to ask questions about GraphQL?
    李栋 author 2023-09-05 21:00:47
  • reply Master, can you add WeChat to ask questions about GraphQL? V: dongli3023
    李栋 author 2023-09-05 21:01:10
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template