Check boxes bottom border is not visible in internet explorer - html

Check boxes are working fine in chrome but not in internet explorer.
Here is my HTML code:
<div class="patient-div-w" style="width: 9.5vw;">
<input type="checkbox" id="edema" class="input-checkbox-l">
<label class="label-n" for="edema" style="line-height: 8vh;">Edema</label>
<br>
</div>
Here is my CSS code:
input[type="checkbox"] {
opacity: 0;
margin: 0px 3px 0px 0px;
}
.input-checkbox-l[type="checkbox"] + label {
background-image: url(../images/unchk.png);
background-size: 1.2vw;
background-repeat: no-repeat;
padding-left: 1.7vw;
background-position: 0vh 0vw;
width: 8vw;
margin: 0vw;
position: relative;
top: -.1vh;
left: -1.6vw;
white-space: nowrap;
font-family: "Roboto Regular";
}
.label-n {
font-size: 1vw;
color: #000;
}
The same is the problem with radio buttons.
Any kind of help is highly appreciated.

Try this:
Lets assume the parent of .patient-div-w is .parent-div. So we need to do the following:
.parent-div{
overflow: auto;
zoom: 1;
}
This is a very common issue. You can read more about it here

Try this
In your code
<label class="label-n" for="edema" style="line-height: 8vh;">Edema</label> Just remove inline style="line-height:8vh;. it will work.
you can use below code as a reference and it will work IE, FF, Chrome
.input-checkbox-l[type="checkbox"] + label {
box-sizing:border-box;
padding:0px 20px 0px 55px;
background:url(https://i.stack.imgur.com/EAkMC.png) no-repeat center left 5px;
background-size: 30px;
font-size:22px;
margin-right:5px;
display:inline-block;
}
You can try without image
input[type="checkbox"] {
-webkit-appearance: none;
-moz-appearance: none;
appearance: none;
width: 20px;
height: 20px;
background-color: #fff;
border: 1px solid #ccc;
cursor: pointer;
outline: none;
}
input[type="checkbox"]:checked {
border:1px solid blue;
outline: none;
}
div{
display: inline-block;
}
div span{
vertical-align: super;
}
HTML
<div>
<input type="checkbox" name="" value="1"><span>Label name</span>
</div>

Related

Does anyone know why my input text is not showing up? (HTML/CSS input type text)

I'm making a form for a bookstore, but my input-type text isn't showing up on the page. Does anyone know the reason?
Is it something to do with the span or div properties?
<html>
<head>
<style>
body {background-color : #ededed; font-family : "Open Sans", sans-serif;}
h1 {padding: 40px; text-align: center; font-size: 1.5em;}
li a {text-decoration : none; color : #2d2f31;}
.top-div {
width : 300px;
background: #d9d9d9;
margin : 40px auto;
text-align: center;
}
span {
padding : 30px;
background : #2d2f31;
color : white;
font-size : 1.2em;
font-variant : small-caps;
cursor : default;
display: block;
}
span::after {
float: right;
right: 10%;
}
.slide {
clear:both;
width:100%;
height:0px;
overflow: hidden;
text-align: center;
transition: height .4s ease;
}
.slide li {padding : 30px;}
#book {position: absolute; opacity: 0; height: 0px;}
h1 {
margin: 40px auto;
}
input[type=button], input[type=submit], input[type=reset] {
background-color: #2d2f31;
border: none;
color: white;
padding: 16px 32px;
text-decoration: none;
margin: 4px 2px;
cursor: pointer;
}
input[type=text] {
border: 2px solid black;
border-radius: 4px;
width: 300px;
display: block;
margin: 40px;
cursor: auto;
}
</style>
</head>
<body>
<h1>Bookstore</h1>
<div class="top-div">
<form method="post">
<label for="book"><span> Enter the title of the book that you wish to order.</span> </label>
<input type="text" name="customer_order" id="book"> </input>
<br> <br>
<input type="submit" value="Submit">
</form>
</div>
</body>
</html>
It is because you had opacity: 0; set in your css code for #book. This means that you're input element is completely transparent. See here. Also, you're hight is set at 0px, so it comes out very small on the page.

Label is slightly lower than text input

I have a label to the left of a text input but it looks like the text is just slightly below the bottom of the input. Here is my relevant HTML:
<div id="nickbox">
<label for="nickname" id="nicklabel">Nickname:</label>
<input type="text" id="nickname" value="" maxlength="20" size="20" role="textbox"
aria-label="Enter your nickname." data-lpignore="true" autofocus />
<input type="button" id="nicknameconfirm" value="Set" />
</div>
And my CSS:
#nickbox {
border: none;
display: inline;
padding: 5px;
background-color: #ffffff00;
align-self:center;
font-size: 2em;
}
#nickname {
background-color: #44475a;
border: none;
height: 2em;
width: 20em;
outline: none;
}
This is what the results look like. What can I do to change this? I assume I need to add some CSS to #nicklabel. Thanks.
Put vertical-align: middle; into #nickname
#nickname {
background-color: #44475a;
vertical-align: middle;
border: none;
height: 2em;
width: 20em;
outline: none;
}
http://jsfiddle.net/6xqgb0mu/
What about this?
#nickbox {
display: flex; /* Change display on parent */
border: none;
padding: 5px;
background-color: #fff;
font-size: 2em;
}
#nickname {
background-color: #44475a;
border: none;
height: 2em;
width: 20em;
outline: none;
align-self: center; /* Apply to child */
}
Use position: sticky; Like here: jsfiddle
#nicklabel{
top: 13px;
position: sticky;
}

