CSS difference on mac and windows - html

I have some CSS applied to a few divs. It looks all good on windows, but it behaves differently on Mac on the event of mouse over.
The behavior can be seen here. If you could manage opening it on Mac and on Windows you will notice the difference.
I would appreciate if some can tell me how can i make it behave similar as it behaves on windows. Again, i want it to behave as it behaves on Windows.
I will show my code here as well.
The html
<div class="goal" >
<div class="top-layer" >
<div class="component">
<select class="component-select">
<option value="">select me </option>
<option value="">option one</option>
<option value="">option two</option>
<option value="">option three</option>
</select>
<span id="width_tmp"></span>
</div>
<div class="period" >
<select class="period-select">
<option value="">something</option>
</select>
<span id="width_tmp"></span>
</div>
<div class="close clickable" >X</div>
</div>
and the CSS,
.noselect, .clickable {
-webkit-touch-callout: none;
-webkit-user-select: none;
-khtml-user-select: none;
-moz-user-select: none;
-ms-user-select: none;
user-select: none;
}
.clickable {
cursor: pointer;
/*border: 1px solid transparent;*/
}
.clickable:hover {
/*border: 1px solid #4D7994;*/
background: #3f6379;
}
[contenteditable="true"].single-line {
white-space: nowrap;
overflow: hidden;
display: inline-block;
margin-bottom: -7px;
height: 12px;
max-width: 60px;
}
[contenteditable="true"].single-line br {
display:none;
}
[contenteditable="true"].single-line * {
display:inline;
white-space:nowrap;
}
.goal {
position: relative;
background: #5A8EAE;
width: 364px;
height: auto;
color: #F4F7F9;
float: left;
margin-right: 14px;
margin-bottom: 14px;
font-family: Arial, "Helvetica Neue", Helvetica, sans-serif;
}
.goal span[contenteditable=true] {
padding: 5px;
border: 1px solid #5A8EAE;
padding-left: 2px;
}
.goal span[contenteditable=true]:focus {
background-color: white;
color: black;
border: 1px solid #5A8EAE;
min-width: 10px;
}
.top-layer{
width: 100%;
height: 33px;
float: left;
font-size: 12px;
font-weight: bold;;
}
.component{
float: left;
width: 63%;
padding: 2.5% 3% 3% 2%;
}
.period{
float: left;
padding-top: 10px;
}
.close{
float: right;
padding: 2.8%;
border-left: 1px solid #9FBDCF;
}
select.period-select {
border: 0 !important; /*Removes border*/
-webkit-appearance: none; /*Removes default chrome and safari style*/
-moz-appearance: none; /* Removes Default Firefox style*/
/*background: #0088cc url(img/select-arrow.png) no-repeat 90% center;*/
text-indent: 0.01px; /* Removes default arrow from firefox*/
text-overflow: ""; /*Removes default arrow from firefox*/ /*My custom style for fonts*/
border-radius: 2px;
background-color: #5A8EAE;
color: white;
font-weight: bold;
width:auto;
direction: ltr;
float: right;
font-size: 12px;
padding: 3px 0;
margin-top: -6px;
}
select.period-select:hover, select.component-select:hover {
-webkit-appearance: menulist;
background-color: #3f6379;
color: white;
}
select.component-select {
border: 0 !important; /*Removes border*/
-webkit-appearance: none; /*Removes default chrome and safari style*/
-moz-appearance: none; /* Removes Default Firefox style*/
/*background: #0088cc url(img/select-arrow.png) no-repeat 90% center;*/
text-indent: 0.01px; /* Removes default arrow from firefox*/
text-overflow: ""; /*Removes default arrow from firefox*/ /*My custom style for fonts*/
color: #FFF;
background-color: #5A8EAE;
font-size: 12px;
font-weight: bold;
width:240px ;
padding: 3px 0;
margin-top: -6px;
padding-left:0px;
margin-left:0px;
}
select:hover {
cursor: pointer;
/*background: #0088cc url(img/select-arrow.png) no-repeat 90% center;*/
}

Related

Focus on checkbox not consistent with checkbox border and outline

