Get the App
SLTechnology News&Howtos  ›  Development  › 

How to set margin-left for css to move div to the right

Shulou Source: shulou.com Published: 2022-06-01 11:23:05 10月04日 Update

This article mainly shows you the "css how to set margin-left to achieve div move to the right", the content is easy to understand, clear, hope to help you solve doubts, the following let the editor lead you to study and learn "css how to set margin-left to achieve div move right" this article.

Configure margin-left to complete div right move

1. In an environment with borders or backup colors

Both div are equipped with the float:left organization to the left css style, to let the second (blood) div move a little to the right, as usual is to configure the second (the latter blood) div margin-left.

2. The code before moving a little to the right to configure div:

Moving div to the right must partition the instance css5.com.cn.box-a,.box-b {width:200px;height:100px; float:left}. Box-a {border:1px solid # 00F} .box-b {border:1px solid # F00} first (former) div second (latter) div

3. Screenshot

Set the equipment div to move forward to the right.

4. Set the left outer partition format of the second div

Link CSS code:

. box-a,.box-b {width:200px;height:100px; float:left}. Box-a {border:1px solid # 00F}. Box-b {border:1px solid # F00; margin-left:20px} these are all the contents of the article "how to set up margin-left for div to move to the right". Thank you for reading! I believe we all have a certain understanding, hope to share the content to help you, if you want to learn more knowledge, welcome to follow the industry information channel!

Tags: Content articles configuration decoration blood learning help mobile normal two code backup examples screenshots easy to understand more organization format style environment Apple Docker Huawei Linux macOS MariaDB Microsoft MySQL NVidia OPPO Reno Shulou Information NVidia Shulou Tech Info Xiaomi macOS