Jump to content
  • 0

Проблема с вертикальными отступами span


infidel
 Share

Question

Всем привет.

Не могу понять откуда берутся отступы.

<div class="mc543_minimenu">    <div class="mc543_button">        <div>            <span class="mc543_l1"></span>            <span class="mc543_l2"></span>        </div>    </div>    <div class="mc543_menuhandler"></div></div>

CSS из правой менюшки консоли хрома -

element.style {}wp.test/media="all".mc543_minimenu span {    margin: 0;    padding: 0;    display: inline-block;    width: 100%;    height: 5px;    background: #4F4F4F;}wp.test/media="all"html, body, div, span, applet, object, iframe, h1, h2, h3, h4, h5, h6, p, blockquote, pre, a, abbr, acronym, address, big, cite, code, del, dfn, em, font, ins, kbd, q, s, samp, small, strike, strong, sub, sup, tt, var, dl, dt, dd, ol, ul, li, fieldset, form, label, legend, table, caption, tbody, tfoot, thead, tr, th, td {    border: 0;    font-family: inherit;    font-size: 100%;    font-style: inherit;    font-weight: inherit;    margin: 0;    outline: 0;    padding: 0;    vertical-align: baseline;}wp.test/media="all"* {    font-family: Tahoma;}Inherited from divwp.test/media="all"html, body, div, span, applet, object, iframe, h1, h2, h3, h4, h5, h6, p, blockquote, pre, a, abbr, acronym, address, big, cite, code, del, dfn, em, font, ins, kbd, q, s, samp, small, strike, strong, sub, sup, tt, var, dl, dt, dd, ol, ul, li, fieldset, form, label, legend, table, caption, tbody, tfoot, thead, tr, th, td {    border: 0;    font-family: inherit;    font-size: 100%;    font-style: inherit;    font-weight: inherit;    margin: 0;    outline: 0;    padding: 0;    vertical-align: baseline;}wp.test/media="all"* {    font-family: Tahoma;}Inherited from div.mc543_buttonwp.test/media="all"html, body, div, span, applet, object, iframe, h1, h2, h3, h4, h5, h6, p, blockquote, pre, a, abbr, acronym, address, big, cite, code, del, dfn, em, font, ins, kbd, q, s, samp, small, strike, strong, sub, sup, tt, var, dl, dt, dd, ol, ul, li, fieldset, form, label, legend, table, caption, tbody, tfoot, thead, tr, th, td {    border: 0;    font-family: inherit;    font-size: 100%;    font-style: inherit;    font-weight: inherit;    margin: 0;    outline: 0;    padding: 0;    vertical-align: baseline;}wp.test/media="all"* {    font-family: Tahoma;}Inherited from div.mc543_minimenuwp.test/media="all"html, body, div, span, applet, object, iframe, h1, h2, h3, h4, h5, h6, p, blockquote, pre, a, abbr, acronym, address, big, cite, code, del, dfn, em, font, ins, kbd, q, s, samp, small, strike, strong, sub, sup, tt, var, dl, dt, dd, ol, ul, li, fieldset, form, label, legend, table, caption, tbody, tfoot, thead, tr, th, td {    border: 0;    font-family: inherit;    font-size: 100%;    font-style: inherit;    font-weight: inherit;    margin: 0;    outline: 0;    padding: 0;    vertical-align: baseline;}wp.test/media="all"* {    font-family: Tahoma;}Inherited from body.home.page.page-id-6.page-template-defaultwp.test/media="all"html, body, div, span, applet, object, iframe, h1, h2, h3, h4, h5, h6, p, blockquote, pre, a, abbr, acronym, address, big, cite, code, del, dfn, em, font, ins, kbd, q, s, samp, small, strike, strong, sub, sup, tt, var, dl, dt, dd, ol, ul, li, fieldset, form, label, legend, table, caption, tbody, tfoot, thead, tr, th, td {    border: 0;    font-family: inherit;    font-size: 100%;    font-style: inherit;    font-weight: inherit;    margin: 0;    outline: 0;    padding: 0;    vertical-align: baseline;}wp.test/media="all"* {    font-family: Tahoma;}Inherited from html.no-jswp.test/media="all"html, body, div, span, applet, object, iframe, h1, h2, h3, h4, h5, h6, p, blockquote, pre, a, abbr, acronym, address, big, cite, code, del, dfn, em, font, ins, kbd, q, s, samp, small, strike, strong, sub, sup, tt, var, dl, dt, dd, ol, ul, li, fieldset, form, label, legend, table, caption, tbody, tfoot, thead, tr, th, td {    border: 0;    font-family: inherit;    font-size: 100%;    font-style: inherit;    font-weight: inherit;    margin: 0;    outline: 0;    padding: 0;    vertical-align: baseline;}wp.test/media="all"* {    font-family: Tahoma;}

Как есть

h_1442627879_6232194_6324c4790f.jpg

Как должно быть по моему мнению

h_1442627676_1200743_aa411573c4.jpg

Не могу понять в чем дело, вроде бы в стилях нет ничего что влияло бы на эти оступы, однако они есть. Проверял в хроме и в ие.

 

UPD: Мда стили из хрома конечно некорректно отображаются здесь, многие строки перечеркнуты там... Вобщем очень надеюсь что среди форумчан есть телепаты. Иначе придется мне подумать как подать свою мысль более доходчиво.

Edited by infidel
Link to comment
Share on other sites

2 answers to this question

Recommended Posts

  • 0

Советую в следующий раз выкладывать код на jsfiddle и давать на него ссылку.

 

У вас блоки inline-block, на них действует line-height (межстрочное расстояние, проще говоря). Поэтому <span> надо задать как display: block или заменить <span> на <div> или родителю задать line-height: 0.

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