Jump to content
  • Sign Up
  • 0

Помогите решить задачку


CrystalCrystal
 Share

Question

Помогите решить задачку: почему между div#main и div#sidebar расстояние по горизонтали 10px, если div#sidebar равен 330px и внешний отступ для div#main также 330px.

В учебнике данный момент не объясняется, а я чет вообще завис.

Upd: я считаю, что блоки должны быть слитны, то есть промежутка быть не должно. Почему я ошибаюсь?

Starbuzz.zip

Edited by CrystalCrystal
Link to comment
Share on other sites

1 answer to this question

Recommended Posts

  • 0
16 часов назад, CrystalCrystal сказал:

Почему я ошибаюсь?

Потому, что ширина сайдбара в 330 пикселей это ширина вместе с margin-ами слева и справа по 10 пикселей. Ну а так как margin это внешний отступ и он не закрашивается фоном сайдбара, отсюда и расстояние

  • Thanks 1
Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Answer this question...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

 Share

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue. See more about our Guidelines and Privacy Policy