What does clearfix hack do in CSS?
Answers
Answered by
1
Answer:
The clearfix, for those unaware, is a CSS hack that solves a persistent bug that occurs when two floated elements are stacked next to each other. When elements are aligned this way, the parent container ends up with a height of 0, and it can easily wreak havoc on a layout.
Answered by
1
「ᴛʜᴇ ᴄʟᴇᴀʀғɪx, ғᴏʀ ᴛʜᴏsᴇ ᴜɴᴀᴡᴀʀᴇ, ɪs ᴀ ᴄss ʜᴀᴄᴋ ᴛʜᴀᴛ sᴏʟᴠᴇs ᴀ ᴘᴇʀsɪsᴛᴇɴᴛ ʙᴜɢ ᴛʜᴀᴛ ᴏᴄᴄᴜʀs ᴡʜᴇɴ ᴛᴡᴏ ғʟᴏᴀᴛᴇᴅ ᴇʟᴇᴍᴇɴᴛs ᴀʀᴇ sᴛᴀᴄᴋᴇᴅ ɴᴇxᴛ ᴛᴏ ᴇᴀᴄʜ ᴏᴛʜᴇʀ. ᴡʜᴇɴ ᴇʟᴇᴍᴇɴᴛs ᴀʀᴇ ᴀʟɪɢɴᴇᴅ ᴛʜɪs ᴡᴀʏ, ᴛʜᴇ ᴘᴀʀᴇɴᴛ ᴄᴏɴᴛᴀɪɴᴇʀ ᴇɴᴅs ᴜᴘ ᴡɪᴛʜ ᴀ ʜᴇɪɢʜᴛ ᴏғ 0, ᴀɴᴅ ɪᴛ ᴄᴀɴ ᴇᴀsɪʟʏ ᴡʀᴇᴀᴋ ʜᴀᴠᴏᴄ ᴏɴ ᴀ ʟᴀʏᴏᴜᴛ.」♡
Similar questions