How can I center this datepicker in my form?

Brennan Bennett

http://imgur.com/w1AaBbK
this is what it looks like at the moment. Id like it to be in the center of the screen if possible. here is the code for the datepicker part

    <div class="input-group" style="margin-left: 20px;">
     <div id="datepicker-container">
      <div id="datepicker-center">
       <input type="text" id="from" class="form-control" style="width: 180px"/>
       <input type="text" id="to" class="form-control" style="width: 180px"/>
      </div>
     </div>
    </div>  

and the JS

$(function () {
$("#from").datepicker({
    defaultDate: "+1w",
    changeMonth: true,
    numberOfMonths: 3,
    onClose: function (selectedDate) {
        $("#to").datepicker("option", "minDate", selectedDate);
    }
});
$("#to").datepicker({
    defaultDate: "+1w",
    changeMonth: true,
    numberOfMonths: 3,
    onClose: function (selectedDate) {
        $("#from").datepicker("option", "maxDate", selectedDate);
    }
});
});  

I was trying this CSS, but it doesnt work

 #datepicker-container{
text-align:center !important;
}
#datepicker-center{
display:inline-block !important;
margin:0 auto !important;
}

Cant get fiddle to run the datepicker. heres a link too the site. http://bbennett36.github.io/firstclass/bookatrip.html

Anil Tiwari

try overriding inline css with

.ui-datepicker{ left: 50% !important; margin-left: -25.5em !important;}

25.5em is the half of width of calendar container

Collected from the Internet

Please contact [email protected] to delete if infringement.

edited at
0

Comments

0 comments
Login to comment

Related

From Dev

How can I center my button on radiogroup?

From Dev

How can i center these images on my screen

From Dev

How can i center the slideshow in my website to be in the center of the screen?

From Dev

How can I align my icon to be in center of my square box?

From Dev

How can I align my form the left

From Dev

How can i center the list items inside my unordered list?

From Dev

CSS - How can I center my navigation bar?

From Dev

How can i center the list items inside my unordered list?

From Dev

how can I center text in my bootstrap webpage?

From Dev

How can I center my main blog content?

From Dev

How to center my form in the middle of the content

From Dev

How can i do that on mouse enter event the new form/usercontrol will move to the center of Form1?

From Dev

How can i do that on mouse enter event the new form/usercontrol will move to the center of Form1?

From Dev

I want my form to be in the middle of my page not at the top center

From Dev

I can't center the text in my listview

From Dev

I can't center my menu on HTML

From Dev

How can I center my ul li list inside my div?

From Dev

How can I make my icon stay in the center of my accordion header?

From Dev

How can I center my header buttons and push items to the far right of my toolbar?

From Dev

How can i center this menu?

From Dev

How can I center content

From Dev

(How) can I tell if my form field is hidden in Django template

From Dev

how can I put in HTML certain information form my json

From Dev

How can I make my form take only a limited space?

From Dev

How can I tell my form that the value of a control changed?

From Dev

How can I access my list in another form?

From Dev

How can I extend my form with csrf token properly?

From Dev

How can I add an image header to my php mail form?

From Dev

How can I arrange my form with html and php

Related Related

  1. 1

    How can I center my button on radiogroup?

  2. 2

    How can i center these images on my screen

  3. 3

    How can i center the slideshow in my website to be in the center of the screen?

  4. 4

    How can I align my icon to be in center of my square box?

  5. 5

    How can I align my form the left

  6. 6

    How can i center the list items inside my unordered list?

  7. 7

    CSS - How can I center my navigation bar?

  8. 8

    How can i center the list items inside my unordered list?

  9. 9

    how can I center text in my bootstrap webpage?

  10. 10

    How can I center my main blog content?

  11. 11

    How to center my form in the middle of the content

  12. 12

    How can i do that on mouse enter event the new form/usercontrol will move to the center of Form1?

  13. 13

    How can i do that on mouse enter event the new form/usercontrol will move to the center of Form1?

  14. 14

    I want my form to be in the middle of my page not at the top center

  15. 15

    I can't center the text in my listview

  16. 16

    I can't center my menu on HTML

  17. 17

    How can I center my ul li list inside my div?

  18. 18

    How can I make my icon stay in the center of my accordion header?

  19. 19

    How can I center my header buttons and push items to the far right of my toolbar?

  20. 20

    How can i center this menu?

  21. 21

    How can I center content

  22. 22

    (How) can I tell if my form field is hidden in Django template

  23. 23

    how can I put in HTML certain information form my json

  24. 24

    How can I make my form take only a limited space?

  25. 25

    How can I tell my form that the value of a control changed?

  26. 26

    How can I access my list in another form?

  27. 27

    How can I extend my form with csrf token properly?

  28. 28

    How can I add an image header to my php mail form?

  29. 29

    How can I arrange my form with html and php

HotTag

Archive