components placed inside the parent. Their size can be controlled using fixed Flexbox Styling
Note: I assume a typical CodeHS environment where you build simple web or GUI layouts with containers, views (panels/divs), layout properties, and basic event handling. If you want examples for a specific framework (p5.js, Karel, React, SwiftUI, etc.), say which and I’ll adapt. 2.3.9 nested views codehs
: If the parent doesn't have flex: 1 , it may collapse to 0 height, making everything inside it disappear. components placed inside the parent
Add the child views to the , not directly to main . : If the parent doesn't have flex: 1
Now, create a child that sits inside the parent. The key is that its x and y are relative to the parent’s position . If the parent is at (50, 50), and you want the child at the top-left corner of the parent, you set the child’s position to (50, 50) on the canvas, OR you set it relative to the parent.