I have customized my checkbox css. I have given an outline and a border to my checkbox. When i focus or click on the checkbox, the border and outline are not consistent with it. I tried giving the same border and outline to focus pseudo class, but it is not working.
Below is my HTML and CSS that i am using for the checkbox.
HTML:
<label class="form__field__input__label"><input class="form__field__input__checkbox" type="checkbox" name="World languages" value="">World languages</label>
CSS:
.form__field__input__label {
flex: 0 0 25%;
margin: 30px 0;
display: flex;
font-family: 'NotoSans';
font-size: 18px;
line-height: 26px;
color: #4e4f4f;
.form__field__input__checkbox {
width: 25px;
height: 24px;
margin-right: 15px;
position: relative;
border: solid 1px #4e4f4f;
outline: solid 0.5px $labelColor;
appearance: none;
-webkit-appearance: none;
-moz-appearance: none;
-ms-appearance: none;
&:checked::before {
content: "";
position: absolute;
width: 15px;
height: 14px;
top: 4px;
right: 4px;
background-color: #4e4f4f;
transition: all 0.3s linear;
}
&:checked:focus {
outline: solid 0.5px $labelColor;
}
}
}
I think this code could help you -
.form__field__input__label {
flex: 0 0 25%;
margin: 30px 0;
display: flex;
font-family: 'NotoSans';
font-size: 18px;
line-height: 26px;
color: #4e4f4f;
}
.form__field__input__checkbox {
width: 25px;
height: 24px;
margin-right: 15px;
position: relative;
border: solid 1px #4e4f4f;
outline: solid 0.5px $labelColor;
appearance: none;
-webkit-appearance: none;
-moz-appearance: none;
-ms-appearance: none;
}
.form__field__input__checkbox:checked::before {
content: "";
position: absolute;
width: 15px;
height: 14px;
top: 4px;
right: 4px;
background-color: #4e4f4f;
transition: all 0.3s linear;
}
.form__field__input__checkbox:checked:focus {
outline: solid 0.5px $labelColor;
}
<label class="form__field__input__label"><input class="form__field__input__checkbox" type="checkbox" name="World languages" value="">World languages</label>

How can I add a button with 100% width and position:fixed

I tried a lot of solutions here at stackoverflow but nothing is working.
a.buttongc {
border-radius: 5px;
background: #f5b220;
color: #fff;
font-size: 17px;
height: 44px;
line-height: 42px;
color: #fff;
text-decoration: none;
text-align: center;
box-sizing: border-box;
-webkit-appearance: none;
-moz-appearance: none;
-ms-appearance: none;
appearance: none;
white-space: nowrap;
margin: 10px;
text-overflow: ellipsis;
font-family: inherit;
cursor: pointer;
width: 100%;
overflow: hidden;
display: block;
}
.gc-button-center {
position: fixed;
left: 0;
right: 0;
display: block;
width: 100%;
bottom: 50px;
z-index: 999999999;
}
<div class="gc-button-center">
test
</div>
I want to have a margin left and right but it is only working at the left side and the button goes over the scrollbar. any solution?
Nothing fancy needed. Just remove your width: 100% If display is block, and width is not supplied, the width will auto size to fit the parent.
a.buttongc{
border-radius: 5px;
background: #f5b220;
color: #fff;
font-size: 17px;
height: 44px;
line-height: 42px;
color: #fff;
text-decoration: none;
text-align: center;
box-sizing: border-box;
-webkit-appearance: none;
-moz-appearance: none;
-ms-appearance: none;
appearance: none;
white-space: nowrap;
margin:10px;
text-overflow: ellipsis;
font-family: inherit;
cursor: pointer;
overflow:hidden;
display: block;
}
.gc-button-center{
position:fixed;
left:0;
right:0;
display:block;
width: 100%;
bottom: 50px;
z-index:999999999;
}
<div class="gc-button-center">
test
</div>
Just change width: calc(100% - 20px); for subtract margin
a.buttongc{
border-radius: 5px;
background: #f5b220;
color: #fff;
font-size: 17px;
height: 44px;
line-height: 42px;
color: #fff;
text-decoration: none;
text-align: center;
box-sizing: border-box;
-webkit-appearance: none;
-moz-appearance: none;
-ms-appearance: none;
appearance: none;
white-space: nowrap;
margin:10px;
text-overflow: ellipsis;
font-family: inherit;
cursor: pointer;
width: 100%;
overflow:hidden;
display: block;
}
.gc-button-center{
position:fixed;
left:0;
right:0;
display:block;
width: calc(100% - 20px);
bottom: 50px;
z-index:999999999;
}
<div class="gc-button-center">
test
</div>

