0

これまでのところ、これがあります(imgタグはjavascriptによって追加されます) ここに画像の説明を入力

HTML

<p class="pCalendarContainer">
  <label for="inputSearchTo" class="field" >To</label>
  <input id="inputSearchTo" name="inputSearchTo" type="text" class="textbox" />                
  <img class="ui-datepicker-trigger" src="../../images/calendar.gif" alt="..." title="...">
</p>

CSS

.pCalendarContainer
{

}
label.field
{
    text-align:left;
    width:100px;
    float:left;
    clear:both;/*forces fields under eachother in FF*/
}
input.textbox
{
    width: 150px;
    margin-left:20px;/*Always want at least 20 px between label and input*/
    float: left;
}
.pCalendarContainer > img
{
    margin-left:5px;
    float:left;
    width:20px;
    height:20px;
    vertical-align:middle;
}

参照用の Datepicker CSS (デフォルトから変更なし)

.ui-datepicker { width: 17em; padding: .2em .2em 0; display: none; }
.ui-datepicker .ui-datepicker-header { position:relative; padding:.2em 0; }
.ui-datepicker .ui-datepicker-prev, .ui-datepicker .ui-datepicker-next { position:absolute; top: 2px; width: 1.8em; height: 1.8em; }
.ui-datepicker .ui-datepicker-prev-hover, .ui-datepicker .ui-datepicker-next-hover { top: 1px; }
.ui-datepicker .ui-datepicker-prev { left:2px; }
.ui-datepicker .ui-datepicker-next { right:2px; }
.ui-datepicker .ui-datepicker-prev-hover { left:1px; }
.ui-datepicker .ui-datepicker-next-hover { right:1px; }
.ui-datepicker .ui-datepicker-prev span, .ui-datepicker .ui-datepicker-next span { display: block; position: absolute; left: 50%; margin-left: -8px; top: 50%; margin-top: -8px;  }
.ui-datepicker .ui-datepicker-title { margin: 0 2.3em; line-height: 1.8em; text-align: center; }
.ui-datepicker .ui-datepicker-title select { font-size:1em; margin:1px 0; }
.ui-datepicker select.ui-datepicker-month-year {width: 100%;}
.ui-datepicker select.ui-datepicker-month, 
.ui-datepicker select.ui-datepicker-year { width: 49%;}
.ui-datepicker table {width: 100%; font-size: .9em; border-collapse: collapse; margin:0 0 .4em; }
.ui-datepicker th { padding: .7em .3em; text-align: center; font-weight: bold; border: 0;  }
.ui-datepicker td { border: 0; padding: 1px; }
.ui-datepicker td span, .ui-datepicker td a { display: block; padding: .2em; text-align: right; text-decoration: none; }
.ui-datepicker .ui-datepicker-buttonpane { background-image: none; margin: .7em 0 0 0; padding:0 .2em; border-left: 0; border-right: 0; border-bottom: 0; }
.ui-datepicker .ui-datepicker-buttonpane button { float: right; margin: .5em .2em .4em; cursor: pointer; padding: .2em .6em .3em .6em; width:auto; overflow:visible; }
.ui-datepicker .ui-datepicker-buttonpane button.ui-datepicker-current { float:left; }
4

1 に答える 1

1

display:block画像にとを使用margin-topします。

.pCalendarContainer > img
{
    margin-left:5px;
    float:left;
    width:20px;
    height:20px;
    display:block;
    margin-top:3px;    
}
于 2013-01-08T19:46:22.083 に答える