I know I can set two box-shadows to the same element this way:
box-shadow: inset 0 2px 0px #dcffa6, 0 2px 5px #000;
I am assigning css properties to a class in different parts of the page, so I wonder if it is possible to accomplish the same, assigning box-shadow two times. Something like:
box-shadow: inset 0 2px 0px #dcffa6;
box-shadow:0 2px 5px #000;
This however doesn't work, the second box-shadow overrides the first one.
Thanks.
EDIT:
I also tried applying two classes to the same element, with no luck: http://jsfiddle.net/DQvyw/
EDIT 2:
Not a real solution, but I ended up doing this: http://jsfiddle.net/DQvyw/1/
Another way to do this making two divs and give each the correct styling.
.divoutside{
border-radius: 8px;
box-shadow: 0px 2px 4px #4D4D4D;
}
.divinside{
border: 1px solid #4D4D4D;
border-radius: 8px;
box-shadow:inset 0 0 2px #FFA500;
padding: 4px;
}
<div class="divoutside"><div class="divinside"></div></div>
Example:
http://jsbin.com/ujuqem/1/edit
Happy coding :)
You can't do this with two separate declarations -- in CSS, when you define two values for the same rule, the latter declaration overrides the former. However, with JavaScript, you can concatenate the second value instead of replacing the old one with it. Something like:
var el = document.getElementsByClassName("your_class_name");
var n = el.length;
for(var i = 0; i < n; i ++) {
var cur = el[i];
cur.style.boxShadow += ", 0 2px 5px #000000"; //notice the comma in the beginning
}
I am not sure this is what you want, but I hope that helped you in any manner!
Related
can you please give me the right CSS snippet to move these price tags from left to right? I am very insecure with this positioning and don’t want to produce crippled code so it would be great to get some help here.
https://prnt.sc/1x10vpj
I suppose it is thie, but not 100% sure:
position: absolute;
bottom: 12px;
left: 12px;
padding: 3px 11px;
margin: 0;
min-width: 0;
min-height: 0;
line-height: 20px;
border-radius: 50px;
background-color: #fff;
color: #111;
font-weight: 700;
font-size: 13px;
}```
Thanks and regards!
Seems a bit of an incomplete question. Would be good to see where the element s sit in relation to other elelements and also associated CSS.
But looks like it is as simple as changing left, to right in your CSS.
I'm trying to remove top, right and left borders for text input fields, using bootstrap 3. My selector is:
input[type="text"] {
border-top: 0;
border-right: 0;
border-left: 0;
}
It's still showing (in chrome) a slight thin line.
I'm not sure how to get that ghost line to disappear
You did remove the border from top left and right. That "ghost line" you see, it is the inset shadow. You can remove that as well
input[type="text"] {
border-top: 0;
border-right: 0;
border-left: 0;
-webkit-box-shadow: none;
box-shadow: none;
}
and if you want to remove that when a user "focuses" the field
input[type="text"]:focus {
-webkit-box-shadow: none;
box-shadow: none;
}
Write this in your css file.
input {
border: none;
}
If it is not working please share your html code.
If your form uses tags <fieldset>, try to remove their borders too:
fieldset {
border: 0;
}
I am working with GWT. i have a requirement where i need to show the button as below.Please help me how to achieve this?
Thanks!
You can use GWT Button class and style it the way you need. For example, if you're using UiBinder:
<g:Button ui:field="button" styleName="my-button">
<ui:msg key="myButtonMsg">Button</ui:msg>
</g:Button>
with your own css class like
.my-button {
background: green;
border: 1px solid green;
color: white;
-webkit-border-radius: 4px;
-moz-border-radius: 4px;
border-radius: 4px;
padding: 5px 15px 5px 15px;
font-weight: bold;
}
If you need the text to have white box around it then add <span> around button text and add color: black; and background-color: white; properties for the span.
I have a Telerik tree and drag & drop node move is in action. But then I applied a theme (bought from somewhere) to the overall design of my site, and now, the hint are gone.
When you drag a node, some horizontal hint lines appear, so that you can understand that if you release your node (drop it) where it would be dropped.
Try adding the following CSS to the page. It will force the styles upon the TreeView drop hint.
.rtDropAbove, .rtDropBelow {
border: 1px dotted black !important;
font-size: 3px !important;
height: 3px !important;
line-height: 3px !important;
margin-top: -1px !important;
}
.rtDropAbove {
border-bottom: 0 !important;
}
.rtDropBelow {
border-top: 0 !important;
}
Something's z-index property is messing up with Telerik's RadTree. It's all z-index stuff.
I'm having trouble to get the -webkit-tap-highlight-color property to apply to a div - I'm at a loss as to why it isn't. Copying all the styles that apply to it below. The desired outcome is a back button as shown here: http://building-iphone-apps.labs.oreilly.com/ch03.html#ch03_id35932102
.backButton {
font-weight: bold;
text-align: center;
line-height: 28px;
color: white;
text-shadow: rgba(0,0,0,0.6) 0px -1px 0px;
position: absolute;
top: 13px;
left: 6px;
font-size: 14px;
max-width: 50px;
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
border-width: 0 8px 0 14px;
-webkit-tap-highlight-color:rgba(0,0,0,0);
-webkit-border-image: url(/static/images/backButton.png) 0 8 0 14;
}
.backButton.clicked {
-webkit-border-image: url(/static/images/back_button_clicked.png) 0 8 0 14;
}
.toolbar{
background-color: #e1f7ff;
-webkit-box-sizing:border-box;
border-bottom:1px solid #559D75;
padding:10px;
height:53px;
background-image:-webkit-gradient(linear,left top,left bottom,from(#e1f7ff),to(#a1d2ed));
position:relative;
z-index: 70; }
Applied here:
<div class='toolbar'>
<div class='backButton'>Back</div>
</div>
Viewing it in iPhone simulator (OS 4 enabled) and Safari - same problem with both (tap highlight still shows up).
Thanks in advance.
Try adding:
-webkit-user-select: none;
This is embarrassing. The image I had been using from an example back button online had the background color in it - it wasn't a problem with the CSS property.
I'm almost embarrassed enough not to post this answer, but I'm willing to swallow my pride in hopes of helping others. Let this be a lesson: if you use example images from Google images, etc., be sure the copy you download looks as you expect it to.
I wish I could reclaim the hours I spent trying to debug this, but maybe this will help someone else gain them back.
Lesson learned... thoroughly.