Here's an example of three divs with the alignment of elements inside on the left:

<div style='display: flex; flex-direction: row;'>
  <div style='display: flex; flex-direction: column; align-items: flex-start;'>
    <h2>Title 1</h2>
    <p>Content 1</p>
  </div>
  <div style='display: flex; flex-direction: column; align-items: flex-start;'>
    <h2>Title 2</h2>
    <p>Content 2</p>
  </div>
  <div style='display: flex; flex-direction: column; align-items: flex-start;'>
    <h2>Title 3</h2>
    <p>Content 3</p>
  </div>
</div>

In this example, we're using flexbox to create a row of three divs. Each div has a column direction and align-items set to 'flex-start', which aligns the elements inside to the left. The h2 and p elements inside each div are also aligned to the left by default.

CSS Flexbox: Aligning Elements Left in Three Divs

原文地址: https://www.cveoy.top/t/topic/lQbx 著作权归作者所有。请勿转载和采集!

免费AI点我,无需注册和登录