I have an app made in cord. I only used it for android now I decided to test it for IOS and I noticed these CSS errors.
How do I fix these errors that appear only in the IOS app?
if it is useful, I will post my css files below.
Do you have to add a hack to css to be interpreted by IOS?
IMPUTS
.form-group {
background-color: white;
padding: 5px;
margin-bottom: 15px;
border-bottom: 1px solid #a7a7a7;
border-radius: 1px;
height: 47px;
}
.form-group label {
display: inline-block;
margin-bottom: 7px;
float: left;
font-size: 14px;
}
.form-group input[type=text],input[type=password],input[type=number],select,textarea {
width: 100%;
border: 0px;
font-weight: 600;
font-size: 17px;
background-color: white;
text-transform: uppercase;
outline: none;
}
.form-group input[type=date],input[type=datetime-local] {
width: 100%;
border: 0px;
font-weight: 600;
font-size: 17px;
background-color: white;
text-transform: uppercase;
outline: none;
}
*:focus {
outline: none;
}
checkbox.css
input[type=checkbox] {
position: relative;
cursor: pointer;
margin: 0 13px 10px 0;
}
input[type=checkbox]:before {
content: "";
display: block;
position: absolute;
width: 20px;
height: 20px;
top: 0;
left: 0;
background-color:#FFF;
border: solid 1px #CCC;
}
input[type=checkbox]:checked:before {
content: "";
display: block;
position: absolute;
width: 20px;
height: 20px;
top: 0;
left: 0;
background-color:#1E80EF;
}
input[type=checkbox]:checked:after {
content: "";
display: block;
width: 5px;
height: 10px;
border: solid white;
border-width: 0 2px 2px 0;
-webkit-transform: rotate(45deg);
-ms-transform: rotate(45deg);
transform: rotate(45deg);
position: absolute;
top: 3px;
left: 8px;
}
radio.css
.form-group-radio {
display: block;
position: relative;
padding-left: 35px;
margin-bottom: 12px;
cursor: pointer;
font-size: 22px;
-webkit-user-select: none;
-moz-user-select: none;
-ms-user-select: none;
user-select: none;
}
.form-group-radio span {
float: left;
}
/* Hide the browser's default radio button */
.form-group-radio input {
position: absolute;
opacity: 0;
cursor: pointer;
}
/* Create a custom radio button */
.form-group-radio .checkmark {
position: absolute;
top: 0;
left: 0;
height: 25px;
width: 25px;
background-color: #eee;
border-radius: 50%;
}
/* On mouse-over, add a grey background color */
.form-group-radio:hover input ~ .checkmark {
background-color: #ccc;
}
/* When the radio button is checked, add a blue background */
.form-group-radio input:checked ~ .checkmark {
background-color: #2196F3;
}
/* Create the indicator (the dot/circle - hidden when not checked) */
.form-group-radio .checkmark:after {
content: "";
position: absolute;
display: none;
}
/* Show the indicator (dot/circle) when checked */
.form-group-radio input:checked ~ .checkmark:after {
display: block;
}
/* Style the indicator (dot/circle) */
.form-group-radio .checkmark:after {
top: 9px;
left: 9px;
width: 8px;
height: 8px;
border-radius: 50%;
background: white;
}
I won't go through your code because it's too much of a guess. My advice to you is always develop using chrome, then test again in Safari. You will find that Safari does not support/respect everything that Chrome does, css wise.
For instance, iOS webview has a hard time with flex box or even sticky. Lots of patching for Safari needed. So your code might be legit but iOS webview won't support it fully.
You can also detect with cordova what platform you are running (device.platform) then you can add a .ios class to your body and patch via the .ios class
Related
I am currently trying to create a custom style-sheet overlaying the the default Bootstrap 4.3.1 theme and I'm having some difficulties with the checkboxes and radiobuttons.
I can't seem to figure out how to change the checkbox and radiobuttons color whenever they are checked. I wanna go from the default ones to these ones, whenever they are clicked.
I've tried to edit the _input-group.scss file so I can customize code:
.input-group-text {
display: flex;
align-items: center;
padding: $input-padding-y $input-padding-x;
margin-bottom: 0; // Allow use of <label> elements by overriding our default margin-bottom
#include font-size($input-font-size); // Match inputs
font-weight: $font-weight-normal;
line-height: $input-line-height;
color: $input-group-addon-color;
text-align: center;
white-space: nowrap;
background-color: $input-group-addon-bg;
border: $input-border-width solid $input-group-addon-border-color;
#include border-radius($input-border-radius);
// Nuke default margins from checkboxes and radios to vertically center within.
input[type="radio"],
input[type="checkbox"] {
margin-top: 0;
background-color: #e5f0f8;
color: #005db8; // checkmark color;
}
}
For the size I created a copy of Bootstrap's _forms.scss file and overwrote the values:
.form-check-input {
position: absolute;
margin-top: $form-check-input-margin-y;
margin-left: -$form-check-input-gutter;
width: 1.052rem; // changed default width
height: 1.052rem; //changed default height
&:disabled ~ .form-check-label {
color: $text-muted;
}
}
What am I doing wrong ? I'm open to suggestions, thank you in advance.
i also tried to overwright bootstrap check & radio but i think it's not possible. then i use custom scss. this may help you.
scss
/* Customize the label (the container) */
.custom-check {
display: block;
position: relative;
padding-left: 35px;
margin-bottom: 12px;
cursor: pointer;
font-size: 22px;
-webkit-user-select: none;
-moz-user-select: none;
-ms-user-select: none;
user-select: none;
/* Hide the browser's default checkbox */
input[type=checkbox] {
position: absolute;
opacity: 0;
cursor: pointer;
height: 0;
width: 0;
}
/* Create a custom checkbox */
.checkmark {
position: absolute;
top: 0;
left: 0;
height: 25px;
width: 25px;
background-color: #fff;
border: 1px solid #E1E6EB;
}
/* On mouse-over, add a grey background color */
&:hover input ~ .checkmark {
background-color: #ffffff;
}
/* When the checkbox is checked, add a blue background */
input:checked ~ .checkmark {
background-color: #ffffff;
border: 1px solid #E1E6EB;
display: flex;
justify-content: center;
align-items: center;
}
/* Create the checkmark/indicator (hidden when not checked) */
.checkmark:after {
content: url('data:image/svg+xml;charset=UTF-8, <svg width="14px" height="11px" viewBox="0 0 14 11" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink"> <g id="Page-1" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd"> <g id="latest-from-careems-1.0(messages)" transform="translate(-326.000000, -546.000000)" fill="#0B97B7" fill-rule="nonzero"> <g id="tick-inside-circle" transform="translate(326.000000, 546.000000)"> <polygon id="Shape" points="1.97807018 5.1245614 0.75 6.35263158 4.69736842 10.3 13.4692982 1.52807018 12.2412281 0.3 4.69736842 7.84385965"></polygon> </g> </g> </g> </svg>');
position: absolute;
display: none;
}
/* Show the checkmark when checked */
input:checked ~ .checkmark:after {
display: block;
}
}
//custom radio
.custom-radio {
display: block;
position: relative;
padding-left: 30px;
margin-bottom: 12px;
font-size: 18px;
font-family: cormorantlightitalic;
cursor: pointer;
-webkit-user-select: none;
-moz-user-select: none;
-ms-user-select: none;
user-select: none;
/* Hide the browser's default radio button */
input {
position: absolute;
opacity: 0;
cursor: pointer;
}
/* Create a custom radio button */
.checkmark {
position: absolute;
top: 5px;
left: 0;
height: 20px;
width: 20px;
background-color: #fff;
border: 1px solid #E1E6EB;
border-radius: 50%;
/* Create the indicator (the dot/circle - hidden when not checked) */
&:after {
content: "";
position: absolute;
display: none;
}
}
/* On mouse-over, add a grey background color */
&:hover input ~ .checkmark {
background-color: #fff;
border: 1px solid #0093B4;
}
/* When the radio button is checked, add a blue background */
input:checked ~ .checkmark {
background-color: #fff;
border: 1px solid #0093B4;
}
/* Show the indicator (dot/circle) when checked */
input:checked ~ .checkmark:after {
display: block;
}
/* Style the indicator (dot/circle) */
.checkmark:after {
top: 5px;
left: 5px;
width: 10px;
height: 10px;
border-radius: 50%;
background: #0093B4;
}
}
.custom-check {
display: block;
position: relative;
padding-left: 35px;
margin-bottom: 12px;
cursor: pointer;
font-size: 22px;
-webkit-user-select: none;
-moz-user-select: none;
-ms-user-select: none;
user-select: none
}
.custom-check input[type=checkbox] {
position: absolute;
opacity: 0;
cursor: pointer;
height: 0;
width: 0
}
.custom-check .checkmark {
position: absolute;
top: 0;
left: 0;
height: 25px;
width: 25px;
background-color: #fff;
border: 1px solid #e1e6eb
}
.custom-check:hover input~.checkmark {
background-color: #fff
}
.custom-check input:checked~.checkmark {
background-color: #fff;
border: 1px solid #e1e6eb;
display: flex;
justify-content: center;
align-items: center
}
.custom-check .checkmark:after {
content: url('data:image/svg+xml;charset=utf-8,<svg width="14" height="11" xmlns="http://www.w3.org/2000/svg"><path d="M1.978 5.125L.75 6.353 4.697 10.3l8.772-8.772L12.241.3 4.697 7.844z" fill="%230B97B7" fill-rule="nonzero"/></svg>');
position: absolute;
display: none
}
.custom-check input:checked~.checkmark:after {
display: block
}
.custom-radio {
display: block;
position: relative;
padding-left: 30px;
margin-bottom: 12px;
font-size: 18px;
font-family: cormorantlightitalic;
cursor: pointer;
-webkit-user-select: none;
-moz-user-select: none;
-ms-user-select: none;
user-select: none
}
.custom-radio input {
position: absolute;
opacity: 0;
cursor: pointer
}
.custom-radio .checkmark {
position: absolute;
top: 5px;
left: 0;
height: 20px;
width: 20px;
background-color: #fff;
border: 1px solid #e1e6eb;
border-radius: 50%
}
.custom-radio .checkmark:after {
content: "";
position: absolute;
display: none
}
.custom-radio:hover input~.checkmark,
.custom-radio input:checked~.checkmark {
background-color: #fff;
border: 1px solid #0093b4
}
.custom-radio input:checked~.checkmark:after {
display: block
}
.custom-radio .checkmark:after {
top: 5px;
left: 5px;
width: 10px;
height: 10px;
border-radius: 50%;
background: #0093b4
}
<label class="custom-check">
<input type="checkbox" checked="checked">
<span class="checkmark"></span>
</label>
<br><br>
<div class="form-check form-check-inline">
<label class="custom-radio">Call
<input class="form-check-input" type="radio" name="contact_type" id="exampleRadios1" value="Call" checked>
<span class="checkmark"></span>
</label>
</div>
<div class="form-check form-check-inline">
<label class="custom-radio">Email
<input class="form-check-input" type="radio" name="contact_type" id="exampleRadios2" value="Email">
<span class="checkmark"></span>
</label>
</div>
As far as I know, overwriting browser default checkbox and the radio button is not possible, for achieving what you seek you should apply display: none; to the default radio and checkbox buttons and make custom ones by yourself.
For this purpose, you can check the following guides:
Styling Checkboxes and Radio Buttons
w3schools
EDIT: here is a simple but not very lean and tidy example below:
/* hide the regular checkbox */
.pd-checkbox input {
opacity: 0;
position: absolute;
}
/* position the label */
.pd-checkbox input,
.pd-checkbox label {
display: inline-block;
vertical-align: middle;
margin: 5px;
cursor: pointer;
-moz-user-select: none;
-webkit-user-select: none;
-ms-user-select: none;
user-select: none;
}
.pd-checkbox label {
position: relative;
}
/* style the unchecked checkbox */
.pd-checkbox input+label:before {
content: '';
background: #fff;
border: 2px solid #ddd;
display: inline-block;
vertical-align: middle;
width: 15px;
height: 15px;
padding: 5px;
margin-right: 10px;
text-align: center;
font-size: 17px;
line-height: 15px;
}
/* style the checked checkbox */
.pd-checkbox input:checked+label:before {
content: "\f00c";
font-family: 'FontAwesome';
background: #e9f0fb;
color: #035fb7;
border-color: #9cb1c4;
}
/* hide the regular radio button */
.pd-radio input {
opacity: 0;
position: absolute;
}
/* position the label */
.pd-radio input,
.pd-radio label {
display: inline-block;
vertical-align: middle;
margin: 5px;
cursor: pointer;
outline: none;
-moz-user-select: none;
-webkit-user-select: none;
-ms-user-select: none;
user-select: none;
}
.pd-radio label {
position: relative;
}
/* style the unchecked radio button */
.pd-radio input+label:before {
content: '';
background: #fff;
border: 2px solid #ddd;
display: inline-block;
vertical-align: middle;
width: 15px;
height: 15px;
padding: 5px;
line-height: 15px;
margin-right: 10px;
text-align: center;
}
.pd-radio input+label:before {
border-radius: 50%;
}
/* style the selected radio button */
.pd-radio input:checked+label:before {
content: "\f111";
font-family: 'FontAwesome';
background: #e9f0fb;
color: #035fb7;
border-color: #035fb7;
}
<!-- Load the Font Awesome Library via CDN -->
<link href="//cdnjs.cloudflare.com/ajax/libs/font-awesome/3.2.1/css/font-awesome.min.css" media="all" rel="stylesheet" type="text/css">
<p class="form-field checkbox1 pd-checkbox required no-label">
<input id="checkbox1" name="checkbox1" onchange="" type="checkbox" value="">
<label class="inline" for="checkbox1">Checkbox</label>
</p>
<p class="form-field radio1 pd-radio required no-label ">
<span class="value">
<span class="" style="">
<input type="radio" name="radioButton" id="radioButton" value="" onchange="">
<label class="inline" for="radioButton">Radiobutton</label>
</span>
</span>
</p>
NOTE: I just used CSS above for more illustration and code snippets.
And here we got the SCSS codes:
$color_1: #035fb7;
$font_family_1: 'FontAwesome';
$border_color_1: #9cb1c4;
$border_color_2: #035fb7;
.pd-checkbox {
input {
opacity: 0;
position: absolute;
display: inline-block;
vertical-align: middle;
margin: 5px;
cursor: pointer;
-moz-user-select: none;
-webkit-user-select: none;
-ms-user-select: none;
user-select: none;
&:checked&+label {
&:before {
content: "\f00c";
font-family: $font_family_1;
background: #e9f0fb;
color: $color_1;
border-color: $border_color_1;
}
}
}
label {
display: inline-block;
vertical-align: middle;
margin: 5px;
cursor: pointer;
-moz-user-select: none;
-webkit-user-select: none;
-ms-user-select: none;
user-select: none;
position: relative;
}
input&+label {
&:before {
content: '';
background: #fff;
border: 2px solid #ddd;
display: inline-block;
vertical-align: middle;
width: 15px;
height: 15px;
padding: 5px;
margin-right: 10px;
text-align: center;
font-size: 17px;
line-height: 15px;
}
}
}
.pd-radio {
input {
opacity: 0;
position: absolute;
display: inline-block;
vertical-align: middle;
margin: 5px;
cursor: pointer;
outline: none;
-moz-user-select: none;
-webkit-user-select: none;
-ms-user-select: none;
user-select: none;
&:checked&+label {
&:before {
content: "\f111";
font-family: $font_family_1;
background: #e9f0fb;
color: $color_1;
border-color: $border_color_2;
}
}
}
label {
display: inline-block;
vertical-align: middle;
margin: 5px;
cursor: pointer;
outline: none;
-moz-user-select: none;
-webkit-user-select: none;
-ms-user-select: none;
user-select: none;
position: relative;
}
input&+label {
&:before {
content: '';
background: #fff;
border: 2px solid #ddd;
display: inline-block;
vertical-align: middle;
width: 15px;
height: 15px;
padding: 5px;
line-height: 15px;
margin-right: 10px;
text-align: center;
border-radius: 50%;
}
}
}
I am trying to stylize the input type number. In this way: https://ant.design/components/input-number/ (first input). But without using the ant design framework. Where there are inner-spin, outer-spin I am trying add white background, gray lines and change the inner-spin color, outer-spin. Change the background color I can, but I can not spinns any more. I can not see them.
I can use the bootstrap-react framework, but I do not see such a number input
Code here: https://stackblitz.com/edit/react-cojnud
input[type=number] {
line-height: 27px;
box-sizing: border-box;
font-variant: tabular-nums;
line-height: 1.5;
list-style: none;
-webkit-font-feature-settings: 'tnum';
font-feature-settings: 'tnum';
position: relative;
width: 100%;
height: 32px;
padding: 4px 11px;
color: rgba(0,0,0,0.65);
font-size: 14px;
line-height: 32px;
background-image: none;
-webkit-transition: all .3s;
transition: all .3s;
display: inline-block;
width: 90px;
margin: 0;
padding: 0;
border: 1px solid #d9d9d9;
border-radius: 4px;
}
input[type=number].mod::-webkit-inner-spin-button {
width: 30px;
height: 30px;
position: relative;
display: block;
overflow: hidden;
color: rgba(0,0,0,0.45);
font-weight: bold;
line-height: 0;
text-align: center;
-webkit-transition: all .1s linear;
transition: all .1s linear;
background-color: #fff;
}
input[type=number]::-webkit-inner-spin-button:hover {
color: blue;
}
input[type=number]:hover {
border-color: #40a9ff;
border-right-width: 1px !important;
}
input[type="number"].mod::-webkit-inner-spin-button {
-webkit-appearance: none;
background-color: white;
color: black;
}
Hy there,
try to remove -webkit-appearance: none;
And you will see the spinners again!
You won't be able to modify it across browsers. Better to use it following manner:
input::-webkit-outer-spin-button,
input::-webkit-inner-spin-button {
/* display: none; <- Crashes Chrome on hover */
-webkit-appearance: none;
margin: 0; /* <-- Apparently some margin are still there even though it's hidden */
}
input[type=number] {
-moz-appearance:textfield; /* Firefox */
}
.number-wrapper {
position: relative;
width: 300px;
height: 30px;
}
.number-wrapper input {
width: 100%;
height: 30px;
box-sizing: border-box;
padding-right: 18px;
text-align: right;
}
.number-wrapper .rocker {
position: absolute;
background: #FFF;
border: 1px solid lightblue;
right: 0;
padding: 2px 4px;
color: #ccc;
transition: all ease-in 100ms;
height: 50%;
box-sizing: border-box;
line-height: 12px;
cursor: pointer;
visibility: hidden;
}
.number-wrapper:hover .rocker {
visibility: visible;
transition: all ease-in 300ms;
}
.number-wrapper .rocker.up {
top: 0;
}
.number-wrapper .rocker.down {
bottom: 0;
transform: rotate(180deg);
border-bottom: none;
}
.number-wrapper .rocker:hover,
.number-wrapper .rocker:focus {
box-shadow: 0 0 4px lightblue;
}
.number-wrapper .rocker:active {
transform: scale(0.4);
}
.number-wrapper .rocker.down:active {
transform: rotate(180deg) scale(0.4);
}
<div class="number-wrapper"><span class="rocker up">^</span><span class="rocker down">^</span><input class="mod" type="text" /></div>
Try This
jQuery('<div class="quantity-nav"><div class="quantity-button quantity-up">⮙</div><div class="quantity-button quantity-down">⮛</div></div>').insertAfter('.quantity input');
jQuery('.quantity').each(function() {
var spinner = jQuery(this),
input = spinner.find('input[type="number"]'),
btnUp = spinner.find('.quantity-up'),
btnDown = spinner.find('.quantity-down'),
min = input.attr('min'),
max = input.attr('max');
btnUp.click(function() {
var oldValue = parseFloat(input.val());
if (oldValue >= max) {
var newVal = oldValue;
} else {
var newVal = oldValue + 1;
}
spinner.find("input").val(newVal);
spinner.find("input").trigger("change");
});
btnDown.click(function() {
var oldValue = parseFloat(input.val());
if (oldValue <= min) {
var newVal = oldValue;
} else {
var newVal = oldValue - 1;
}
spinner.find("input").val(newVal);
spinner.find("input").trigger("change");
});
});
.quantity {
position: relative;
}
input[type=number]::-webkit-inner-spin-button,
input[type=number]::-webkit-outer-spin-button
{
-webkit-appearance: none;
margin: 0;
}
input[type=number]
{
-moz-appearance: textfield;
border-radius: 5%;
}
.quantity input {
width: 45px;
height: 35px;
line-height: 1.65;
float: left;
display: block;
padding: 0;
margin: 0;
padding-left: 20px;
border: 1px solid #eee;
}
.quantity input:focus {
outline: 0;
}
.quantity-nav {
float: left;
position: relative;
height: 40px;
}
.quantity-button {
position: relative;
cursor: pointer;
border-left: 1px solid #eee;
width: 20px;
text-align: center;
color: #333;
font-size: 13px;
font-family: "Trebuchet MS", Helvetica, sans-serif !important;
line-height: 1.7;
-webkit-transform: translateX(-100%);
transform: translateX(-100%);
-webkit-user-select: none;
-moz-user-select: none;
-ms-user-select: none;
-o-user-select: none;
user-select: none;
}
.quantity-button.quantity-up {
position: absolute;
height: 46%;
top: 0;
margin-top: 0px;
border-bottom: 1px solid #eee;
}
.quantity-button.quantity-down {
position: absolute;
bottom: 4px;
height: 46%;
}
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script>
<div class="quantity">
<input type="number" min="1" step="1" value="1">
</div>
See Code Link
I have my progresbar written in css and line between first and second circle hovers a little the number "2". The lines beetwen circles are pseudelements.
This is the styles i used:
/* progressbar */
.progressbar {
width: 100%;
counter-reset: step;
margin-top: 7px;
padding: 0;
}
.progressbar li {
list-style-type: none;
float: left;
width: 100px;
position: relative;
text-align: center;
font-family: sans-serif;
font-size: 15px;
font-weight: normal;
color: #546A79;
/* Steps*/
}
.progressbar li:before {
content: counter(step);
counter-increment: step;
width: 44px;
height: 44px;
line-height: 44px;
/* border: 4px solid #fff; */
display: block;
text-align: center;
margin: 0 auto 13px auto;
border-radius: 50%;
background-color: #E3E3E3;
/* Circles*/
}
.progressbar li:after {
content: '';
position: absolute;
width: 100%;
height: 4px;
background-color: #E3E3E3;
/*lines */
top: 20px;
left: -50%;
z-index: 0;
}
.progressbar li:first-child:after {
content: none;
}
.progressbar li.active {
color: #546A79;
}
.progressbar li.active:before {
width: 48px;
height: 48px;
line-height: 48px;
border-radius: 50%;
border-color: #0073CF;
color: black;
background-color: #ffda47;
margin: 0 auto 9px auto;
}
.progressbar li.active + li.active:after {
background-color: #ffda47;
}
Here's jsfiddle of the problem:
http://jsfiddle.net/1aeur58f/523/
.progressbar li {
list-style-type: none;
float: left;
width: 100px;
position: relative;
text-align: center;
font-family: sans-serif;
font-size: 15px;
font-weight: normal;
color: #546A79;
z-index:1;
}
.progressbar li:after {
content: '';
position: absolute;
width: 100%;
height: 4px;
background-color: #E3E3E3;
/*lines */
top: 20px;
left: -50%;
/*z-index: 0;*/
z-index: -1;
}
for ".progressbar li:after" now its z-index:-1; make this z-index:-1;
and z-index:1; for ".progressbar li" your ul item.
I'm creating a mobile nav and I have drop down menu on the charactors tab, with a back button on top made of simply a list item with text. With the back button though width 100% doesn't seem to be working I have check the dev tools and its seems like its should be working, I need it to be acting like the rest of the list items and its seem be be acting like its an inline element why?
the back a button only appears on widths 400px or less
https://jsfiddle.net/6e62ge46/11/
header nav{
position: fixed;
bottom: 0;
width: 100%;
z-index: 1;
// background-color: rgba(255,165,0,.8);
}
nav ul {
list-style: none;
padding: 0;
}
.main-nav{
margin: 0;
width: 100%;
color: white;
font-family: arial;
font-weight: 600;
}
nav ul li{
text-align: center;
border: 1px solid white;
border-radius: 15px;
font-size: 1.2rem;
background-color:rgba(255,165,0,.8);
width: 100%;
}
.drop-menu-back{
display: none;
width: 100%;
}
a{
text-decoration: none;
}
nav a:visited, nav a,h1{
color: white;
}
.main-nav .current-page {
background-color: rgba(0,0,0,.5);
}
/****drop down menu****/
.characters:hover {
position: relative;
border-radius: 8px 8px 0 0;
}
.drop-menu{
position: absolute;
visibility: hidden;
display: block;
top: 38px;
white-space: nowrap;
left: -2px;
background-color: rgba(255,165,0,.8);
border: 1px solid rgba(0,0,0,.02);
box-shadow: 5px 5px 5px 2px rgba(0,0,0,.3);
opacity: 0;
transition: opacity 300ms ease-in-out 0s;
z-index: 1;
}
.characters:hover .drop-menu{
visibility: visible;
opacity:1;
}
#media screen and (max-width: 400px) {
.drop-menu{
top:-50px;
width: 100%;
}
.drop-menu-back{
display: initial;
width: 100%;
}
}
I am trying to get the the menu on the right side of the search bar to breakout of the parent.
Code: http://jsbin.com/xecolubodi/edit?html,css,js,output
I believe a modified to the following css styles is required:
.mapsearch-menu ul {
display: none;
position: relative;
top: -55px;
padding: 55px 0 0 0;
margin: 0;
user-select: none;
}
.mapsearch-menu ul:hover {
display: block;
}
.mapsearch-menu li {
background: white;
padding: 4px;
list-style: none;
border: 1px solid rgba(0, 0, 0, 0.298039);
margin-top: -1px;
}
.mapsearch-menu input[type=checkbox],
input[type=radio] {
vertical-align: middle;
position: relative;
bottom: 1px;
}
.mapsearch-menu li:hover {
background: #eee;
cursor: pointer;
}
.mapsearch-menu .button {
display: inline-block;
user-select: none;
cursor: pointer;
height: 16px;
width: 16px;
background-image: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAJ0lEQVQ4y2NgGDbgJBD/JxGfQDbgOBkGHB1mYXBi6IfBmdEwIB8AAEQSURX+8q0jAAAAAElFTkSuQmCC");
}
.mapsearch-menu {
display: inline-block;
position: absolute;
top: 0;
right: 0;
margin-top: 12px;
padding-right: 5px;
}
Before click:
After click:
I want the hamburger menu icon to stay stationary and have the dropdown menu either breakout of the parent divs bounds or have the list items right justified.
I have been working on this for an hour and I am not getting anywhere. I tried various things (floating, etc).
ps: I prefer to have the search icon, the search text, and the hamburger all left-floated instead of the hack I am currently doing with padding with the search. If that is easier to fix that first then please attempt (I also been trying to fix that)
I updated your css below, It will probably work for you.
.mapsearch-menu ul {
display: none;
position: absolute; /* Add this you can change it as per you need */
top: -34px; /* Add this */
right:0px; /* Add this you can change it as per you need */
min-width:170px; /* Add this */
padding: 55px 0 0 0;
margin: 0;
user-select: none;
}
.mapsearch-menu .button {
display: inline-block;
user-select: none;
cursor: pointer;
position:relative; /* Add this */
height: 16px;
width: 16px;
background-image: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAJ0lEQVQ4y2NgGDbgJBD/JxGfQDbgOBkGHB1mYXBi6IfBmdEwIB8AAEQSURX+8q0jAAAAAElFTkSuQmCC");
}
.mapsearch-menu li {
background: white;
padding: 4px;
list-style: none;
border: 1px solid rgba(0, 0, 0, 0.298039);
margin-top: -1px;
display:inline-block; /* Add this */
}