2013-12-17 30 views
0

我是一個css初學者,所以如果我提出基本問題,提前道歉。css datepicker的位置:絕對給出了正確的位置按鈕,但不正確的按

我在我的web應用程序中使用jquery datepicker,並有jQuery日期按鈕的位置問題。我正在使用一個css框架(yaml),它有一整套爲按鈕定義的樣式,所以我需要做的是覆蓋所有預定義的樣式。

當我指定以下樣式...

button.ui-datepicker-trigger, button.ui-datepicker-trigger:hover { 
    border: 0px !important; 
    background-color: transparent !important; 
    background-color: rgba(0, 0, 0, 0) !important; 
    background-image:none !important; 
    border: 0 none !important; 
    display: inline !important; 
    margin-left: 5px !important; 
    box-shadow: none !important; 
    padding: 0 0.5em !important; 
} 

日期按鈕稍微過大,不符合輸入字段行...

enter image description here

當我修復這並指定以下樣式...

button.ui-datepicker-trigger, button.ui-datepicker-trigger:hover { 
    border: 0px !important; 
    background-color: transparent !important; 
    background-color: rgba(0, 0, 0, 0) !important; 
    background-image:none !important; 
    border: 0 none !important; 
    display: inline !important; 
    margin-left: 5px !important; 
    box-shadow: none !important; 
    padding: 0 0.5em !important; 
    position: absolute !important; 
    -webkit-box-shadow: none !important; 
    -moz-box-shadow: none !important; 
} 

The日期按鈕與我想要的下一個字段一致。

enter image description here

但改變按鈕的風格來使用絕對(上述第二CSS提取的3條端線),而我做一個mousepress日期控制跳到達約15 pixeles在屏幕之後。

有沒有人有任何想法可以解決這個問題?並且對我的理解發生了什麼很好的解釋。

謝謝

+0

的jsfiddle?或給url – radha

+0

有沒有一個':active'風格擋道? –

回答

1

您可以通過使用文本框中的日曆圖標嘗試其他解決方案。

檢查這個位置: - http://jsfiddle.net/33Xxk/

.tInput_datepick { 
width: 250px; 
color: #555555; 
text-decoration: none; 
border-radius: 7px; 
padding-left: 7px; 
background-image: url(http://www.bay.k12.fl.us/portals/18/Images/calendar_icon.jpg); 
background-repeat: no-repeat; 
background-position: top right; 
background-position-y: -5px; 
height: 25px !important; 
border: 1px solid #888e9c !important; 
background-color: #f4f5f9 !important; 
cursor: pointer !important; 
} 
+0

感謝您的建議。我對結果非常滿意。我不是一個專家,但正在尋找這個領域。有時候你不會考慮這樣的小事情。再次感謝 – Richie

+0

要使用此CSS應該在jQuery UI datePicker javascript中做什麼更改以避免重複圖標? @Anup – user4271704