I have a jsfiddle with a dropdown list using ul and li (jsfiddle). When trying to convert this to a select options drop down list I am not getting the same options([jsfiddle])2.
I'm guessing it has to do with the way I renamed some one the CSS (I just replaced li with option) but I'm not sure what is wrong with it. My current HTML and CSS are below and two jsfiddles are in the text up top.
HTML
<div class="dd wrapper-dropdown-3" tabindex="1">
<select id="Process" class="dropdown" name="Process" data-val-required="Required" dataval="true">
<option value="">--- Select One ---</option>
<option value="Extrusion">Extrusion</option>
<option value="Injection">Injection</option>
<option value="Secondary">Secondary</option>
<option value="Vinyl Dip Molding">Vinyl Dip Molding</option>
</select>
</div>
CSS
.wrapper-dropdown-3 {
/* Size and position */
position: relative;
width: 200px;
margin: 0 auto;
padding: 10px;
/* Styles */
background: #fff;
border-radius: 7px;
border: 1px solid rgba(0, 0, 0, 0.15);
box-shadow: 0 1px 1px rgba(50, 50, 50, 0.1);
cursor: pointer;
outline: none;
/* Font settings */
font-weight: bold;
color: #0000FF;
}
.wrapper-dropdown-3:after {
content:"";
width: 0;
height: 0;
position: absolute;
right: 15px;
top: 50%;
margin-top: -3px;
border-width: 6px 6px 0 6px;
border-style: solid;
border-color: #8aa8bd transparent;
}
.wrapper-dropdown-3 .dropdown {
/* Size & position */
position: absolute;
top: 100%;
left: 0;
right: 0;
/* Styles */
background: white;
border-radius: inherit;
border: 1px solid rgba(0, 0, 0, 0.17);
box-shadow: 0 0 5px rgba(0, 0, 0, 0.1);
font-weight: normal;
list-style: none;
/* Hiding */
opacity: 0;
pointer-events: none;
/*Gets rid of the padding where the bullets would be*/
padding-left:0;
}
.wrapper-dropdown-3 .dropdown option a {
display: block;
padding: 10px;
text-decoration: none;
color: #0000FF;
border-bottom: 1px solid #e6e8ea;
box-shadow: inset 0 1px 0 rgba(255, 255, 255, 1);
transition: all 0.3s ease-out;
}
.wrapper-dropdown-3 .dropdown option i {
float: right;
color: inherit;
}
.wrapper-dropdown-3 .dropdown option:first-of-type a {
border-radius: 7px 7px 0 0;
}
.wrapper-dropdown-3 .dropdown option:last-of-type a {
border-radius: 0 0 7px 7px;
border: none;
}
/* Hover state */
.wrapper-dropdown-3 .dropdown option:hover a {
background: #f3f8f8;
}
.wrapper-dropdown-3 .dropdown:after {
content:"";
width: 0;
height: 0;
position: absolute;
bottom: 100%;
right: 15px;
border-width: 0 6px 6px 6px;
border-style: solid;
border-color: #fff transparent;
}
.wrapper-dropdown-3 .dropdown:before {
content:"";
width: 0;
height: 0;
position: absolute;
bottom: 100%;
right: 13px;
border-width: 0 8px 8px 8px;
border-style: solid;
border-color: rgba(0, 0, 0, 0.1) transparent;
}
.wrapper-dropdown-3.active .dropdown {
opacity: 1;
pointer-events: auto;
}
You need to do a couple of things to fix your problem. All of these are inside your .wrapper-dropdown-3 .dropdown styling. First, remove pointer-events: none as #ramesh mentioned. Then change your top: 100%; to top: 0;. Add width: 100%;. Change opacity: 0; to opacity: 1; so that you can see it. Remove your border, selects already have a border. And lastly, add the following to remove the default dropdown arrow from Firefox:
-moz-appearance: none;
text-indent: 0.01px;
text-overflow: '';
Here is an updated JSFiddle.
pointer-events: none; was causing the issue. Replace the following class with the css provided:
.wrapper-dropdown-3 .dropdown {
position: absolute;
width: 100%;
top: 0;
left: 0;
right: 0;
background: white;
border-radius: inherit;
border: 1px solid rgba(0, 0, 0, 0.17);
box-shadow: 0 0 5px rgba(0, 0, 0, 0.1);
font-weight: normal;
list-style: none;
opacity: 0;
padding-left: 0;
}
Not sure why you had a pointer-event there, because it kind of doesn't allow you to interact with the element.
Related
.wrapper-dropdown-3 {
width: 200px;
margin: 0 auto;
padding: 10px;
background: #fff;
border-radius: 7px;
border: 1px solid rgba(0, 0, 0, 0.15);
box-shadow: 0 1px 1px rgba(50, 50, 50, 0.1);
cursor: pointer;
font-weight: bold;
color: #8AA8BD;
}
.wrapper-dropdown-3:after {
content: "";
width: 0;
height: 0;
margin-top: -3px;
border-width: 6px 6px 0 6px;
border-style: solid;
border-color: #8aa8bd transparent;
}
<div id="dd" class="wrapper-dropdown-3" tabindex="1">
<span>Transport</span>
</div>
In the above code I want to insert the blue arrow to the middle right of the .wrapper-dropdown-3. As of now it is situated on the top right near the Transport span. I am not sure how I can move it to the very right middle? Any suggestions?
You can use absolute positioning against container:
.wrapper-dropdown-3 {
width: 200px;
margin: 0 auto;
padding: 10px;
background: #fff;
border-radius: 7px;
border: 1px solid rgba(0, 0, 0, 0.15);
box-shadow: 0 1px 1px rgba(50, 50, 50, 0.1);
cursor: pointer;
font-weight: bold;
color: #8AA8BD;
position: relative;
}
.wrapper-dropdown-3:after {
content: "";
width: 0;
height: 0;
margin-top: -3px;
border-width: 6px 6px 0 6px;
border-style: solid;
border-color: #8aa8bd transparent;
position: absolute;
right: 5px;
top: calc(50% + 6px / 2); /* 6px here is border-width value to compensate a fact that arrow is made from border */
-webkit-transform: translateY(-50%);
transform: translateY(-50%);
}
<div id="dd" class="wrapper-dropdown-3" tabindex="1">
<span>Transport</span>
</div>
Simply use positionning like this :
.wrapper-dropdown-3 {
width: 200px;
margin: 0 auto;
padding: 10px;
background: #fff;
border-radius: 7px;
border: 1px solid rgba(0, 0, 0, 0.15);
box-shadow: 0 1px 1px rgba(50, 50, 50, 0.1);
cursor: pointer;
font-weight: bold;
color: #8AA8BD;
/*Code added*/
position:relative;
/**/
}
.wrapper-dropdown-3:after {
/*Code added*/
position:absolute;
right:5px;
top:50%;
/**/
content: "";
width: 0;
height: 0;
margin-top: -3px;
border-width: 6px 6px 0 6px;
border-style: solid;
border-color: #8aa8bd transparent;
}
<div id="dd" class="wrapper-dropdown-3" tabindex="1">
<span>Transport</span>
</div>
This is what I want to achieve:
I'm looking to "cut" the lower left corner of the content in the code below
(similar to if you had folded the corner of a page down)
I'd like to know if there is any adjustments I could do to the CSS below to achieve this.
.model-properties {
padding: 0.8em 3em;
position: absolute;
top: 0px;
right: 0px;
width: 20%;
min-width: 15%;
z-index: 2;
display: none;
color: #c6d2db;
font-size: 13px;
background: linear-gradient(180deg, #182229, #182229, #293741, #293741);
max-height: 700px;
overflow: auto;
box-shadow: 0 4px 8px 0 rgba(0, 0, 0, 0.2), 0 6px 20px 0 rgba(0, 0, 0, 0.19);
}
<div id="model-properties-container" class="model-properties">
.model-properties:before,
.model-properties:after
{
bottom: 0;
left: 0;
border: solid transparent;
content: " ";
height: 0;
width: 0;
position: absolute;
pointer-events: none;
}
.model-properties:after {
border-color: #88b7d5;
border-left-color: white;
border-bottom-color: white;
border-width: 30px;
}
https://jsfiddle.net/e46xvp3x/3/
This question already has answers here:
Speech bubble with arrow
(3 answers)
Closed 5 years ago.
I am making Div with top right arrow and having contents in that.
Just like in the
.arrow_box {
position: relative;
background: #FFF;
border: 2px solid #fff;
box-shadow: 0px 0px 5px #000;
}
.arrow_box:after, .arrow_box:before {
bottom: 100%;
left: 99%;
border: solid transparent;
content: " ";
height: 0;
width: 0;
position: absolute;
pointer-events: none;
}
.arrow_box:after {
border-color: rgba(136, 183, 213, 0);
border-bottom-color: #FFF;
border-width: 15px;
margin-left: -15px;
}
.arrow_box:before {
border-color: rgba(0, 0, 0, 0);
border-bottom-color: #FFF;
border-width: 21px;
margin-left: -21px;
}
<div class="arrow_box">DO You Really Want this Feature?</div>
Somehow i can't get my output.
Any Help Would Be Great?
Thank You
body {
padding: 3em;
font-family: sans-serif;
}
.arrow_box {
position: relative;
background-color: #fff;
box-shadow: 0px 0px 10px rgba(0, 0, 0, .5);
padding: 1em 2em;
color: #aaa;
}
.arrow_box::after,
.arrow_box::before {
content: "";
background-color: #fff;
position: absolute;
top: 0;
left: 100%;
height: 1em;
width: 1em;
box-shadow: 0 0 10px rgba(0, 0, 0, .5);
transform-origin: center center;
transform: translate(-2em, -.5em) rotate(45deg);
z-index: -1;
}
.arrow_box::before {
z-index: 1;
box-shadow: none;
}
<div class="arrow_box">DO You Really Want this Feature?</div>
I have some code that produces a Drop Down List using ul and li Here is the first jsfiddle. This is how I would like my drop downs to look. However when I try and convert them to a select and options drop down list I am receving the following format, current jsfiddle. All I did was replace the li in the first fiddle with option. Any ideas how to fix this or why it's doing this? It seems like it is ignoring everything I replaced
Current HTML
<select class="wrapper-dropdown-3 dropdown" name="Process" data-val-required="Required" dataval="true">
<option value="">--- Select One ---</option>
<option value="Extrusion">Extrusion</option>
<option value="Injection">Injection</option>
<option value="Secondary">Secondary</option>
<option value="Vinyl Dip Molding">Vinyl Dip Molding</option>
</select>
Current CSS
.wrapper-dropdown-3 {
/* Size and position */
position: relative;
width: 200px;
margin: 0 auto;
padding: 10px;
/* Styles */
background: #fff;
border-radius: 7px;
border: 1px solid rgba(0, 0, 0, 0.15);
box-shadow: 0 1px 1px rgba(50, 50, 50, 0.1);
cursor: pointer;
outline: none;
/* Font settings */
font-weight: bold;
color: #0000FF;
}
.wrapper-dropdown-3:after {
content:"";
width: 0;
height: 0;
position: absolute;
right: 15px;
top: 50%;
margin-top: -3px;
border-width: 6px 6px 0 6px;
border-style: solid;
border-color: #8aa8bd transparent;
}
.wrapper-dropdown-3 .dropdown {
/* Size & position */
position: absolute;
width: 100%;
height:100%;
top: 0;
left: 0;
right: 0;
/* Styles */
background: white;
border-radius: inherit;
border: 0px solid rgba(0, 0, 0, 0.17);
box-shadow: 0 0 5px rgba(0, 0, 0, 0.1);
font-weight: normal;
list-style: none;
/* Hiding */
opacity: 1;
/*Gets rid of the padding where the bullets would be*/
padding-left:0;
-moz-appearance: none;
-webkit-appearance:none;
text-indent: 0.01px;
text-overflow:'';
}
.wrapper-dropdown-3 .dropdown option a {
display: block;
padding: 10px;
text-decoration: none;
color: #0000FF;
border-bottom: 1px solid #e6e8ea;
box-shadow: inset 0 1px 0 rgba(255, 255, 255, 1);
transition: all 0.3s ease-out;
}
.wrapper-dropdown-3 .dropdown option i {
float: right;
color: inherit;
}
.wrapper-dropdown-3 .dropdown option:first-of-type a {
border-radius: 7px 7px 0 0;
}
.wrapper-dropdown-3 .dropdown option:last-of-type a {
border-radius: 0 0 7px 7px;
border: none;
}
/* Hover state */
.wrapper-dropdown-3 .dropdown option:hover a {
background: #f3f8f8;
}
.wrapper-dropdown-3 .dropdown:after {
content:"";
width: 0;
height: 0;
position: absolute;
bottom: 100%;
right: 15px;
border-width: 0 6px 6px 6px;
border-style: solid;
border-color: #fff transparent;
}
.wrapper-dropdown-3 .dropdown:before {
content:"";
width: 0;
height: 0;
position: absolute;
bottom: 100%;
right: 13px;
border-width: 0 8px 8px 8px;
border-style: solid;
border-color: rgba(0, 0, 0, 0.1) transparent;
}
.wrapper-dropdown-3.active .dropdown {
opacity: 1;
pointer-events: auto;
}
You have specified a class name = "wrapper-dropdown-3 drop down" however there is no part of your CSS that styles this class. Also, you should pay attention to your HTML DOM structure when styling in CSS. For example in the code:
<ul class="ul">
<li class="li"></li>
</ul>
You would have a CSS like:
.ul{/*CSS code*/}
and
.ul .li{/*CSS code*/}
and not
.li{/*CSS code*/}
since the li tag is within the ui tag
i have made a button with some effects. When i tested in browser it's working fine in only in mozilla. i am unable to find why is not working in -webkit- browser can anybody tell me why this code is not working check this fiddle http://jsfiddle.net/sarfarazdesigner/Qtw3x/
here is html code
<button name="feat-btn" id="feat-btn" class="push-button" type="submit">
<span>Submit</span>
</button>
here is css
.push-button {
background: none repeat scroll 0 0 transparent;
border: medium none;
color: #FFFFFF;
cursor: pointer;
display: inline-block;
font-size: 18px;
padding: 0;
text-align: center;
text-decoration: none;
text-shadow: 0 1px 0 rgba(0, 0, 0, 0.5);
}
.push-button span:after {
-moz-border-bottom-colors: none;
-moz-border-left-colors: none;
-moz-border-right-colors: none;
-moz-border-top-colors: none;
border-color: #357536 transparent -moz-use-text-color;
border-image: none;
border-left: 5px solid transparent;
border-right: 5px solid transparent;
border-style: solid solid none;
border-width: 5px 5px 0;
content: "";
display: block;
margin: 0 -1.7em;
overflow: hidden;
text-indent: -9999px;
}
.push-button span:before {
border-radius: 8px 8px 8px 8px;
box-shadow: 0 1px 3px rgba(0, 0, 0, 0.25);
content: ".";
display: block;
height: 55px;
left: 0;
position: absolute;
top: 0;
width: 100%;
z-index: -1;
}
.push-button span {
background-color: #4FB051;
border-bottom: 1px solid #6FBE70;
display: inline-block;
height: 49px;
line-height: 50px;
margin-bottom: 5px;
min-width: 110px;
padding: 0 1.7em;
position: relative;
}
.push-button:hover span{background-color:#52a853;}
first check it in mozilla then you understand how it will look or you can see the image below
this is looking in mozilla
and this is looking in webkit browser
Something weird is going on with your border-color in the .push-button span:after selector
border-color: #357536 transparent -moz-use-text-color;
Just change it to #357537
jsFiddle
border-color: #357536;
Works in both Chrome and Firefox for me with that change.
delete
transparent -moz-use-text-color
from the line
border-color: #357536 transparent -moz-use-text-color;
I dont see any changes, but works fine.
Result is:
border-color: #357536;