You are viewing limited content. For full access, please sign in.

Question

Question

Date with time CSS

asked on August 30, 2017

I am trying to figure out how to have a date with time field all inline instead of two lines.  I have tried the below code with and without the period, but I can't seem to either find the right selector, or I don't know what...I am using Forms 10.2

.ui-datepicker {
  display: inline-block;}
.ui-timepicker-wrapper {
  display: inline-block;}

0 0

Answer

SELECTED ANSWER
replied on August 30, 2017 Show version history

Try using the following:

.cf-date-field-date,
.cf-date-field-time {
  display:inline-block;
}

.cf-date-field-time {
  margin-top:0px;
  margin-right:150px;
  float:right;
}

.cf-date-field-date input[type="text"],
.cf-date-field-time input[type="text"] {
  width:142px;
}

A few notes on this,

  1. You have to float the Time field container otherwise error messages will cause it to shift down and out of alignment with the date field.
  2. You have to set an appropriate width because the defaults are percentage based and will be way too small when you put them inline.
  3. You have to remove the top margin from the Time field container because it has a top margin meant to separate it from the date field.
  4. You need to set margin-right on the Time field container to get it closer to the date field because of the float.

 

1 0
replied on August 30, 2017

That worked perfectly thank you

0 0

Replies

You are not allowed to reply in this post.
You are not allowed to follow up in this post.

Sign in to reply to this post.