2.3.9 Nested Views Codehs -

You will use a StyleSheet to define the colors and sizes of your nested elements. javascript

var parentView = new Rectangle(300, 400); parentView.setPosition(50, 50); // Position on the canvas parentView.setColor("lightgray"); parentView.setBorderWidth(2); add(parentView);

Here's an example of how to create nested views in CodeHS: 2.3.9 nested views codehs

: Apply the container style and set justifyContent: 'center' and alignItems: 'center' to center the child. Child View : Place a second tag inside the first one. javascript

By nesting views, you can group related UI elements together. For example, a profile card might be a parent view that contains a child view for the profile picture and another child view for the user's name text. Key Layout Properties to Remember You will use a StyleSheet to define the

Exercise 2.3.9 forces you to practice this relative positioning.

The outer container responsible for the overall layout boundaries. It dictates how its child elements are arranged using properties like flexDirection , justifyContent , and alignItems . javascript By nesting views, you can group related

: The primary container used to group and style other components. Text : The standard component used to display text strings.

Here is an example of nested views in CodeHS using JavaScript:

Your final code might look something like this:

What or unexpected visual outcome are you seeing in your CodeHS console?