You can find a screenshot of my problem here; While trying to style the range input I noticed that it has white corners. I can't seem to figure out why or how to remove them, I first thought it was an outline but setting outline to none did nothing. Here is a JSFiddle: http://jsfiddle.net/c1y0y7dj/
My CSS
input[type=range] {
-webkit-appearance: none;
width: 200px;
}
input[type=range]::-webkit-slider-runnable-track {
width: 200px;
height: 5px;
background: #565656;
border: none;
border-radius: 3px;
}
input[type=range]::-webkit-slider-thumb {
-webkit-appearance: none;
border: none;
height: 16px;
width: 16px;
border-radius: 50%;
background: #F06A00;
margin-top: -5px;
}
input[type=range]:focus {
outline: none;
}
input[type=range]::-moz-range-track {
width: 200px;
height: 5px;
background: #ddd;
border: none;
border-radius: 3px;
}
input[type=range]::-moz-range-thumb {
border: none;
height: 16px;
width: 16px;
border-radius: 50%;
background: #F06A00;
}
input[type=range]::-ms-track {
width: 200px;
height: 5px;
background: transparent;
border-color: transparent;
border-width: 6px 0;
color: transparent;
}
input[type=range]::-ms-fill-lower {
background: #373737;
border-radius: 10px;
}
input[type=range]::-ms-fill-upper {
background: #575757;
border-radius: 10px;
}
input[type=range]::-ms-thumb {
border: none;
height: 16px;
width: 16px;
border-radius: 50%;
background: #F06A00;
}
input[type=range]:focus::-ms-fill-lower {
background: #373737;
}
input[type=range]:focus::-ms-fill-upper {
background: #575757;
}
Try this css
input[type=range] {
-webkit-appearance: none;
width: 200px;
background-color: transparent;
}
Here is the solution
You should add to
input[type=range] {
-webkit-appearance: none;
width: 200px;
background: transparent;
}
The input tag by default has a white background set by chrome if you just added
background-color :#565656 ;
to your first input selector it should solve your issue
Related
I'm unable to get the hover background color timing to sync with :before. How can I fix this issue?
When you hover over the button, you will notice the transition of the background color is not in sync.
JSFIDDLE DEMO: https://jsfiddle.net/7c25wmuz/
.btn-primary {
background-color: #2c9ff5;
border-color: #2c9ff5;
text-transform: capitalize;
}
.btn.btn-primary:hover {
background-color: #45aff6;
border-color: #45aff6;
}
.btn-donate {
background-color: #053a86;
color: #fff;
margin-left: 15px;
padding-left: 40px;
padding-right: 30px;
padding-top: 2px;
text-transform: uppercase;
border-radius: 4px 0 0 4px;
height: 30px;
position: relative;
border: none;
}
.btn-donate:before {
content: '';
position: absolute;
top: 0;
left: 0;
border-top: 30px solid white;
border-right: 20px solid #053a86;
width: 0;
}
.btn-donate:hover::before {
border-right: 20px solid #45aff6;
}
Donate
Clip path is the solution you need for something like this.
.btn-primary {
background-color: #2c9ff5;
border-color: #2c9ff5;
text-transform: capitalize;
clip-path: polygon(20% 0, 100% 0, 100% 100%, 0% 100%);
}
.btn.btn-primary:hover {
background-color: #45aff6;
border-color: #45aff6;
}
.btn-donate {
background-color: #053a86;
color: #fff;
margin-left: 15px;
padding-left: 40px;
padding-right: 30px;
padding-top: 2px;
text-transform: uppercase;
border-radius: 4px 0 0 4px;
height: 30px;
position: relative;
border: none;
transition: .5s all ease;
}
Donate
You can just add a background transition to .btn-donate and border transition to .btn-donate:before like so:
(added padding bottom to see things)
body {
margin-top: 15px;
}
.btn-primary {
background-color: #2c9ff5;
border-color: #2c9ff5;
text-transform: capitalize;
}
.btn.btn-primary:hover {
background-color: #45aff6;
border-color: #45aff6;
}
.btn-donate {
background-color: #053a86;
color: #fff;
margin-left: 15px;
padding-left: 40px;
padding-right: 30px;
padding-top: 2px;
padding-bottom: 1rem;
text-transform: uppercase;
border-radius: 4px 0 0 4px;
height: 30px;
position: relative;
border: none;
transition: .3s ease background;
}
.btn-donate:before {
content: '';
position: absolute;
top: 0;
left: 0;
border-top: 30px solid white;
border-right: 20px solid #053a86;
width: 0;
transition: .3s ease border;
}
.btn-donate:hover::before {
border-right: 20px solid #45aff6;
}
Donate
It seems you runned into conflict with browser default styles. You can see default styles in your Developer tools (F12) you just need to enable it. Go to developer tools settings and check "Show browser styles".
This issue can be simply fixed by overriding default styles with your own.
body {
margin-top: 15px;
}
.btn {
transition: unset; /* override, this is all you need */
display: block;
height: 30px;
}
.btn-primary {
background-color: #2c9ff5;
border-color: #2c9ff5;
text-transform: capitalize;
}
.btn.btn-primary:hover {
background-color: #45aff6;
border-color: #45aff6;
}
.btn-donate {
background-color: #053a86;
color: #fff;
margin-left: 15px;
padding-left: 40px;
padding-right: 30px;
padding-top: 2px;
text-transform: uppercase;
border-radius: 4px 0 0 4px;
height: 30px;
position: relative;
border: none;
}
.btn-donate:before {
content: '';
position: absolute;
top: 0;
left: 0;
border-top: 30px solid white;
border-right: 20px solid #053a86;
width: 0;
}
.btn-donate:hover::before {
border-right: 20px solid #45aff6;
}
Donate
few days ago I've asked for help with styling input type range element. Everything works just fine except one thing. Slider thumb is not displaying correctly.
My goal is to display it like this.
But this is the closest to my goal I can do.
There are two problems with that slider thumb. As you can see it's cropped and not standing out like in my goal picture. I know that it is caused by overflow : hidden. But that overflow:hidden is there on purpose ,because that is the approach I've got as a advice on my last question. Next problem is with color and box-shadow of slider thumb. I've switched it to red so it's more visible when I tried to fix the first problem. But if I switch it back to white, and try to add box shadow to it to achieve that effect which is in goal picture ,it will overwrite old box-shadow,which is making that white 'selected' effect.
Does anybody encountered this type of problem or have another solution for this ? Thank you :)
body{
background:#ccc;
}
#media screen and (-webkit-min-device-pixel-ratio:0) {
input[type='range'] {
width: 100%;
-webkit-appearance: none;
background-color: #ee7b82;
border-radius: .3em;
position: relative;
}
input[type='range']::-webkit-slider-runnable-track {
height: .35em;
border: none;
border-radius: 3px;
color: white;
overflow: hidden;
}
input[type='range']::-webkit-slider-thumb {
-webkit-appearance: none;
cursor: ew-resize;
box-shadow: -100em 0 0 100em white;
-webkit-appearance: none;
border: none;
height: 1.1em;
width: 1.1em;
border-radius: 50%;
background:red;
/*
Box-shadow to slider thumb,when color is changed to white,so it'll be visible, but it rewrites old box-shadow ,which is making that selected effect.
background: white;
-webkit-box-shadow: 0px 0px 10px 0px rgba(0,0,0,0.75);
-moz-box-shadow: 0px 0px 10px 0px rgba(0,0,0,0.75);
box-shadow: 0px 0px 10px 0px rgba(0,0,0,0.75);
*/
margin-top: -.2em;
}
input[type=range]:focus {
outline: none;
}
}
/*MOZ*/
input[type="range"]::-moz-range-progress {
background-color: white;
}
input[type="range"]::-moz-range-track {
background-color: #ee7b82;
}
/*IE*/
input[type="range"]::-ms-fill-lower {
background-color: white;
}
input[type="range"]::-ms-fill-upper {
background-color: #ee7b82;
}
<div className="range">
<p className="heading">HEIGHT</p>
<input type="range"></input>
<p className="heading">WEIGHT</p>
<input type="range"></input>
</div>
change in the CSS
input[type='range'] {
width: 100%;
-webkit-appearance: none;
background-color: #ee7b82;
border-radius: .3em;
position: relative;
max-height: 2px;
}
Please try instead,
First problem change color of thumb
By using this for different browser.
::-webkit-slider-thumb //for WebKit/Blink
::-moz-range-thumb //for Firefox
::-ms-thumb //for IE
I added box-shadow as well
box-shadow: 0px 0px 3px 2px white;
body{
background:#ccc;
}
#media screen and (-webkit-min-device-pixel-ratio:0) {
input[type='range'] {
-webkit-appearance: none;
width: 100%;
background-color: #ccc !important;
border-radius: .3em;
position: relative;
height: 1.1em;
overflow: hidden;
}
input[type='range']::-webkit-slider-runnable-track {
-webkit-appearance: none;
height: .35em;
border: none;
border-radius: 3px;
color: white;
background:#fff;
}
input[type='range']::-moz-range-thumb{
-webkit-appearance: none;
cursor: ew-resize;
box-shadow: 0px 0px 3px 2px white;
-webkit-appearance: none;
border: none;
height: 1.1em;
width: 1.1em;
border-radius: 50%;
background:red;
margin-top: -.2em;
}
input[type='range']::-ms-thumb{
-webkit-appearance: none;
cursor: ew-resize;
box-shadow: 0px 0px 3px 2px white;
-webkit-appearance: none;
border: none;
height: 1.1em;
width: 1.1em;
border-radius: 50%;
background:red;
margin-top: -.2em;
}
input[type='range']::-webkit-slider-thumb {
-webkit-appearance: none;
cursor: ew-resize;
box-shadow: 0px 0px 3px 2px white;
border: none;
height: 1.1em;
width: 1.1em;
border-radius: 50%;
background:red;
margin-top: -.35em;
}
input[type=range]:focus {
outline: none;
}
}
/*MOZ*/
input[type="range"]::-moz-range-progress {
background-color: white;
}
input[type="range"]::-moz-range-track{
background-color: #ee7b82;
}
/*IE*/
input[type="range"]::-ms-fill-lower {
background-color: white;
}
input[type="range"]::-ms-fill-upper {
background-color: #ee7b82;
}
<div className="range">
<p className="heading">HEIGHT</p>
<input type="range"></input>
<p className="heading">WEIGHT</p>
<input type="range"></input>
</div>
I have created a form and set focus to none but I am still getting the green box to appear and stay around each form field when I am testing.
Here is the form: https://secureforms.nextens.nl/TEMPLATE
I have already tried using:
*:focus {
outline: none;
}
AND
input:focus,
select:focus,
textarea:focus,
button:focus {
outline: none;
}
But for some reason, this still isn't working. Below is the CSS that I am using to style the form.
input[type=text], select {
font-size:15px;
width: 85%;
margin: 8px 0;
padding-left: 10px;
padding-top: 10px;
padding-bottom: 10px;
display: inline-block;
border: 1px solid #ccc;
border-radius: 25px;
box-sizing: content-box;
}
.elq-form select
{
font-size:15px;
width: 85%;
margin: 8px 0;
padding-left: 10px;
padding-top: 10px;
padding-bottom: 10px;
display: inline-block;
border: 1px solid #ccc;
border-radius: 25px;
box-sizing: content-box;
}
.elq-form radio
{
font-size:15px;
width: 100%;
margin: 8px 0;
display: inline-block;
border: 1px solid #ccc;
border-radius: 25px;
box-sizing: content-box;
}
input[type=submit] {
width: 100%;
background-color: #337ab7;
color: white;
margin-top: 8px;
margin-bottom: 8px;
border: none;
border-radius: 0px;
cursor: pointer;
}
input[type=submit]:hover {
background-color: #337ab7;
}
input:focus,
select:focus,
textarea:focus,
button:focus {
outline: none;
}
I just want the green highlighting around the form fields not to show up.
add this in your css
.LV_invalid_field, input.LV_invalid_field:hover, input.LV_invalid_field:active, textarea.LV_invalid_field:hover, textarea.LV_invalid_field:active,
.LV_valid_field, input.LV_valid_field:hover, input.LV_valid_field:active, textarea.LV_valid_field:hover, textarea.LV_valid_field:active {
outline: 0;
}
You have this CSS in your template, you gotta remove it to get what you want
.LV_valid_field,
input.LV_valid_field:hover,
input.LV_valid_field:active,
textarea.LV_valid_field:hover,
textarea.LV_valid_field:active {
outline: 1px solid #00CC00;
}
.LV_invalid_field,
input.LV_invalid_field:hover,
input.LV_invalid_field:active,
textarea.LV_invalid_field:hover,
textarea.LV_invalid_field:active {
outline: 1px solid #CC0000;
}
According to Dev-Tools, it is line 7 of your CSS that is causing the issue:
.LV_valid_field, ...
I am designing a FM player using pure CSS (no javascript) and tested the layout in Chrome, Firefox, Internet Explorer (IE), and Edge browsers. Except Internet Explorer, the layout shows 99% accuracy as below.
The layout in IE is shown below,
Is it possible to get 100% layout accuracy in all cross-browsers (others like Opera, Safari, etc.)?
The HTML code is used is below,
<body>
<div id="player">
<audio id="musicPlayer" autoplay="autoplay">
<source src="hls.mp3"/>
</audio>
<span id="playPause" onclick="playPause()"><img src="images/play.png" id="playMusic"/></span>
<span id="time">00:00:00</span>
<span id="volumeIcon"><img src="images/volume.png" id="volume"/></span>
<input type="range" id="changeVolume" oninput="SetVolume(this.value)" onchange="SetVolume(this.value)" step="1" min="0" max="100" value="100"/>
</div>
</body>
and CSS code is below,
body {
width:100%;
margin:0 auto;
padding:0px;
font-family:helvetica;
}
#player {
width:400px;
margin:0 auto;
padding:5px;
box-sizing:border-box;
border-radius: 4px;
border: 1px outset darkgreen;
box-shadow: 5px 0 5px -5px black, -5px 0 5px -5px black;
background-image: linear-gradient(lightgreen, PaleGreen, lightgreen);
}
#time {
float:left;
height:20px;
line-height:20px;
margin-left:2px;
margin-right:5px;
margin-top:3px;
}
#playMusic, #pauseMusic {
float:left;
height:18px;
margin-left:2px;
margin-right:5px;
margin-top:3px;
cursor: default;
border-radius: 3px;
border: 1px solid limegreen;
background-image: linear-gradient(lightgreen, PaleGreen, lightgreen);
outline:none;
}
#playMusic:hover, #pauseMusic:hover {
background:#94d362;
border-radius: 3px;
border: 1px solid ForestGreen;
background-color:lightgreen;
background: hsl(100, 100%, 85%);
}
input[type=range] {
appearance: none;
-moz-appearance: none;
-webkit-appearance: none;
width: 120px;
height:18px;
line-height:18px;
margin-left:2px;
margin-right:5px;
margin-top:3px;
position: absolute;
background-color: transparent;
}
input[type=range]:focus {
outline: none;
}
input[type=range]::-webkit-slider-runnable-track {
width: 100%;
height: 3px;
cursor: pointer;
animate: 0.2s;
box-shadow: 0;
background: #228442;
border-radius: 3px;
border: 0;
}
input[type=range]::-webkit-slider-thumb {
box-shadow: 0;
border: 0;
height: 10px;
width: 10px;
border-radius: 10px;
background: darkgreen;
cursor: pointer;
-webkit-appearance: none;
margin-top: -4px;
}
input[type=range]:focus::-webkit-slider-runnable-track {
background: #228442;
}
input[type=range]::-moz-range-track {
width: 100%;
height: 3px;
cursor: pointer;
animate: 0.2s;
box-shadow: 0;
background: #228442;
border-radius: 3px;
border: 0;
}
input[type=range]::-moz-range-thumb {
box-shadow: 0;
border: 0;
height: 10px;
width: 10px;
border-radius: 10px;
background: darkgreen;
cursor: pointer;
-webkit-appearance: none;
margin-top: -4px;
}
input[type=range]::-ms-track {
width: 100%;
height: 3px;
cursor: pointer;
animate: 0.2s;
background: transparent;
border-color: transparent;
border-width: 3px 0;
color: transparent;
}
input[type=range]::-ms-fill-lower {
background: #228442;
border: 0;
border-radius: 3px;
box-shadow: 0;
}
input[type=range]::-ms-fill-upper {
background: #228442;
border: 0;
border-radius: 3px;
box-shadow: 0;
}
input[type=range]::-ms-thumb {
box-shadow: 0;
border: 0;
height: 10px;
width: 10px;
border-radius: 10px;
background: darkgreen;
cursor: pointer;
margin: 0;
}
input[type=range]:focus::-ms-fill-lower {
background: #228442;
}
input[type=range]:focus::-ms-fill-upper {
background: #228442;
}
#volume {
margin-left:134px;
width:20px;
}
The live test URL: https://biox.ml/fm
After some research, I finally found out that you should use the flex positioning (supported by IE11).
First, I edited the HTML design to use block elements (and to pack together the volume icon and range input to simplify the CSS styling).
I set a display:flex for div#player to enable flex positioning.
I put a flex-grow:1 to div#time to let it fill the remaining space.
I put to div#volume an align-items:center style to vertical align the range input and an align-content:flex-end to place the volume box to the right of the div#player.
Finally, I set the top and the bottom paddings of the range input to 0 for IE11, and the height to 100% otherwise IE crops the thumb.
Plus, some minor changes for the finishing and code cleaning.
body {
width: 100%;
margin: 0 auto;
padding: 0px;
font-family: helvetica;
}
/* Beginning of the edited part */
#player {
display: flex;
height: 28px;
width: 400px;
align-items: center;
margin: 0 auto;
padding: 0 5px 0 5px;
background-image: linear-gradient(lightgreen, PaleGreen, lightgreen);
border-radius: 4px;
border: 1px outset darkgreen;
box-sizing: border-box;
box-shadow: 5px 0 5px -5px black, -5px 0 5px -5px black;
}
div#playPause,
div#volume {
height: 18px;
}
div#playPause {
margin-right: 5px;
border: 1px solid limegreen;
border-radius: 3px;
outline: none;
}
div#volume {
display: flex;
align-items: center;
align-content: flex-end;
}
div#playPause img,
div#volume img {
height: 100%;
}
div#time {
flex-grow: 1;
}
div#volume input[type=range] {
width: 120px;
height:100%;
margin: 0;
padding: 0 0 0 5px;
/* 0 paddings is important here */
background-color: transparent;
}
div#volume input[type=range]:focus {
outline: none;
}
/* End of the edited part
Below untouched specific-browser styling the "skin" of the range input
"Untouched" except the prefix "div#volume"
*/
div#volume input[type=range] {
appearance: none;
-moz-appearance: none;
-webkit-appearance: none;
}
div#volume input[type=range]:focus {
outline: none;
}
div#volume input[type=range]::-webkit-slider-runnable-track {
width: 100%;
height: 3px;
cursor: pointer;
animate: 0.2s;
box-shadow: 0;
background: #228442;
border-radius: 3px;
border: 0;
}
div#volume input[type=range]::-webkit-slider-thumb {
box-shadow: 0;
border: 0;
height: 10px;
width: 10px;
border-radius: 10px;
background: darkgreen;
cursor: pointer;
-webkit-appearance: none;
margin-top: -4px;
}
div#volume input[type=range]:focus::-webkit-slider-runnable-track {
background: #228442;
}
div#volume input[type=range]::-moz-range-track {
width: 100%;
height: 3px;
cursor: pointer;
animate: 0.2s;
box-shadow: 0;
background: #228442;
border-radius: 3px;
border: 0;
}
div#volume input[type=range]::-moz-range-thumb {
box-shadow: 0;
border: 0;
height: 10px;
width: 10px;
border-radius: 10px;
background: darkgreen;
cursor: pointer;
-webkit-appearance: none;
margin-top: -4px;
}
div#volume input[type=range]::-ms-track {
width: 100%;
height: 3px;
cursor: pointer;
animate: 0.2s;
background: transparent;
border-color: transparent;
border-width: 3px 0;
color: transparent;
}
div#volume input[type=range]::-ms-fill-lower {
background: #228442;
border: 0;
border-radius: 3px;
box-shadow: 0;
}
div#volume input[type=range]::-ms-fill-upper {
background: #228442;
border: 0;
border-radius: 3px;
box-shadow: 0;
}
div#volume input[type=range]::-ms-thumb {
box-shadow: 0;
border: 0;
height: 10px;
width: 10px;
border-radius: 10px;
background: darkgreen;
cursor: pointer;
margin: 0;
}
div#volume input[type=range]:focus::-ms-fill-lower {
background: #228442;
}
div#volume input[type=range]:focus::-ms-fill-upper {
background: #228442;
}
<div id="player">
<audio id="musicPlayer" autoplay="autoplay">
<source src="hls.mp3"/>
</audio>
<div id="playPause" onclick="playPause()">
<img src="https://biox.ml/fm/images/play.png" id="playMusic" />
</div>
<div id="time">00:00:00</div>
<div id="volume">
<img src="https://biox.ml/fm/images/volume.png" id="playMusic" />
<input type="range" id="changeVolume" oninput="SetVolume(this.value)" onchange="SetVolume(this.value)" step="1" min="0" max="100" value="100" />
</div>
</div>
I think that changing the vertical align property in the CSS might help:
#changeVolume{
vertical-align: middle;
}
Update
You could try doing this:
#player{
display: table-cell;
vertical-align: middle;
}
#changeVolume{
display: inline-block;
}
I hope so that would work...
I have a div that has a background image but has 50% opacity.
Now I have a div that is child and I want what every the content it has to have 100% opacity. You can see in the snipplet headings and textbox and button has less opacity.
Can anyone help how to fix this thing? I tried to apply opacity 100% to child but it didn't work.
/* CSS to be fixed*/
#home_div
{
background-image: url("https://upload.wikimedia.org/wikipedia/commons/thumb/1/1e/Shoppers_on_Dundas%2C_near_Yonge.jpg/1200px-Shoppers_on_Dundas%2C_near_Yonge.jpg");
opacity: 0.5;
filter: alpha(opacity=50);
/*background-color: #0050A0;*/
background-color: lightgrey;
padding-top: 200px;
color: white;
padding-bottom: 200px;
height: 100%;
}
#home_div_content
{
opacity: 1.0;
filter: alpha(opacity=100);
text-align: center;
}
#header
{
height: 70px;
border-bottom: 4px solid lightgrey;
}
#header_content
{
margin-top: 10px;
margin-left: 80px;
}
.brandmark
{
margin-top: -20px;
}
.link_to a
{
color: #0050A0 !important;
}
.featured_div
{
display: none;
}
.featured_close_anchor, .featured_anchor_close
{
text-align: center;
}
#heading, #tag_line
{
top: -300px;
position:relative;
color: #0050A0;
}
#search
{
border-radius: 0 !important;
border-color: #0050A0 !important;
width: 60%;
height: 35px;
padding: 8px 15px;
color: #0050A0; /* change color of text to be typed inside search box */
font-size: 13px;
line-height: 20px;
background-color: transparent;
border: 1px solid #ccc;
-webkit-box-shadow: none;
box-shadow: none;
}
.btn-custom {
color: #FFFFFF;
background-color: #0050A0; /* change button color */
border-radius: 0!important; /* button border radius */
padding: 5px 11px; /* Button size change*/
margin-top: -3.5px;
border-top: 2px solid #0050A0;
border-bottom: 3px solid #0050A0;
margin-left: -3px;
}
.btn-custom:hover{
background-color:#9AC94B; /* change button color on hover */
border-radius: 0!important;
}
.left_categories
{
padding-top: 5px;
padding-bottom: 5px;
margin-bottom: 1px;
border-left: 4px solid #0050A0;
}
.left_categories:hover
{
border-top: 1px solid lightgrey;
border-bottom: 1px solid lightgrey;
border-left: 4px solid #E5002B;
}
.active_category
{
background-color: #0050A0;
color: white !important;
border-left: 4px solid #E5002B;
}
.search_section
{
margin-top: 30px;
}
a
{
text-decoration: none !important;
}
.flash_nav
{
height: 90px;
border: 0 !important;
background-color: #283442;
}
.gradient
{
background: -moz-linear-gradient(left, white 0%, white 45%, #12A8E0 85%, #0050A0 100%);
}
.flash_navbar a
{
color: black !important;
}
.search_form
{
width: 70%;
}
.nav_form
{
border-radius: 0;
margin-top: 27px;
}
#searchBar
{
border-color: #0050A0;
}
#searchButton
{
background-color: #0050A0;
color: white;
border: none;
}
<div id="home_div">
<div class="container" id="home_div_content">
<h1 id="heading">Find your product!</h1>
<h4 id="tag_line">Search what you are looking for.</h4>
<form method="GET" action="/product/search">
<input type="text" name="product" id="search" placeholder="Enter product name" class="searchTextBox" />
<button type="submit" id="quick-search" class="btn btn-custom"><span class="glyphicon glyphicon-search custom-glyph-color"></span></button>
</form>
<br />
view <i class="fa fa-chevron-down"></i> featuring
</div>
</div>
FIDDLE
An opacity rule will always affect child/descendant elements since they are part of the parent, and the rule says the parent should be 50% opacity.
To get round this, use a pseudo element and give that reduced opacity rather than the parent.
HTML
<div id='outer'>
<div id='inner'></div>
</div>
CSS
#outer { width: 200px; height: 200px; position: relative; padding: 2em; }
#outer::before { content: ''; position: absolute; left: 0; top: 0; width: 100%; height: 100%; background: red; opacity: .5; z-index: -1; }
#inner { width: 100%; height: 100%; background: blue; }
Fiddle.