How to change the size of icon inside input using css?

I have a simple input which contains an icon on the right side and text on the left side
Here is what I would like to have in mobile version:
here is what I have so far in desktop version
HTML
<div class="form_group">
<input id="input-icon" type="text" class="form_input " placeholder="W jakim celu z nami kontaktujesz?">
</div>
csss
#media only screen and (max-width: 768px) and (min-width: 375px)
.form_input {
font-size: 10px;
font-family: Roboto;
font-weight: normal;
width: 342px;
}
#input-icon {
background: url(../images/arrow-mobile.png) no-repeat scroll 7px 7px;
background-position: right;
/* opacity: 0.4; */
}
**
UPDATE
**
To simplify things here is my jsfiddle with the icon I am using :
http://jsfiddle.net/Mwanitete/z0x6uta2/2/
what do I need to do get what I want? I tried opacity but didn't work as expected?
.form_input {
font-size: 12px;
font-family: Roboto;
font-weight: normal;
width: 342px;
border: 1px solid #ccc;
border-radius: 5px;
}
#input-icon {
background: url(https://thumb.ibb.co/iAQtup/arrow_mobile.png) no-repeat scroll 7px 7px;
background-size: 7px;
background-position: right;
opacity: 0.4;
}
<div class="form_group">
<input id="input-icon" type="text" class="form_input " placeholder="W jakim celu z nami kontaktujesz?">
</div>
Result Preview:
You can also use this.
.form_input {
font-size: 10px;
font-family: Roboto;
font-weight: normal;
width: 342px;
border: none;
border-bottom: 1px solid;
}
#input-icon {
background: url('https://thumb.ibb.co/iAQtup/arrow_mobile.png') no-repeat scroll 7px 7px;
background-position: 100%;
background-size: 4%;
}
<div class="form_group">
<input id="input-icon" type="text" class="form_input " placeholder="W jakim celu z nami kontaktujesz?">
</div>
Here is solution based on Dementic's answer ,
.form_input {
font-size: 10px;
font-family: Roboto;
font-weight: normal;
width: 342px;
border: none;
border-bottom: 1px solid;
}
#input-icon {
background: url('https://thumb.ibb.co/iAQtup/arrow_mobile.png') no-repeat scroll 5px 5px;
background-position: right;
background-size: 12px;
height: 4px;
opacity: 0.4;
}
.form_input::-webkit-input-placeholder { /* WebKit browsers */
color: transparent;
}
jsfiddle for anyone interest to see the expected result
http://jsfiddle.net/Mwanitete/z0x6uta2/16/
Thanks all for help #StopActa2Though
you are able to change icon size inside the input field using background-size:20px;
example is given below according to your code
#input-icon {
background-size: 20px;
}

Can't find a way to correct my input text box

