Jump to content
  • 0

Помогите разобраться с border для div


maxmaster
 Share

Question

Доброго времени суток!

Есть два div`а: в одном большая картинка, в другом превьюшки. Для второго div назначен стиль border. Проблема в том, что border рисуется не вокруг самого div, а как отдельный элемент. Под спойлерами исходники и скрины. Так отображается в ФФ 11, Хром 17, Опера 11.62. Если вставить в HTML нужного div картинку самому(не яваскриптом), то результат не меняется

Картинки

  Reveal hidden contents

Как выглядит. Серая рамка над картинками - это наш border

0_898f3_e80daf7_orig.jpg

Что показывает web developer. Красная линия - граница элемента div

0_898f5_2b07fbc_orig.jpg

DOM

0_898f4_4e3e63a8_orig.jpg

HTML-код

  Reveal hidden contents

CSS-код

  Reveal hidden contents

#galleryPreview{

width: 756px;

margin-top: 20px;

padding:10px;

border: 1px solid gray;

margin-left: 50%;

right: 378px;

position: relative;

}

#galleryPreview img{

width: 64px;

height: 64px;

margin: 10px;

float: left;

}

javascript-код, отвечающий за создание превьюшек

  Reveal hidden contents

Link to comment
Share on other sites

4 answers to this question

Recommended Posts

  • 0
  On 4/18/2012 at 9:28 AM, maxmaster said:

Спасибо. Но работает также и auto. Мне непонятно само поведение элементов img при не заданном overflow

Nanto уже ответил.

auto не желательно, так как может появиться скролл.

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