There are many ways to do HTML layouts that are both semantic and able to accommodate varying screen sizes. For instance, for beginner’s the CSS Float and Flexbox layouts are simple to setup and easy to work with.
CSS Float Layout
It is common to do entire web layouts using the CSS float and clear properties. It’s easy to learn and works well for the most part.
Disadvantages: Floating elements are tied to the document flow, which can make things difficult to work with when accommodating a wide variety of screen sizes.
Lorem ipsum dolor sit amet consectetur adipisicing elit. Impedit sapiente eveniet cupiditate non
repudiandae in accusantium, possimus blanditiis deserunt at. Velit quo veritatis ullam? Delectus nam
ullam facere molestiae iste!
Lorem ipsum dolor sit amet consectetur adipisicing elit. Impedit sapiente eveniet cupiditate non
repudiandae in accusantium, possimus blanditiis deserunt at. Velit quo veritatis ullam? Delectus nam
ullam facere molestiae iste!
CSS Flexbox Layout
Flexbox is only slightly more difficult to understand and learn than CSS float. But when used correctly, it allows for flexible layouts that easily accommodate all screen sizes without the extra work CSS float requires.
Notice that the structure of the page is exactly the same, but the CSS changes slightly using the flex properties to do all the work.
Lorem ipsum dolor sit amet consectetur adipisicing elit. Impedit sapiente eveniet cupiditate non
repudiandae in accusantium, possimus blanditiis deserunt at. Velit quo veritatis ullam? Delectus nam
ullam facere molestiae iste!
Lorem ipsum dolor sit amet consectetur adipisicing elit. Impedit sapiente eveniet cupiditate non
repudiandae in accusantium, possimus blanditiis deserunt at. Velit quo veritatis ullam? Delectus nam
ullam facere molestiae iste!
We’d like to acknowledge that we learned a great deal of our coding from W3Schools and TutorialsPoint, borrowing heavily from their teaching process and excellent code examples. We highly recommend both sites to deepen your experience, and further your coding journey. We’re just hitting the basics here at 1SMARTchicken.
If you see an error on the page or the code itself is incorrect or incomplete, or just plain wrong, please let us know. We’re always learning. NOTE: we do not sell your information and will not send you spam emails.