So I have a little input box where I only want to accept numbers and I have the looks and everything fine but when I click on it the box draws another box + up and down arrows. Want to get rid of both. Also how can I add a little icon to the begging of it like in the first image.
I want this when clicking inside the box + adding the little search icon
But I get this:
html:
<div class="GeolocationInput os-animation" data-os-animation="zoomInUp" data-os-animation-delay="1.5s">
<div style="width: 100%;">
<form class="GeolocationInput-form ">
<div>
<input type="number" class="GeolocationInput-input" placeholder="Escribe tu Codigo Postal..." >
</div>
<div>
<button class="GeolocationInput-button" disabled="">Continuar</button>
</div>
</form>
</div>
</div>
CSS:
.GeolocationInput {
max-width: 700px;
margin: 0 auto;
text-align: center;
-webkit-font-smoothing: antialiased;
}
.GeolocationInput .GeolocationInput-form {
width: 274px;
margin: 10px auto 0;
}
.GeolocationInput .GeolocationInput-input {
width: 274px;
}
.GeolocationInput-input {
box-sizing: border-box;
width: 90%;
border: 1px solid #aebcce;
border-radius: 100px;
padding: 15px 40px 10px 42px;
margin: 0 0 15px;
font-size: 16px;
font-family: proxima-nova,Helvetica Neue,Helvetica,Avenir,Lucida Grande,Arial,sans-serif;
font-weight: 300;
}
.GeolocationInput-button {
background: #635bd4;
max-width: 275px;
width: 90%;
color: #fff;
cursor: pointer;
font-size: 16px;
padding: 16px 32px;
text-decoration: none;
white-space: nowrap;
border-radius: 100px;
border: none;
font-family: proxima-nova,Helvetica Neue,Helvetica,Avenir,Lucida Grande,Arial,sans-serif;
font-weight: 500;
text-align: center;
}
http://jsfiddle.net/zhpmahnq/192/
You can remove the border with:
.GeolocationInput-input:focus {
outline: none;
}
The arrows are a little harder to remove, and you need different rules for different browsers.
For Webkit browsers (like Chrome), you need:
.GeolocationInput-input::-webkit-outer-spin-button,
.GeolocationInput-input::-webkit-inner-spin-button {
-webkit-appearance: none;
margin: 0;
}
For Firefox, you need:
.GeolocationInput-input {
-moz-appearance: textfield;
}
All of these have been added to the following example:
.GeolocationInput {
max-width: 700px;
margin: 0 auto;
text-align: center;
-webkit-font-smoothing: antialiased;
}
.GeolocationInput .GeolocationInput-form {
width: 274px;
margin: 10px auto 0;
}
.GeolocationInput .GeolocationInput-input {
width: 274px;
}
.GeolocationInput-input {
box-sizing: border-box;
width: 90%;
border: 1px solid #aebcce;
border-radius: 100px;
padding: 15px 40px 10px 42px;
margin: 0 0 15px;
font-size: 16px;
font-family: proxima-nova,Helvetica Neue,Helvetica,Avenir,Lucida Grande,Arial,sans-serif;
font-weight: 300;
-moz-appearance: textfield;
}
.GeolocationInput-input:focus {
outline: none;
}
.GeolocationInput-input::-webkit-outer-spin-button,
.GeolocationInput-input::-webkit-inner-spin-button {
-webkit-appearance: none;
margin: 0;
}
.GeolocationInput-input::-webkit-outer-spin-button,
.GeolocationInput-input::-webkit-inner-spin-button {
-webkit-appearance: none;
margin: 0;
}
.GeolocationInput-button {
background: #635bd4;
max-width: 275px;
width: 90%;
color: #fff;
cursor: pointer;
font-size: 16px;
padding: 16px 32px;
text-decoration: none;
white-space: nowrap;
border-radius: 100px;
border: none;
font-family: proxima-nova,Helvetica Neue,Helvetica,Avenir,Lucida Grande,Arial,sans-serif;
font-weight: 500;
text-align: center;
}
<div class="GeolocationInput os-animation" data-os-animation="zoomInUp" data-os-animation-delay="1.5s">
<div style="width: 100%;">
<form class="GeolocationInput-form ">
<div>
<input type="number" class="GeolocationInput-input" placeholder="Escribe tu Codigo Postal..." >
</div>
<div>
<button class="GeolocationInput-button" disabled="">Continuar</button>
</div>
</form>
</div>
</div>
Hope this helps! :)

Radio button background image

I have given bg image for radio button. It is working in chrome but not in mozilla.
Here is my code
<div class="fieldlist">
<label for="shipadd2">
<input type="radio" id="shipadd2" name="address" />
<div class="compacttext"> Lorem ipsum </div>
</label>
</div>
CSS is
.fieldlist input[type="radio"] {
float: right;
-webkit-appearance: none;
border: none;
width: 25px;
height: 25px;
background: url(images/radio.png) left center no-repeat;
background-size: 20px;
}
.fieldlist input[type="radio"]:checked {
background: url(images/radio_checked.png) left center no-repeat;
}
Write like this:
CSS:
input[type="radio"]{
display:none;
}
input[type="radio"] + label
{
background: #999;
height: 16px;
width: 16px;
display:inline-block;
padding: 0 0 0 0px;
}
input[type="radio"]:checked + label
{
background: #0080FF;
height: 16px;
width: 16px;
display:inline-block;
padding: 0 0 0 0px;
}
HTML
<input type="radio" id="shipadd2" name="address" />
<label for="shipadd2"></label>
Read this article for more http://css-tricks.com/the-checkbox-hack/
Do you want something like this http://jsfiddle.net/surendraVsingh/UmpdH/5/ (click on the bell icon)
CSS
label{
display:block;
background: url(https://dl.dropbox.com/u/19982181/fab/notify.png) no-repeat;
}
.fieldlist input[type="radio"] {
float: right;
border: none;
opacity:0;
width: 25px;
height: 25px;
display:block;
float:left;
border:1px solid #333;
background-size: 20px;
}
Jquery:
$("#shipadd2").click(function(){
if($(this).is(":checked")){
$(this).parent().css('background-position', '0 -29px');
}
else{
$(this).parent().css('background-position', '0 0');
}
});​
​
Try this it worked for me
-moz-appearance: none;
Thanks