Form elements types misbehaving in my theme looks con't
-
I may have closed the previous post with the same Topic a little too quickly. I thought I should provide some feedback from my findings.
I did inspect the code and the theme that I am using is using and not overriding the bootstrap.min.css for both the checkbox and radio classes used in Participant Database pages.This is what the bootstrap.min.css is configured for both the checkbox and the radio:
.checkbox, .radio { position: relative; display: block; margin-top: 10px; margin-bottom: 10px; }
When dealing with a table for those classes I had to override the ‘display:’ in the bootstrap css, replace it by ‘display: table-row;’
for my themes (Sparkling from colorlib) here is the css change that I performed:
#page .checkbox, .radio { display: table-row; }
This fixed most of the problems but not all. The <input> tags are not aligned same problem as above the bootstrap.min.css needs to be overridden.
This is what the bootstrap.min.css configuration looks like for the input tags:
.checkbox input[type="checkbox"], .checkbox-inline input[type="checkbox"], .radio input[type="radio"], .radio-inline input[type="radio"] { position: absolute; margin-left: -20px; }
The css change that I performed (note: I do not know if the Participant Database uses inputs with …-inline types):
.checkbox input[type=checkbox], .checkbox-inline input[type=checkbox], .radio input[type=radio], .radio-inline input[type=radio] { position:static; }
I kept the best for the end, the horizontal positioning is working for me because I have been using labels for my values, see: Defining Participants Database Fields
If you decide that you will not be using labels what I noticed from the input type: checkbox but I assume the other input types will do the same, the input tag jumps to the left cell of the table. I believe to fix that problem you will need or suppress the margin-left or something else.
Example of the css change required with input values having no value:
.checkbox input[type=checkbox], .checkbox-inline input[type=checkbox], .radio input[type=radio], .radio-inline input[type=radio] { margin-left: 0px; }
- The topic ‘Form elements types misbehaving in my theme looks con't’ is closed to new replies.