I am developing an application using Ionic 4 and I am using ion-select. I want to customize the select icon, but the style is not applied.
<ion-select interface="popover"
(ionChange)="onSelectionChanged()"
[(ngModel)]="item.Value">
<ion-select-option *ngFor="let option of options" [value]="option.Value">
{{ option.Title }}
</ion-select-option>
</ion-select>
This is the style written in the .scss file, but it is not applied. I've also checked the documentation, but I couldn't find a solution.
.select-icon .select-icon-inner {
margin-top: 0 !important;
border-right: 7px solid transparent !important;
border-left: 7px solid transparent !important;
border-top: 7px solid !important;
}
If you're talking about the little arrow on the right, it seems that it is not possible at least fot the moment, see
issue here
You can use a button and a modal though.
Related
I have a display problem with the box shadow property specifically on the iPhone 6 plus.
If I add the meta tag width=device-width, the following box shadow isn't displayed at all:
-webkit-box-shadow: 1px 1px 5px 5px #a8a8a8;
box-shadow: 1px 1px 5px 5px #a8a8a8;
If I don't use the meta tag, box shadows "magically" disappear if you zoom into the page. You can comprehend this here:
http://jsfiddle.net/b6aaq57z/3/
This seems to be a specific iPhone 6 plus bug. On older iPhone Versions running the same iOS Version (8.0.2), the box shadows are working properly.
Is there anyone with a solution?
You can add border-radius:1px to the div. It fixes the box-shadow issue in iphone 6+ and other retina devices
.box-shadow{
-webkit-box-shadow: 1px 1px 0.25em 0.25em #a8a8a8;
box-shadow: 1px 1px 0.25em 0.25em #a8a8a8;
border-radius:1px;}
Try using -webkit-apperance: none;
You can add this to your global reset to eliminate all issues with this. I use:
*, *:before, *:after {
-webkit-appearance: none;
}
I also have my box-sizing reset in there as well.
How could i add curved corner to a gwt-checkbox using css?
.gwt-CheckBox {
border-radius: 5px 5px 5px 5px;
}
This Doesn't works!!!!
i also tried this too. but no change.
.gwt-CheckBox > input {
border-radius: 5px 5px 5px 5px;
}
spell check - border-redius must be border-radius
Curved Corner for checkbox via CSS is possible only in firefox/chrome and not in IE8 browser.
Which browser are you testing on? Apart from IE for others try -moz-border-radius or -webkit-border-radius etc depending on your browser.
Refer the link for IE information- Support for "border-radius" in IE
I'm trying to style a select input on iOS. The first option or initial state should have smaller font-size but not the rest of the options.
I have the following html structure:
<select class="dropdown">
<option selected="" value="Navigation">Navigation</option>
<option value="some-link">Whatever</option>
<option value="some-link">Another option</option>
<option value="some-link">Why</option>
<option value="some-link">What</option>
</select>
My CSS for it looks like this:
select {
-webkit-appearance: none;
font-family: 'Custom-Font', sans-serif;
font-size:.5em
line-height:1.8em; // optical center
background-color: #ccc;
color: #333;
border: none;
padding: 6px 10px 4px 10px;
}
.dropdown {
background-image: url(img/assets.svg);
background-position: right 2px;
background-repeat: no-repeat;
width: 100%;
display:block;
margin-bottom:-1.5em;
option:not(:first-of-type) {
font-size:1.5em;
}
}
The <select> menu looks exactly like I want it to look. It says "Navigation" inside a light-gray box with a rather small font-size.
However when clicking/tapping the select on my iphone the native UI view of iOS shows all options also in a very small font-size.
How can I just make the selected option (or the box itself) use the custom formatting but not the options. I want my options to have a "normal" readable font-size.
Any ideas on that? I tried with option:not(:first-of-type) and increase the font-size but no effect!
Unfortunately, there isn't a way to do it. iOS Safari takes full control of styling select lists' internal contents. Here's a reference for verification: little link.
One way to achieve this this would be to simulate the dropdown/select menu using JavaScript.
It's not very preferable, but if you absolutely require to change the default styling, then I'm afraid it's the only way to go; here's a demo that should give you an idea on how to do the simulation: another little link.
Try this 100% worked for me
select {
-webkit-appearance: none;
-moz-appearance: none;
appearance: none;
}
For what it's worth - I had a transparent <select> dropdown with a border radius when closed. On iOS (I'm not sure about android, I didn't test it) the default grey box for the <select> would appear inside of my custom border which was unappealing and unwanted.
To get rid of the inner grey box I used the following CSS:
-webkit-appearance: none;
And further more - pertaining to this OP's topic. Bootstrap offers a convenient solution with great documentation to enable custom dropdowns with Javascript. Check it out here.
I want to do this
This is select drop down of form
My code is
HMTL
<select>
<option>Country</option>
<option>India</option>
<option>USA</option>
</select>
Css
select{
width:197px;
height:45px;
border:solid 1px #13669b;
box-shadow:0 5px 2px 0px rgba(0,0,0,0.06) inset;
background:rgba(256,256,256,0.7);
color:#13669b;
font-size:16px;
font-family: 'LatoBold';
padding:0 14px;
line-height:45px;
}
I want to this only pure css. How?
There is no way to create a dropdown box like that with pure css (yet).
You can create your own js/css dropdown plugin or use one of the many jQuery/css plugins already available.
I am not sure if there is EASY cross browser way to do it but if you with combination of CSS + jQuery, you can get it working in all browsers in use:
Reinventing a Drop Down with CSS and jQuery
See the tutorial on how to do it and modify the CSS for the look you want.
Screenshot:
This solution works with pure CSS but it's Chrome-related. See the following example:
select {
-webkit-appearance: button;
-webkit-border-radius: 2px;
-webkit-box-shadow: 0px 1px 3px rgba(0, 0, 0, 0.1);
-webkit-padding-end: 20px;
-webkit-padding-start: 2px;
-webkit-user-select: none;
background-image: url(../images/select-arrow.png),
-webkit-linear-gradient(#FAFAFA, #F4F4F4 40%, #E5E5E5);
background-position: center right;
background-repeat: no-repeat;
border: 1px solid #AAA;
color: #555;
font-size: inherit;
margin: 0;
overflow: hidden;
padding-top: 2px;
padding-bottom: 2px;
text-overflow: ellipsis;
white-space: nowrap;
}
Haven't tried to replace the -webkit prefix by a -moz one for it to be compatible with Firefox browsers, it might actually work as well, you should give it a go.
Dropdowns are implemented differently in different browsers, and styling is not widely supported. This has it's reasons. For one: consider the dropdowns on iPads/iPhones. They work radically different than desktop application dropdowns.
If you want a styled dropdown, you will have to build it yourself with lists and javascript. Or use one of numerous libraries available for this (which is further proof that no pure CSS solution is available).
This question already has answers here:
Closed 11 years ago.
Possible Duplicate:
HTML/CSS: How does Google create this drop shadow over their maps?
Using GWT and the Google Maps component, how do I best create the "panel shadow" effect as seen in the screenshot?
Try the box-shadow CSS property (make sure the browsers you are targeting supports it)
-webkit-box-shadow: inset 3px 3px 5px 5px #000000;
-moz-box-shadow: inset 3px 3px 5px 5px #000000;
box-shadow: inset 3px 3px 5px 5px #000000;
Use rgba color spec with opacity to get a "lighter" shadow.