margin-right和margin-inline-end效果对比实例页面
展示
1. 设置margin-right:10px;
2. 设置margin-inline-end: 10px
代码
-
HTML:
<h4>1. 设置margin-right:10px;</h4> <p class="cw-right"><button>确定</button><button>取消</button></p> <p class="cw-right"><button>确定</button><button>取消</button></p> <h4>2. 设置margin-inline-end: 10px</h4> <p class="cw-end"><button>确定</button><button>取消</button></p> <p class="cw-end"><button>确定</button><button>取消</button></p>
-
CSS:
.cw-right button { margin-right: 10px; } .cw-end button { margin-inline-end: 10px; } p + p { direction: rtl; }