How to change option width

Hi guys i have a simple drop down box which i have styled my self but i have no idea how to change the option width. So it looks like this :
As you can tell the drop down is way smaller then the actual box so i was wondering how i can edit this size and get rid of the blue around the box and change its colour. I'm using boostrap 3
HTML:
<div class="styled-select">
<select>
<option>Here is the first option</option>
<option>The second option</option>
<option>The thrid option</option>
</select>
<span class="fa fa-sort-desc"></span>
</div>
CSS:
.styled-select {
border: 1px solid #e6e6e6;
border-radius: 2px;
box-sizing: border-box;
overflow: hidden;
position: relative;
line-height: 20px;
color: #555555;
padding-left: 22px;
font-size: 13px;
font-family: Montserrat-Regular;
}
.styled-select option {
width: 74%;
}
.styled-select, .styled-select select {
width: 74%;
display: inline-block;
}
select:focus {
outline: none;
}
.styled-select select {
height: 40px;
padding: 5px 0 5px 5px;
background: transparent;
border: none;
-webkit-appearance: none;
}
#-moz-document url-prefix() {
.styled-select select {
width: 110%;
}
}
.fa-sort-desc {
position: absolute;
top: 12px;
right: 12px;
font-size: 24px;
}
select::-ms-expand {
display: none;
}
_:-o-prefocus,
.selector {
.styled-select {
background: none;
}
}
Instead of styling a div containing your select object, you should style the select object itself, for instance:
.styled-select {
border: 1px solid #e6e6e6;
border-radius: 2px;
box-sizing: border-box;
overflow: hidden;
position: relative;
line-height: 20px;
color: #555;
padding-left: 22px;
font-size: 13px;
font-family: Montserrat-Regular;
}
.styled-select option {
width: 74%;
}
.styled-select, .styled-select select {
width: 74%;
display: inline-block;
}
select:focus {
outline: none;
}
.styled-select select {
height: 40px;
padding: 5px 0 5px 5px;
background: transparent;
border: none;
-webkit-appearance: none;
}
#-moz-document url-prefix() {
.styled-select select {
width: 110%;
}
}
.fa-sort-desc {
position: absolute;
top: 12px;
right: 12px;
font-size: 24px;
}
select::-ms-expand {
display: none;
}
_:-o-prefocus .styled-select, .selector .styled-select {
background: none;
}
<select class="styled-select">
<option>Here is the first option</option>
<option>The second option</option>
<option>The thrid option</option>
</select>

change the appearance of input type number

I tried this code but nothing happened. I need to change the arrows by an image also rotate but I could not.
<style>
input[type=number] {
height: 30px;
line-height: 30px;
font-size: 16px;
padding: 0 8px;
}
input[type=number]::-webkit-inner-spin-button {
-webkit-appearance: none;
cursor:pointer;
display:block;
width:8px;
color: #333;
text-align:center;
position:relative;
}
input[type=number]:hover::-webkit-inner-spin-button {
background: #eee url('http://i.stack.imgur.com/YYySO.png') no-repeat 50% 50%;
width: 14px;
height: 14px;
padding: 4px;
position: relative;
right: 4px;
border-radius: 28px;
}
</style>
<input type="number" value="0">
http://i.stack.imgur.com/YYySO.png
http://jsfiddle.net/josefelipe87/wf0w0dhw/
Different code for different browser in CSS
For mozila
input[type=number] {
-moz-appearance: textfield;
appearance: textfield;
margin: 0;
}
For Chrome
input[type=number]::-webkit-inner-spin-button,
input[type=number]::-webkit-outer-spin-button {
-webkit-appearance: none;
margin: 0;
}

