开发者

css: wont margin-left when exist a float element

开发者 https://www.devze.com 2023-01-29 17:59 出处:网络
I have this: htt开发者_高级运维p://jsfiddle.net/ETm93/ Now my floated element, leftPanel is having a margin-right: 20px; works fine. Now I want to give rightPanel_center a margin-left by 50px; and i

I have this:

htt开发者_高级运维p://jsfiddle.net/ETm93/

Now my floated element, leftPanel is having a margin-right: 20px; works fine. Now I want to give rightPanel_center a margin-left by 50px; and it do not wants to.

Why cant I do this and how should I solve it?


The margin for that element starts at the left side of the screen, not where you think it starts. If you set margin to 180px, 190px, etc. You will see that it starts to expand at that point (but probably not where you're expecting it to expand from).


Try to set float: right at profile_rightPanel_center div

Regards!

0

精彩评论

暂无评论...
验证码 换一张
取 消