简体   繁体   中英

Increasing div's width

I have a problem with my divs. I created 3 divs with same classes. I want to create 3 cards with avatar and personal info on them, but these divs are "sticked". I want to make a gap between them (from right side), but when I make padding-right, there's no gap, but more background color. How can I separate these three divs without changing width?

Here's my code:

<div id="team">
    <div class="id">
        <div class="idContent">
      <!--Here is content in a frame!-->
    </div>
  </div>

  <div class="id">
        <div class="idContent">
      <!--Here is content in a frame!-->
    </div>
  </div>

  <div class="id">
        <div class="idContent">
      <!--Here is content in a frame!-->
    </div>
  </div>
</div>

http://codepen.io/anon/pen/PbMBPy

Thanks for help!

You have to use margin-right: 25px; instead of padding-right: 25px;

在此处输入图片说明

use margin-right instead of padding-right

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM