2015-02-12 2 views
0

enter image description hereПеремещение якорной метки вниз?

Как перенести метку «удалить» анкера, чтобы она лучше выравнивалась с остальными элементами управления на этой линии?

Ниже мой HTML:

<strong><em>Items with an individual value less than $500 should be scheduled below.</em></strong> 

<div class="dialogSection"> 
    <div style="float:left" class="first"> 
     <label for="unscheduledDescription" style="display:inline-block"> 
      Description of Equipment 
     </label> 
     <input id="unscheduledDescription" type="text" data-bind="value: coverage.unscheduledDescription" class="input input-lg" style="margin: 6px; padding: 5px;" /> 
    </div> 
    <div style="float:left" class="first"> 
     <label for="unscheduledLimit" style="display:inline-block"> 
      Limit 
     </label> 
     <input id="unscheduledLimit" type="text" data-bind="value: coverage.unscheduledLimit" class="input input-number" style="margin: 6px; padding: 5px;" /> 
    </div> 
    <div> 
     <a href="#" data-bind="click: deleteUnscheduledCmd, clickBubble: false"> 
      delete 
     </a> 
    </div> 
</div> 

Спасибо за вашу помощь.

+0

попробуйте 'line-height' или' margin-top' или 'padding-top' –

ответ

1

Как я вижу, что <a> обернута с DIV, просто добавьте идентификатор в DIV и применить некоторые стили:

<div id = "del"> 
     <a href="#" data-bind="click: deleteUnscheduledCmd, clickBubble: false"> 
      delete 
     </a> 
</div> 

CSS:

#del{ 
    padding-top:10px; 
} 

Работа скрипку: http://jsfiddle.net/wgsrrbav/

Дайте мне знать, если я помог :)

+0

Это сработало для меня. Честно говоря, я пробовал разные комбинации отступов и полей по всей области. Я просто не мог получить правильную комбинацию. Спасибо за вашу помощь. – Richard

+0

@ Рихард рад, что я помогу тебе помочь :) –

0

.dialogSection > div { 
 
    display: inline-block; 
 
    }
<strong><em>Items with an individual value less than $500 should be scheduled below.</em></strong> 
 

 
<div class="dialogSection"> 
 
    <div class="first"> 
 
     <label for="unscheduledDescription" style="display:inline-block"> 
 
      Description of Equipment 
 
     </label> 
 
     <input id="unscheduledDescription" type="text" data-bind="value: coverage.unscheduledDescription" class="input input-lg" style="margin: 6px; padding: 5px;" /> 
 
    </div> 
 
    <div class="first"> 
 
     <label for="unscheduledLimit" style="display:inline-block"> 
 
      Limit 
 
     </label> 
 
     <input id="unscheduledLimit" type="text" data-bind="value: coverage.unscheduledLimit" class="input input-number" style="margin: 6px; padding: 5px;" /> 
 
    </div> 
 
    <div> 
 
     <a href="#" data-bind="click: deleteUnscheduledCmd, clickBubble: false"> 
 
      delete 
 
     </a> 
 
    </div> 
 
</div>

Простой Добавить Дисплей: встроенный блок; свойство in inline div. Не нужно добавлять float: left свойство к определенному Div.

.dialogSection > div { 
    display: inline-block; 
} 
1

Определенно ответ Ашиша Mehtha является лучше. Другой вариант, вы можете добавить поплавок: левый и верхний стиль в недостаточной мере в DIV (для маржи-топ стиль вместо 10px вы можете добавить что-то в pecentage как 1%, чтобы сделать его отзывчивым)

<div style="float:left; margin-top:10px;"> <a href="#" data-bind="click: deleteUnscheduledCmd, clickBubble: false"> delete </a> </div>

Jsfiddle

Смежные вопросы