最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

javascript - How to align items in a row using CSS? - Stack Overflow

programmeradmin1浏览0评论

I have three buttons and i want to align them in a row and they should get equal space.

For example i have something like this:-

<div class='parent'>
  <button class='child'> Button 1 </button>
  <button class='child'> Button 2 </button>
  <button class='child'> Button 3 </button>
</div>

Now i want to align all the buttons in a single row having equal space so that if i add another button in future i don't need to worry and every button will have equal space.

I have three buttons and i want to align them in a row and they should get equal space.

For example i have something like this:-

<div class='parent'>
  <button class='child'> Button 1 </button>
  <button class='child'> Button 2 </button>
  <button class='child'> Button 3 </button>
</div>

Now i want to align all the buttons in a single row having equal space so that if i add another button in future i don't need to worry and every button will have equal space.

Share Improve this question asked Nov 20, 2018 at 17:26 Nitesh RanjanNitesh Ranjan 1,3291 gold badge14 silver badges13 bronze badges 2
  • 1 Have you tried anything? what does your 'child' class look like? – Katie.Sun Commented Nov 20, 2018 at 17:26
  • 3 Flexbox is your friend
发布评论

评论列表(0)

  1. 暂无评论