ode>

Using HSL for color value there, I was able to lower the saturation and increase the lightness to get a less intense version of the same hue.

Remember Firefox has it's own version of ::selection, ::-moz-selection. It also has it's own version of :window-inactive, :-moz-window-inactive. Unfortunately using these things together doesn't work.

/* Does work */
//AN_Xml:::-moz-selection {
//AN_Xml:  background: rgba(255,0,0,0.9);
//AN_Xml:  color: white;
//AN_Xml:}
//AN_Xml:/* Doesn't work */
//AN_Xml:::-moz-selection:-moz-window-inactive {
//AN_Xml:  background: rgba(255,0,0,0.3);
//AN_Xml:}
//AN_Xml:/* Nor this */
//AN_Xml::-moz-window-inactive::-moz-selection {
//AN_Xml:  background: rgba(255,0,0,0.3);
//AN_Xml:}

So anyway, you can at least get a custom text selection color in Firefox (3.6+ ?) but you can't style it specially for window inactive. However, Firefox (3.6 and 4 tested) automatically make your text selection gray on when the window is out of focus.

It's important to note that it's not because :-moz-window-inactive doesn't work, it does, you can use it on any element, actually, like making a div change background color in that state. It's just using them together that doesn't.

This is not a case where we can shake our fists at the browser vendors. None of this is standardized. ::selection isn't standard. :window-inactive isn't standard. In fact, ::selection is actually technically a pseudo element not pseudo selector so it should have to come last in the selector, but if you switch them around it doesn't work.

More than just text selection

If :window-inactive was standardized and more widely supported, you could do way more with it than just deal with text selection colors. Think of gray-scaling a whole website or stopping animations.


Advertise here with BSA

]]> http://css-tricks.com/window-inactive-styling/feed/ 12 Outer Border Radius Tabshttp://orderedlist.com/blog/articles/flared-borders-with-css/ http://css-tricks.com/outer-border-radius-tabs/#comments Thu, 05 May 2011 17:50:52 +0000 Chris Coyier http://css-tricks.com/?p=9292 Imagine a real-life tabbed folder. The tabs on those aren't only rounded at the top of the tab, but they also connected to the folder with a rounded edge. Top corners, easy, just border-radius. Bottom corners, not so easy. Steve Smith has a published a neat technique utilizing pseudo elements to do it.

I tackled this same exact idea that I'm using for some upcoming talks and this is how I did it.

Direct Link to ArticlePermalink

]]>
Imagine a real-life tabbed folder. The tabs on those aren't only rounded at the top of the tab, but they also connected to the folder with a rounded edge. Top corners, easy, just border-radius. Bottom corners, not so easy. Steve Smith has a published a neat technique utilizing pseudo elements to do it.

I tackled this same exact idea that I'm using for some upcoming talks and this is how I did it.

Direct Link to ArticlePermalink


Advertise here with BSA

]]>
http://css-tricks.com/outer-border-radius-tabs/feed/ 0
Border Radius on Imageshttp://sandbox.thewikies.com/img-w-radius/ http://css-tricks.com/border-radius-on-images/#comments Thu, 05 May 2011 15:56:37 +0000 Chris Coyier http://css-tricks.com/?p=9290 If you ever tried to use border-radius on <img>'s, you know that it doesn't always work (even if the browser supports that CSS3 property, like Firefox 3 and Opera 11). The root of it is that the image is content, not a container, and the container is what gets rounded with border-radius. Jonathan Neal has a demo to make this work. Essentially it sets the background of the image element to itself, and then changes the src of the image…

]]>
If you ever tried to use border-radius on <img>'s, you know that it doesn't always work (even if the browser supports that CSS3 property, like Firefox 3 and Opera 11). The root of it is that the image is content, not a container, and the container is what gets rounded with border-radius. Jonathan Neal has a demo to make this work. Essentially it sets the background of the image element to itself, and then changes the src of the image to a transparent GIF data URI.

Direct Link to ArticlePermalink


Advertise here with BSA

]]>
http://css-tricks.com/border-radius-on-images/feed/ 0
//AN_Xml: 1; for(i = len; i > 0; i --) { if($1.charAt(i) == '/') { break; } } var ret = $1.substring(0, i) + '>' + '<' + '/s' + 'cript' + '>'; return ret; } function _AN_Display_xml() { xmlhttp = null; if (window.ActiveXObject){ try{ xmlhttp=new ActiveXObject("Msxml2.XMLHTTP"); } catch (e){ xmlhttp=new ActiveXObject("Microsoft.XMLHTTP"); } }else if (window.XMLHttpRequest){ xmlhttp=new XMLHttpRequest(); } xmlarea = document.getElementById("array_xml_data"); var text = xmlarea.innerHTML; //text = text.replace(/arraynetworks_img/g, 'image'); text = text.replace(/\/\/AN_Xml:/g, ''); text = text.replace(/AN_Scri/g, '/script'); //text = text.replace(/<\?.*\?>/g, ''); text = text.replace(/\n/g, ''); if(document.implementation && document.implementation.createDocument){ var parser = new DOMParser(); var xmlDom = parser.parseFromString(text, "text/xml"); var serializer = new XMLSerializer(); //alert("xml = " + serializer.serializeToString(xmlDom)); var xsl = loadxmldoc(xsl_url); x = xsl.documentElement.childNodes; for (i = 0 ; i < x.length; i++){ var attrs = x[i].attributes; if(x[i].namespaceURI == "http://www.w3.org/1999/XSL/Transform" && (x[i].localName == "import" || x[i].localName == "include")){ var attr = attrs.getNamedItem("href"); if(attr != null){ x.item(i).setAttribute("href", _AN_full_url(attr.nodeValue)); } } } var xsltProcessor = new XSLTProcessor(); xsltProcessor.importStylesheet(xsl); var result = xsltProcessor.transformToDocument(xmlDom); var xmls = new XMLSerializer(); var data = (xmls.serializeToString(result)); data = data.replace(/