Interview Question

What is reflow and repaint?

Reflow changes layout; repaint redraws appearance.

💡 Concept ✅ Quick Revision 🌐 HTML

Answer

Reflow recalculates element sizes and positions; repaint redraws their appearance. • Changing width may cause reflow and repaint. • Changing only color usually needs repaint but not reflow. • Too many repeated changes can make animation feel slow.

💡 Simple Example

<p>Changing a box from `width: 100px` to `200px` can move nearby content.</p>

⚡ Quick Revision

Reflow changes layout; repaint redraws appearance.