Designing the Select tag font-style

I just want to ask if its possible that the text in select is in italic then once the user chose an option, the text will change to normal? What I've done is when the uses is in select, the text is in normal style but once it focus out, the text change in to italic style. What I want is italic first then when the users chose, the text will change to normal. Here's the link to my work. help. Thanks in advance.
http://jsfiddle.net/franscla/xcd0smxj/
`HTML
<div class='select'><select >
<option>- Select subject -</option>
<option >Purchase</option>
<option style='height:50px;'>Be Our Partner</option>
<option>Technical Problems</option>
<option>Others</option>
</select></div>
CSS
.select {
margin-top:10px;
background: none repeat scroll 0 0 #fff;
border: 1px solid #455d74;
box-sizing: border-box;
display: inline-block;
height: 40px;
position: relative;
vertical-align: top;
width: 400px;
font-family:Arial;
}
.select > select {
background: none repeat scroll 0 0 #fff;
border: 0 none;
color: #7b7b7b;
display: block;
font-size:14px;
height: 35px;
line-height: 17px;
margin: 0;
padding: 9px 6px 5px 9px;
width: 100%;
font-style:italic;
}
.select > select:focus {
-moz-outline-radius: 2px;
color: #000;
outline: 0px solid #3fb6f2;
outline-offset: 0;
font-style:normal;
}
.select:before, .select:after {
content: "";
pointer-events: none;
position: absolute;
}
.select:before {
background: inherit;
bottom: 0;
right: 0;
top: 0;
width: 29px;
}
.select:after {
-moz-border-bottom-colors: none;
-moz-border-left-colors: none;
-moz-border-right-colors: none;
-moz-border-top-colors: none;
border-color: transparent transparent;
background: url(http://www.8bitsports.net/wp-content/themes/morning/functions/wpzoom/assets/images/jquery.selectBox-arrow.gif) no-repeat 100% 100%;
border-right: 5px solid transparent;
border-style: solid;
border-width: 5px;
height: 15px;
right: 6px;
top: 6px;
width: 10px;
}
`
I have tried this is what you want:
$(".select").focusout(function() {
$('select').addClass('newclass');
});
.newclass {
font-style: normal !important;
color: black !important;
}
.select {
margin-top: 10px;
background: none repeat scroll 0 0 #fff;
border: 1px solid #455d74;
box-sizing: border-box;
display: inline-block;
height: 40px;
position: relative;
vertical-align: top;
width: 400px;
font-family: Arial;
}
.select > select {
background: none repeat scroll 0 0 #fff;
border: 0 none;
color: #7b7b7b;
display: block;
font-size: 14px;
height: 35px;
line-height: 17px;
margin: 0;
padding: 9px 6px 5px 9px;
width: 100%;
font-style: italic;
}
.select > select:focus {
-moz-outline-radius: 2px;
color: #000;
outline: 0px solid #3fb6f2;
outline-offset: 0;
font-style: normal;
}
.select:before,
.select:after {
content: "";
pointer-events: none;
position: absolute;
}
.select:before {
background: inherit;
bottom: 0;
right: 0;
top: 0;
width: 29px;
}
.select:after {
-moz-border-bottom-colors: none;
-moz-border-left-colors: none;
-moz-border-right-colors: none;
-moz-border-top-colors: none;
border-color: transparent transparent;
background: url(http://www.8bitsports.net/wp-content/themes/morning/functions/wpzoom/assets/images/jquery.selectBox-arrow.gif) no-repeat 100% 100%;
border-right: 5px solid transparent;
border-style: solid;
border-width: 5px;
height: 15px;
right: 6px;
top: 6px;
width: 10px;
}
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.7.2/jquery.min.js"></script>
<div class='select'>
<select>
<option>- Select subject -</option>
<option>Purchase</option>
<option style='height:50px;'>Be Our Partner</option>
<option>Technical Problems</option>
<option>Others</option>
</select>
</div>