<rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:trackback="http://madskills.com/public/xml/rss/module/trackback/" xmlns:wfw="http://wellformedweb.org/CommentAPI/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/"><channel><title>Advanced Basics</title><link>http://blogs.clearscreen.com/migs/category/166.aspx</link><description>a series of quick tips related to basic things that won't normally be used in the right way in fields like CSS, HTML, XML, DHTML, etc..</description><managingEditor>Miguel Jiménez</managingEditor><dc:language>en-US</dc:language><generator>.Text Version 0.95.2004.102</generator><item><dc:creator>Miguel Jiménez</dc:creator><title>Advanced HTML Basics: How to make a control non-focusable</title><link>http://blogs.clearscreen.com/migs/archive/2006/02/03/2749.aspx</link><pubDate>Fri, 03 Feb 2006 11:27:00 GMT</pubDate><guid>http://blogs.clearscreen.com/migs/archive/2006/02/03/2749.aspx</guid><wfw:comment>http://blogs.clearscreen.com/migs/comments/2749.aspx</wfw:comment><comments>http://blogs.clearscreen.com/migs/archive/2006/02/03/2749.aspx#Feedback</comments><slash:comments>42</slash:comments><wfw:commentRss>http://blogs.clearscreen.com/migs/comments/commentRss/2749.aspx</wfw:commentRss><trackback:ping>http://blogs.clearscreen.com/migs/services/trackbacks/2749.aspx</trackback:ping><description>&lt;p&gt;Have you ever though on how to make any HTML control non-focusable? Yes, thinking about how to not allow it to get focus when using the UI... I've digged a bit about it and found that there's no HTML attribute to provide this functionallity and I came with this idea that solved my problem.&lt;/p&gt;
&lt;p&gt;Browsers use the TabIndex property to determine which control is the next to get the focus. It's a zero-based count. So what if you put any negative number as the value for the TabIndex property??? Easy. It works. That control won't get focused while tabbing in your form. So this control is now non-focusable.&lt;/p&gt;
&lt;p&gt;Hope you find it useful.&lt;/p&gt;&lt;img src ="http://blogs.clearscreen.com/migs/aggbug/2749.aspx" width = "1" height = "1" /&gt;</description><body xmlns="http://www.w3.org/1999/xhtml"><p>Have you ever though on how to make any HTML control non-focusable? Yes, thinking about how to not allow it to get focus when using the UI... I've digged a bit about it and found that there's no HTML attribute to provide this functionallity and I came with this idea that solved my problem.</p>
<p>Browsers use the TabIndex property to determine which control is the next to get the focus. It's a zero-based count. So what if you put any negative number as the value for the TabIndex property??? Easy. It works. That control won't get focused while tabbing in your form. So this control is now non-focusable.</p>
<p>Hope you find it useful.</p><img src ="http://blogs.clearscreen.com/migs/aggbug/2749.aspx" width = "1" height = "1" /></body></item><item><dc:creator>Miguel Jiménez</dc:creator><title>Advanced CSS Basics: Discovering the real CSS cursor property</title><link>http://blogs.clearscreen.com/migs/archive/2005/02/05/960.aspx</link><pubDate>Sat, 05 Feb 2005 21:15:00 GMT</pubDate><guid>http://blogs.clearscreen.com/migs/archive/2005/02/05/960.aspx</guid><wfw:comment>http://blogs.clearscreen.com/migs/comments/960.aspx</wfw:comment><comments>http://blogs.clearscreen.com/migs/archive/2005/02/05/960.aspx#Feedback</comments><slash:comments>44</slash:comments><wfw:commentRss>http://blogs.clearscreen.com/migs/comments/commentRss/960.aspx</wfw:commentRss><trackback:ping>http://blogs.clearscreen.com/migs/services/trackbacks/960.aspx</trackback:ping><description>&lt;p&gt;I've been really surprised while testing a new site I recently created with Firefox 1.0... It seemed that Firefox was not recognizing the &lt;em&gt;hand&lt;/em&gt; value as a valid &lt;em&gt;cursor&lt;/em&gt;, but how could this be possible when IE was doing it right? Well, I researched a bit and found in the CSS2 specification that &lt;em&gt;hand&lt;/em&gt; is not a valid value for the &lt;em&gt;cursor&lt;/em&gt; property!! The right CSS2 property value is &lt;em&gt;pointer&lt;/em&gt;... Tested this new value with IE and Firefox and it worked right in both of them.&lt;/p&gt;
&lt;p&gt;So, the question now is "Why does IE support a non-standard &lt;em&gt;hand&lt;/em&gt; value for the &lt;em&gt;cursor&lt;/em&gt; CSS property?" I guess it has, maybe, something to do with &lt;em&gt;mind-compatibility&lt;/em&gt; with Microsoft developers that came from VB or similar languages. Don't know, but is annoying, I used to work with that &lt;em&gt;hand&lt;/em&gt; value, but I've changed my mind to the standard &lt;em&gt;pointer&lt;/em&gt; one.&lt;/p&gt;
&lt;p&gt;More info on CSS2 and property values @ &lt;a href="http://www.w3.org/TR/REC-CSS2/ui.html#propdef-cursor"&gt;http://www.w3.org/TR/REC-CSS2/ui.html#propdef-cursor&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;PD: the most irritating thing is that Visual Studio .NET CSS editor tells me &lt;em&gt;'pointer' is not a valid value for the 'cursor' property !!!&lt;/em&gt;&lt;/p&gt;&lt;img src ="http://blogs.clearscreen.com/migs/aggbug/960.aspx" width = "1" height = "1" /&gt;</description><body xmlns="http://www.w3.org/1999/xhtml"><p>I've been really surprised while testing a new site I recently created with Firefox 1.0... It seemed that Firefox was not recognizing the <em>hand</em> value as a valid <em>cursor</em>, but how could this be possible when IE was doing it right? Well, I researched a bit and found in the CSS2 specification that <em>hand</em> is not a valid value for the <em>cursor</em> property!! The right CSS2 property value is <em>pointer</em>... Tested this new value with IE and Firefox and it worked right in both of them.</p>
<p>So, the question now is "Why does IE support a non-standard <em>hand</em> value for the <em>cursor</em> CSS property?" I guess it has, maybe, something to do with <em>mind-compatibility</em> with Microsoft developers that came from VB or similar languages. Don't know, but is annoying, I used to work with that <em>hand</em> value, but I've changed my mind to the standard <em>pointer</em> one.</p>
<p>More info on CSS2 and property values @ <a href="http://www.w3.org/TR/REC-CSS2/ui.html#propdef-cursor">http://www.w3.org/TR/REC-CSS2/ui.html#propdef-cursor</a></p>
<p>PD: the most irritating thing is that Visual Studio .NET CSS editor tells me <em>'pointer' is not a valid value for the 'cursor' property !!!</em></p><img src ="http://blogs.clearscreen.com/migs/aggbug/960.aspx" width = "1" height = "1" /></body></item><item><dc:creator>Miguel Jiménez</dc:creator><title>Advanced CSS Basics: How to apply CSS Selectors to INPUT element based on the Type attribute</title><link>http://blogs.clearscreen.com/migs/archive/2004/12/23/676.aspx</link><pubDate>Thu, 23 Dec 2004 18:10:00 GMT</pubDate><guid>http://blogs.clearscreen.com/migs/archive/2004/12/23/676.aspx</guid><wfw:comment>http://blogs.clearscreen.com/migs/comments/676.aspx</wfw:comment><comments>http://blogs.clearscreen.com/migs/archive/2004/12/23/676.aspx#Feedback</comments><slash:comments>76</slash:comments><wfw:commentRss>http://blogs.clearscreen.com/migs/comments/commentRss/676.aspx</wfw:commentRss><trackback:ping>http://blogs.clearscreen.com/migs/services/trackbacks/676.aspx</trackback:ping><description>&lt;p&gt;Some days ago I though I was a successful person with CSS while talking with &lt;a href="http://blogs.msdn.com/rido"&gt;Rido&lt;/a&gt; about a new project we are developing now in our team, and regarding some "design" tasks I was assigned to. &lt;/p&gt;
&lt;p&gt;But today I had a really annoying issue related to CSS. I needed to apply different styles to an HTML button and an HTML textbox; of course this is really simple by creating a CSS Class and applying it to each input by using the class attribute included in each element. This is an obvious solution, but it's not the cleanest one because of the amount of time needed to add each class attribute to each HTML element and the bytes needed to do this (imagine one hundred input boxes without style and how much work will involve to apply styles to all of them)&lt;/p&gt;
&lt;p&gt;What I wanted was something as easy as a CSS selector applied to any other HTML tag, something like &lt;font face="Courier New" color="#0000ff" size="2"&gt;INPUT.Text {background-color:red;}&lt;/font&gt;&lt;font face="Times New Roman"&gt;, something clean, small and easy to apply. Obviously I tried that, but it didn't worked, so I googled until I found the solution.&lt;/font&gt;&lt;/p&gt;
&lt;p&gt;With Internet Explorer 5 or above (yes, we are attached to IE for this development, but that's not strange when working in a project in Microsoft) you can use CSS expressions in your CSS file. This expressions can be fully logical expressions, for example:&lt;/p&gt;
&lt;blockquote dir="ltr" style="MARGIN-RIGHT: 0px"&gt;
&lt;p&gt;1. To assign the width of a table to the half of the body width&lt;br /&gt;&lt;font face="Courier New" color="#0000ff" size="2"&gt;TABLE { width: expression(document.body.style.width / 2); }&lt;/font&gt;&lt;/p&gt;
&lt;p&gt;2. To give Input Buttons a Fore color and the rest of Inputs a distinct Fore color by using only one CSS selector&lt;br /&gt;&lt;font face="Courier New" color="#0000ff" size="2"&gt;INPUT { color: expression(this.type=="button"?'red':'black'); }&lt;/font&gt;&lt;/p&gt;&lt;/blockquote&gt;
&lt;p&gt;Of course, expressions can be nested, and this solved my issue with CSS. After this new bit of knowledge I can see big new uses and optimizations for CSS that before I just thought to be impossible. And it's also important to have Firefox in mind, so I also checked how to do this although this was much easier than for IE:&lt;/p&gt;
&lt;blockquote dir="ltr" style="MARGIN-RIGHT: 0px"&gt;
&lt;p&gt;1. You can apply a kind of selection language (similar to xpath) and achieve the same result as my second IE example by using the following CSS selector:&lt;br /&gt;&lt;font face="Courier New" color="#0000ff" size="2"&gt;INPUT { color: black; }&lt;br /&gt;INPUT[type="button"] { color: red; }&lt;/font&gt;&lt;/p&gt;&lt;/blockquote&gt;
&lt;p dir="ltr"&gt;Hope anyone finds this piece useful... It was quite hard for me to find a simple way to do it clean and non time-consumer with CSS.&lt;/p&gt;&lt;img src ="http://blogs.clearscreen.com/migs/aggbug/676.aspx" width = "1" height = "1" /&gt;</description><body xmlns="http://www.w3.org/1999/xhtml"><p>Some days ago I though I was a successful person with CSS while talking with <a href="http://blogs.msdn.com/rido">Rido</a> about a new project we are developing now in our team, and regarding some "design" tasks I was assigned to. </p>
<p>But today I had a really annoying issue related to CSS. I needed to apply different styles to an HTML button and an HTML textbox; of course this is really simple by creating a CSS Class and applying it to each input by using the class attribute included in each element. This is an obvious solution, but it's not the cleanest one because of the amount of time needed to add each class attribute to each HTML element and the bytes needed to do this (imagine one hundred input boxes without style and how much work will involve to apply styles to all of them)</p>
<p>What I wanted was something as easy as a CSS selector applied to any other HTML tag, something like <font face="Courier New" color="#0000ff" size="2">INPUT.Text {background-color:red;}</font><font face="Times New Roman">, something clean, small and easy to apply. Obviously I tried that, but it didn't worked, so I googled until I found the solution.</font></p>
<p>With Internet Explorer 5 or above (yes, we are attached to IE for this development, but that's not strange when working in a project in Microsoft) you can use CSS expressions in your CSS file. This expressions can be fully logical expressions, for example:</p>
<blockquote dir="ltr" style="MARGIN-RIGHT: 0px">
<p>1. To assign the width of a table to the half of the body width<br /><font face="Courier New" color="#0000ff" size="2">TABLE { width: expression(document.body.style.width / 2); }</font></p>
<p>2. To give Input Buttons a Fore color and the rest of Inputs a distinct Fore color by using only one CSS selector<br /><font face="Courier New" color="#0000ff" size="2">INPUT { color: expression(this.type=="button"?'red':'black'); }</font></p></blockquote>
<p>Of course, expressions can be nested, and this solved my issue with CSS. After this new bit of knowledge I can see big new uses and optimizations for CSS that before I just thought to be impossible. And it's also important to have Firefox in mind, so I also checked how to do this although this was much easier than for IE:</p>
<blockquote dir="ltr" style="MARGIN-RIGHT: 0px">
<p>1. You can apply a kind of selection language (similar to xpath) and achieve the same result as my second IE example by using the following CSS selector:<br /><font face="Courier New" color="#0000ff" size="2">INPUT { color: black; }<br />INPUT[type="button"] { color: red; }</font></p></blockquote>
<p dir="ltr">Hope anyone finds this piece useful... It was quite hard for me to find a simple way to do it clean and non time-consumer with CSS.</p><img src ="http://blogs.clearscreen.com/migs/aggbug/676.aspx" width = "1" height = "1" /></body></item></channel></rss>