Closed. This question needs details or clarity. It is not currently accepting answers.
Want to improve this question? Add details and clarify the problem by editing this post.
Closed 7 years ago.
Improve this question
How can i put glow effects on textfield using HTML5 and CSS3 when active like http://www.me.com
:focus { box-shadow: 0 0 10px red; } for a red glow. Essentially a glow is a drop shadow with a suitable color and no offset.
You'll find they use a combination of JavaScript with CSS3 to create this effect.
They will have an event handler that handles the onfocus state of the textbox and then use the CSS3 box-shadow style along with a Javascript fade effect,
The best (easiest) way to achieve this would be to combine jQuery with CSS3 properties, But can also be done in raw JS at the same time, If you need further explanation just leave a comment.
They use png image for div which is moved behind input field and hidden when there's no focus. Everything has fixed width and height so no imege resizing needed.
Didn't see any CSS3 or HTML5 there but to do it with CSS3 than with border-image it should be possible to achieve the same effect, something like:
border-image: url("border.png") 10;
Edit:
#Lea Verou has better solution. I added this effect to one of my sites yesterday like this
input:focus, textarea:focus,
input.ieFocusHack, textarea.ieFocusHack {
box-shadow: 0 0 10px rgb(0, 182, 255);
-moz-box-shadow: 0 0 10px rgb(0, 182, 255);
-webkit-box-shadow: 0 0 10px rgb(0, 182, 255);
behavior: url(PIE.htc);
}
input[type="submit"]:focus {
box-shadow: none;
-moz-box-shadow: none;
-webkit-box-shadow: none;
}
Some javascript (didn't write it myself) for IE as it doesn't support :focus
$(document).ready(function() {
if (jQuery.browser.msie === true) {
jQuery('input, textarea')
.bind('focus', function() {
$(this).addClass('ieFocusHack');
}).bind('blur', function() {
$(this).removeClass('ieFocusHack');
});
}
});
To add box-shadow support to IE used CSS3PIE. Works like a charm.
Related
Closed. This question is not reproducible or was caused by typos. It is not currently accepting answers.
This question was caused by a typo or a problem that can no longer be reproduced. While similar questions may be on-topic here, this one was resolved in a way less likely to help future readers.
Closed 5 years ago.
Improve this question
I have the following css code for drawing a circle on a page.
.full-circle {
background-color: rgba(204, 0, 102, 0);
border: 3px solid #333;
margin: auto;
height: 75px;
width: 75px;
-moz-border-radius:75px;
-webkit-border-radius: 75px;
}
It is called by:
<div class="full-circle">
Works fine in Firefox but when I run it in IE it appears as a square and i'm not sure why.
Marvin pointed it out in the comments, but it is the answer to your problem: you have not specified the normal border-radius. Furthermore, if you're looking to create a circle, you want 50%, not 75px. 75px may make your particular div a circle, but if you decide to make the width wider, it will render differently. Your CSS should look like this:
.full-circle {
background-color: rgba(204, 0, 102, 0);
border: 3px solid #333;
margin: auto;
height: 75px;
width: 75px;
border-radius:50%;
}
EDIT: As Rob pointed out, you probably don't even need the -moz and -webkit prefixes unless you are designing a website for a user-base you know uses older browsers. I removed them from the example.
As noted in the comments by Rob, most browsers have had no need for vendor prefixes since 2010, just add
border-radius: 75px;
IE8 did not support this property, IE9 supported it without the -ms- prefix.
But check out #Vector's answer, you should really be using % and not px
I want to take the hover effect on the word "Dropdown" on this template (the gray/black box that appears when you put the cursor on it) and put it on the nav menu of this other template (from the same site)
I'm a beginner, I tried a lot of things but I just can't achieve the same effect. I tried copying the #nav code from the first template .css and pasting it on the another template css but it just copies the text, font, color but the hover effect is not there.
Thank you in advance and sorry for the stupid-ish question
The dropdown effect on the first template is achieved using Javascript rather than pure CSS. You'll need to find the .js file in that template which is controlling it. I took a look at the source, which you can do by right clicking on the page and selecting View Source. The dropdowns are being controlled by a jQuery plugin called Dropotron.
https://github.com/n33/jquery.dropotron
If you add this to the new template you wish to use, you can achieve the same effect.
EDIT:
3 things are happening to create the hover effect on the word itself.
Background Color
Curved Corners
Inset White Border to make a slight 3D effect.
These are achieved with three CSS rules:
background
border-radius
box-shadow
The exact CSS is:
border-radius: 6px;
background: none repeat scroll 0% 0% rgba(0, 0, 0, 0.15);
box-shadow: 1px 1px 0px 0px rgba(0, 0, 0, 0.024) inset, 1px 1px 0px 0px rgba(255, 255, 255, 0.024);
The background-color on the new theme's header is white, so you don't need the shadow. You would just insert this into the CSS file:
#nav ul li a {
border-radius:6px;
}
#nav ul li a:hover {
background:rgba(0, 0, 0, 0.15);
}
You can change the color if you want of course.
This question already has answers here:
Scrollbar color change in Firefox
(9 answers)
Closed 8 years ago.
i want to change my scrollbar design using css. i use this css but it only apply on chrome,
<style>
::-webkit-scrollbar {
width: 12px;
}
::-webkit-scrollbar-track {
-webkit-box-shadow: inset 0 0 6px rgba(0,0,0,0.3);
border-radius: 10px;
}
::-webkit-scrollbar-thumb {
border-radius: 10px;
-webkit-box-shadow: inset 0 0 6px rgba(0,0,0,0.5);
}
</style>
tell me how can i change my scrollbar in firefox using css.
thanks in advance
If you want to change style of scrollbar cross-browser you have to use some (jQuery) plugin. I use this one http://areaaperta.com/nicescroll/demo.html it is cross-browser compatible and easy to implement.
Also great one is this http://jscrollpane.kelvinluck.com/#examples
And here you can find more http://www.jqueryrain.com/2012/07/jquery-scrollbar-plugin-examples/
If you want to change it in mozilla using CSS put -moz- intead of -webkit-, e.g:
-moz-scrollbar { width: 12px; }
-webkit- works for chrome and safari, -moz- for firefox, -o- for opera, and -ms- for IE.
It seems you have to put all 4 lines to make it work on every browser, e.g:
-webkit-scrollbar {width: 12px;}<br/>
-o-scrollbar {width: 12px;}<br/>
-moz-scrollbar {width: 12px;}<br/>
-ms-scrollbar {width: 12px;}<br/>
I'd like to develop a generalizable solution for creating etched lines. The goal is to be able to not have to manually pick closely related colors for every color scheme where I want etching. The issue seems that the color of the indented part in relation to the color of the background is somewhat critical for creating the 3 dimensional effect.
Below is an example in blue (the lines above the comment bubble/underneath the number "11"). I think I need to use box-shadow but not sure if this is the best way.
If box-shadow is what I should use, does anyone know how to set its CSS values such that would would work for say a gray line would also work for say a blue line?
You could use borders with semi-transparent black/white colors (using rgba) that will darken/lighten the underlying color.
Example at http://dabblet.com/gist/4182495
Adding pseudo elements with :after/:before gives you extra power in adding second level borders etc..
Here's the slightly simplified CSS for that comment indicator, which I found using the Chrome Web Developer tools:
.media-bar .count-badge {
padding: 0 7px;
background: #1C5380;
box-shadow: 0 1px 0 rgba(255, 255, 255, 0.1), inset 0 1px 1px rgba(0, 0, 0, 0.2);
border-radius: 12px;
}
If you visit the page and inspect the count-badge element, you'll be able to turn the box-shadow styles on and off, which will show how they create the inset effect.
I guess there are two borders together:
border-bottom: 1px solid #1C5380;
border-top: 1px solid rgba(255, 255, 255, 0.12);
I am not sure how to call this kind of feature but my question is, is there a way to set the color of the following effect:
Using just border doesn't make it.
Use the outline property:
input:focus { outline: 2px orange solid }
outline works in all modern browsers except for IE < 8.
The :focus pseudo-class works in all modern browsers except IE - you would have to use a JavaScript workaround for that as shown here.
However, you will not be able to duplicate the desired effect (which seems to be Chrome's default behaviour when focusing on a field?) entirely because outline doesn't have a radius property. Maybe #Sarfraz' suggestion is a suitable workaround for that.
You can use this css:
input:focus,textarea:focus,select:focus{
border:1px solid #fafafa;
-webkit-box-shadow:0 0 6px #007eff;
-moz-box-shadow:0 0 5px #007eff;
box-shadow:0 0 5px #007eff;
}
Check out the demo
off course you can change the color as you like.