Introduction
In this project, you will learn how to use CSS Flexbox to create a fruit arrangement layout. You will learn how to use the align-self and order properties to position and arrange the fruits in the bowls.
👀 Preview

🎯 Tasks
In this project, you will learn:
- How to set up the HTML structure for the fruit arrangement
- How to use the
align-selfproperty to align individual flex items along the cross axis - How to use the
orderproperty to change the order of flex items - How to arrange the fruits in the desired layout using Flexbox
🏆 Achievements
After completing this project, you will be able to:
- Use CSS Flexbox to create a responsive and visually appealing layout
- Apply the
align-selfandorderproperties to control the positioning and arrangement of elements - Work with CSS selectors and properties to achieve the desired design
Set Up the Project Structure
In this step, you will learn how to set up the project structure.
To get started, open the editor. You should see some files — index.html、style.css and images from your editor.
Click on Go Live button in the bottom right corner of WebIDE, to run the project.
Next, open "Web 8080" on the top of the VM and refresh it manually and you will see the page.

Style the Fruit Arrangement
In this step, you will learn how to use the align-self and order properties to style the fruit arrangement. Follow the steps below to complete this step:
- Open the
index.cssfile in your editor. - Target the
.yellowclass and set thealign-selfproperty toflex-end. - Set the
orderproperty of the.yellowclass to1.
Your index.css file should now look like this:
.yellow {
align-self: flex-end;
order: 1;
}
The align-self property is used to align the individual flex items along the cross axis, overriding the align-items value. In this case, we set it to flex-end to align the yellow fruit at the bottom of the bowl.
The order property is used to change the order of the flex items. We set it to 1 for the yellow fruit, which will place it at the end of the flex container.
The finished result is as follows:

Summary
Congratulations! You have completed this project. You can practice more labs in LabEx to improve your skills.



