<?xml version='1.0' encoding='UTF-8'?><?xml-stylesheet href="http://www.blogger.com/styles/atom.css" type="text/css"?><feed xmlns='http://www.w3.org/2005/Atom' xmlns:openSearch='http://a9.com/-/spec/opensearch/1.1/' xmlns:georss='http://www.georss.org/georss' xmlns:thr='http://purl.org/syndication/thread/1.0' xmlns:gd='http://schemas.google.com/g/2005' gd:etag='W/&quot;C0MFRX48eyp7ImA9WhdRE0s.&quot;'><id>tag:blogger.com,1999:blog-1781780735331941940</id><updated>2011-08-03T01:50:14.073-07:00</updated><title>Web Developer Diary</title><subtitle type='html'></subtitle><link rel='http://schemas.google.com/g/2005#feed' type='application/atom+xml' href='http://www.arunnambiar.com/feeds/posts/default'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1781780735331941940/posts/default?redirect=false&amp;v=2'/><link rel='alternate' type='text/html' href='http://www.arunnambiar.com/'/><link rel='hub' href='http://pubsubhubbub.appspot.com/'/><author><name>Arun Nambiar</name><uri>http://www.blogger.com/profile/16732190994577891585</uri><email>mailarunkk@gmail.com</email></author><generator version='7.00' uri='http://www.blogger.com'>Blogger</generator><openSearch:totalResults>6</openSearch:totalResults><openSearch:startIndex>1</openSearch:startIndex><openSearch:itemsPerPage>25</openSearch:itemsPerPage><entry gd:etag='W/&quot;CkIERX89fCp7ImA9Wx9TEEs.&quot;'><id>tag:blogger.com,1999:blog-1781780735331941940.post-6258366434689457997</id><published>2010-11-03T01:49:00.000-07:00</published><updated>2010-11-17T22:08:24.164-08:00</updated><app:edited xmlns:app='http://www.w3.org/2007/app'>2010-11-17T22:08:24.164-08:00</app:edited><category scheme='http://www.blogger.com/atom/ns#' term='CSS'/><title>Giving button like effect to &lt;a&gt; links</title><content type='html'>By default in HTML, &amp;lt;a&amp;gt; tag refers to an anchor tag which is used to create a link to another document using the href attribute or to create a bookmark inside a document by using the name attribute. Here is a nice way you can give button like pressing effect to any link. It can be done by the following way.&lt;br /&gt;
&lt;br /&gt;
&lt;div class="code"&gt;&lt;br /&gt;
&amp;lt;a href="http://www.w3c.org"&amp;gt;Go to W3C&amp;lt;/a&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;style&amp;gt;&lt;br /&gt;
a:active{&lt;br /&gt;
position:relative;&lt;br /&gt;
top:1px;&lt;br /&gt;
left:1px;&lt;br /&gt;
outline:0;&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/style&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;/div&gt;&lt;br /&gt;
So as you can see the a link is given a slightly moved its top and left when clicked. This gives it a pressing effect.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1781780735331941940-6258366434689457997?l=www.arunnambiar.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://www.arunnambiar.com/feeds/6258366434689457997/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.arunnambiar.com/2010/11/giving-button-like-effect-to-links.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1781780735331941940/posts/default/6258366434689457997?v=2'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1781780735331941940/posts/default/6258366434689457997?v=2'/><link rel='alternate' type='text/html' href='http://www.arunnambiar.com/2010/11/giving-button-like-effect-to-links.html' title='Giving button like effect to &amp;lt;a&amp;gt; links'/><author><name>Arun Nambiar</name><uri>http://www.blogger.com/profile/16732190994577891585</uri><email>mailarunkk@gmail.com</email></author><thr:total>0</thr:total></entry><entry gd:etag='W/&quot;CkIHRno8cCp7ImA9Wx9TEEs.&quot;'><id>tag:blogger.com,1999:blog-1781780735331941940.post-3068663993656209331</id><published>2010-10-25T03:44:00.000-07:00</published><updated>2010-11-17T22:08:57.478-08:00</updated><app:edited xmlns:app='http://www.w3.org/2007/app'>2010-11-17T22:08:57.478-08:00</app:edited><category scheme='http://www.blogger.com/atom/ns#' term='CSS'/><title>Float right without changing order</title><content type='html'>While working with float you might have noticed a specific case. When two or more elements are floated to the right side of a container, the order of display changes to the order in which it was written in HTML. To understand what am talking about just see this example.&lt;br /&gt;
&lt;br /&gt;
&lt;div class="code"&gt;&lt;br /&gt;
The HTML,&lt;br /&gt;
&lt;br /&gt;
&amp;lt;ul&amp;gt;&lt;br /&gt;
&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;lt;li&amp;gt;1&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;lt;li&amp;gt;2&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;lt;li&amp;gt;3&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;/ul&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Normally left floated,&lt;br /&gt;
&lt;br /&gt;
ul, li{&lt;br /&gt;
&amp;nbsp;&amp;nbsp; &amp;nbsp;border:1px solid #000;&lt;br /&gt;
}&lt;br /&gt;
ul{&lt;br /&gt;
&amp;nbsp;&amp;nbsp; &amp;nbsp;overflow:hidden;&lt;br /&gt;
&amp;nbsp;&amp;nbsp; &amp;nbsp;width:300px;&lt;br /&gt;
&amp;nbsp;&amp;nbsp; &amp;nbsp;padding:0;&lt;br /&gt;
&amp;nbsp;&amp;nbsp; &amp;nbsp;margin:0;&lt;br /&gt;
}&lt;br /&gt;
li{&lt;br /&gt;
&amp;nbsp;&amp;nbsp; &amp;nbsp;text-align:center;&lt;br /&gt;
&amp;nbsp;&amp;nbsp; &amp;nbsp;float:left;&lt;br /&gt;
&amp;nbsp;&amp;nbsp; &amp;nbsp;margin:20px 5px;&lt;br /&gt;
&amp;nbsp;&amp;nbsp; &amp;nbsp;padding:5px;&lt;br /&gt;
&amp;nbsp;&amp;nbsp; &amp;nbsp;width:25px;&lt;br /&gt;
&amp;nbsp;&amp;nbsp; &amp;nbsp;list-style:none;&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
&lt;/div&gt;&lt;br /&gt;
&lt;table align="center" cellpadding="0" cellspacing="0" class="tr-caption-container" style="margin-left: auto; margin-right: auto; text-align: center;"&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td style="text-align: center;"&gt;&lt;a href="http://4.bp.blogspot.com/__dBufINvtwM/TMVbGPzKQbI/AAAAAAAAFUg/XEl72Qrf-PY/s1600/floatLeft.jpg" imageanchor="1" style="margin-left: auto; margin-right: auto;"&gt;&lt;img border="0" src="http://4.bp.blogspot.com/__dBufINvtwM/TMVbGPzKQbI/AAAAAAAAFUg/XEl72Qrf-PY/s1600/floatLeft.jpg" /&gt;&lt;/a&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class="tr-caption" style="text-align: center;"&gt;Left floated elements&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;&lt;br /&gt;
&lt;div class="code"&gt;&lt;br /&gt;
Normally right floated,&lt;br /&gt;
&lt;br /&gt;
ul, li{&lt;br /&gt;
&amp;nbsp;&amp;nbsp; &amp;nbsp;border:1px solid #000;&lt;br /&gt;
}&lt;br /&gt;
ul{&lt;br /&gt;
&amp;nbsp;&amp;nbsp; &amp;nbsp;overflow:hidden;&lt;br /&gt;
&amp;nbsp;&amp;nbsp; &amp;nbsp;width:300px;&lt;br /&gt;
&amp;nbsp;&amp;nbsp; &amp;nbsp;padding:0;&lt;br /&gt;
}&lt;br /&gt;
li{&lt;br /&gt;
&amp;nbsp;&amp;nbsp; &amp;nbsp;text-align:center;&lt;br /&gt;
&amp;nbsp;&amp;nbsp; &amp;nbsp;float:right;&lt;br /&gt;
&amp;nbsp;&amp;nbsp; &amp;nbsp;margin:20px 5px;&lt;br /&gt;
&amp;nbsp;&amp;nbsp; &amp;nbsp;padding:5px;&lt;br /&gt;
&amp;nbsp;&amp;nbsp; &amp;nbsp;width:25px;&lt;br /&gt;
&amp;nbsp;&amp;nbsp; &amp;nbsp;list-style:none;&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
&lt;/div&gt;&lt;br /&gt;
&lt;table align="center" cellpadding="0" cellspacing="0" class="tr-caption-container" style="margin-left: auto; margin-right: auto; text-align: center;"&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td style="text-align: center;"&gt;&lt;a href="http://3.bp.blogspot.com/__dBufINvtwM/TMVb-6iJBSI/AAAAAAAAFUk/I-Qj2L5cVmI/s1600/floatRight.jpg" imageanchor="1" style="margin-left: auto; margin-right: auto;"&gt;&lt;img border="0" src="http://3.bp.blogspot.com/__dBufINvtwM/TMVb-6iJBSI/AAAAAAAAFUk/I-Qj2L5cVmI/s1600/floatRight.jpg" /&gt;&lt;/a&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class="tr-caption" style="text-align: center;"&gt;Right floated elements, with order changed&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;&lt;br /&gt;
So as you can see, while we float elements to left the order is { 1, 2, 3 }. But when you float the same thing to the right instead of going to the right with the same order it changes to { 3, 2, 1 }. Interesting right, so is it a bug? Not at all, to understand what is happening here we need to dig into what exactly is meant by floating.&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;Float&lt;/b&gt;&lt;br /&gt;
&lt;br /&gt;
A float is a box that is shifted to the left or right on the current line. The most interesting characteristic of a float is that content may flow along its side. Content flows down the right side of a left-floated box and down the left side of a right-floated box. &lt;b&gt;A floated box is shifted to the left or right until its outer edge touches the containing block edge or the outer edge of another float.&lt;/b&gt; If there is not enough horizontal room for the float, it is shifted downward until either it fits or there are no more floats present. Since a float is not in the flow, non-positioned block boxes created before and after the float box flow vertically as if the float did not exist. However, line boxes created next to the float are shortened to make room for the margin box of the float. If a shortened line box is too small to contain any further content, then it is shifted downward until either it fits or there are no more floats present. Any content in the current line before a floated box is re-flowed in the first available line on the other side of the float. In other words, if inline boxes are placed on the line before a left float is encountered that fits in the remaining line box space, the left float is placed on that line, aligned with the top of the line box, and then the inline boxes already on the line are moved accordingly to the right of the float (the right being the other side of the left float) and vice verse for rtl and right floats.&lt;br /&gt;
&lt;i&gt;&lt;span class="Apple-style-span" style="font-size: small;"&gt;- From &lt;/span&gt;&lt;/i&gt;&lt;a href="http://www.w3.org/TR/CSS2/visuren.html#floats"&gt;&lt;i&gt;&lt;span class="Apple-style-span" style="font-size: small;"&gt;w3c css float spec&lt;/span&gt;&lt;/i&gt;&lt;/a&gt;&lt;br /&gt;
&lt;br /&gt;
So now we can say that it's applying what it was asked to. CSS works in a hierarchical fashion. Now what happens is that all the &amp;lt;li&amp;gt; elements needs to be floated right, so it takes the first &amp;lt;li&amp;gt; and place it to the right. Now it takes the second &amp;lt;li&amp;gt; element which also needs to be floated right. So it pushes the second &amp;lt;li&amp;gt; element to right but since the first &amp;lt;li&amp;gt; element is already floated to right it can only go as far as its left. So the second &amp;lt;li&amp;gt; is placed directly to the left of the first &amp;lt;li&amp;gt; element. Similarly with the third &amp;lt;li&amp;gt; element and so on. So you can see elements placed left of each element.&lt;br /&gt;
&lt;br /&gt;
Every thing well told, but this doesn't meet our requirement. We need to maintain the same order when we float elements right. There are few ways in which we can achieve this.&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;Solution 1:&lt;/b&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;div class="code"&gt;&lt;br /&gt;
The HTML,&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div&amp;gt;&lt;br /&gt;
&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;lt;ul&amp;gt;&lt;br /&gt;
&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;lt;li&amp;gt;1&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;lt;li&amp;gt;2&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;lt;li&amp;gt;3&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;lt;/ul&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The CSS,&lt;br /&gt;
&lt;br /&gt;
div{ &lt;br /&gt;
&amp;nbsp;&amp;nbsp; &amp;nbsp;width:300px; &lt;br /&gt;
&amp;nbsp;&amp;nbsp; &amp;nbsp;border:1px solid #000; &lt;br /&gt;
&amp;nbsp;&amp;nbsp; &amp;nbsp;overflow:hidden; &lt;br /&gt;
}&lt;br /&gt;
ul{&lt;br /&gt;
&amp;nbsp;&amp;nbsp; &amp;nbsp;padding:0;&lt;br /&gt;
&amp;nbsp;&amp;nbsp; &amp;nbsp;margin:0;&lt;br /&gt;
&amp;nbsp;&amp;nbsp; &amp;nbsp;float:right;&lt;br /&gt;
}&lt;br /&gt;
li{&lt;br /&gt;
&amp;nbsp;&amp;nbsp; &amp;nbsp;border:1px solid #000;&lt;br /&gt;
&amp;nbsp;&amp;nbsp; &amp;nbsp;text-align:center;&lt;br /&gt;
&amp;nbsp;&amp;nbsp; &amp;nbsp;float:left;&lt;br /&gt;
&amp;nbsp;&amp;nbsp; &amp;nbsp;margin:20px 5px;&lt;br /&gt;
&amp;nbsp;&amp;nbsp; &amp;nbsp;padding:5px;&lt;br /&gt;
&amp;nbsp;&amp;nbsp; &amp;nbsp;width:25px;&lt;br /&gt;
&amp;nbsp;&amp;nbsp; &amp;nbsp;list-style:none;&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
&lt;/div&gt;&lt;br /&gt;
In this solution we need to add any container like &amp;lt;div&amp;gt; to the &amp;lt;ul&amp;gt; element, then float &amp;lt;ul&amp;gt; to right and the float the &amp;lt;li&amp;gt; to left. This will give you the desired result.&lt;br /&gt;
&lt;br /&gt;
&lt;table align="center" cellpadding="0" cellspacing="0" class="tr-caption-container" style="margin-left: auto; margin-right: auto; text-align: center;"&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td style="text-align: center;"&gt;&lt;a href="http://2.bp.blogspot.com/__dBufINvtwM/TMVeUtYb7yI/AAAAAAAAFUo/TxrwXrZWwjQ/s1600/floatRightSolution.jpg" imageanchor="1" style="margin-left: auto; margin-right: auto;"&gt;&lt;img border="0" src="http://2.bp.blogspot.com/__dBufINvtwM/TMVeUtYb7yI/AAAAAAAAFUo/TxrwXrZWwjQ/s1600/floatRightSolution.jpg" /&gt;&lt;/a&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class="tr-caption" style="text-align: center;"&gt;Right floated elements in the same order&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;&lt;br /&gt;
&lt;b&gt;Solution 2:&lt;/b&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;div class="code"&gt;&lt;br /&gt;
The HTML,&lt;br /&gt;
&lt;br /&gt;
&amp;lt;ul&amp;gt;&lt;br /&gt;
&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;lt;li&amp;gt;1&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;lt;li&amp;gt;2&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;lt;li&amp;gt;3&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;/ul&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The CSS,&lt;br /&gt;
&lt;br /&gt;
ul, li{&lt;br /&gt;
&amp;nbsp;&amp;nbsp; &amp;nbsp;border:1px solid #000;&lt;br /&gt;
}&lt;br /&gt;
ul{&lt;br /&gt;
&amp;nbsp;&amp;nbsp; &amp;nbsp;padding:20;&lt;br /&gt;
&amp;nbsp;&amp;nbsp; &amp;nbsp;margin:0;&lt;br /&gt;
&amp;nbsp;&amp;nbsp; &amp;nbsp;text-align:right;&lt;br /&gt;
&amp;nbsp;&amp;nbsp; &amp;nbsp;width:300px;&lt;br /&gt;
}&lt;br /&gt;
li{&lt;br /&gt;
&amp;nbsp;&amp;nbsp; &amp;nbsp;text-align:center;&lt;br /&gt;
&amp;nbsp;&amp;nbsp; &amp;nbsp;display:inline;&lt;br /&gt;
&amp;nbsp;&amp;nbsp; &amp;nbsp;margin-left:10px;&lt;br /&gt;
&amp;nbsp;&amp;nbsp; &amp;nbsp;padding:10px;&lt;br /&gt;
&amp;nbsp;&amp;nbsp; &amp;nbsp;width:25px;&lt;br /&gt;
&amp;nbsp;&amp;nbsp; &amp;nbsp;list-style:none;&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
&lt;/div&gt;&lt;br /&gt;
The second solution I feel is pretty much efficient as you need not have any extra elements added. Just " text-align:right " the &amp;lt;ul&amp;gt; element and &amp;lt;li&amp;gt; elements are made inline.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1781780735331941940-3068663993656209331?l=www.arunnambiar.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://www.arunnambiar.com/feeds/3068663993656209331/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.arunnambiar.com/2010/10/float-right-without-changing-order.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1781780735331941940/posts/default/3068663993656209331?v=2'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1781780735331941940/posts/default/3068663993656209331?v=2'/><link rel='alternate' type='text/html' href='http://www.arunnambiar.com/2010/10/float-right-without-changing-order.html' title='Float right without changing order'/><author><name>Arun Nambiar</name><uri>http://www.blogger.com/profile/16732190994577891585</uri><email>mailarunkk@gmail.com</email></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://4.bp.blogspot.com/__dBufINvtwM/TMVbGPzKQbI/AAAAAAAAFUg/XEl72Qrf-PY/s72-c/floatLeft.jpg' height='72' width='72'/><thr:total>0</thr:total></entry><entry gd:etag='W/&quot;D0cEQHY9cSp7ImA9Wx5UF0k.&quot;'><id>tag:blogger.com,1999:blog-1781780735331941940.post-855814642882681802</id><published>2010-10-22T03:54:00.000-07:00</published><updated>2010-10-22T03:56:41.869-07:00</updated><app:edited xmlns:app='http://www.w3.org/2007/app'>2010-10-22T03:56:41.869-07:00</app:edited><category scheme='http://www.blogger.com/atom/ns#' term='vim'/><title>Bookmarking in vim editor</title><content type='html'>While editing lengthy files in any editor its very helpful to have bookmarking feature. Almost all modern browsers have this feature. While I was using vim editor I found it extremely difficult to move across different lines in a file and going back and vise-verse. Glad that there is something called "mark" in vim which is the  bookmarking feature for vim editor. Using this you can bookmark a particular line and later return to the same place quickly.  If you are a frequent vim user, this simple technique will be the most useful feature and you will love it.&lt;br /&gt;
&lt;br /&gt;
There are mainly two types of bookmarking techniques in vim, local and global bookmarking.&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;Local Bookmarking:&lt;/b&gt;&lt;br /&gt;
&lt;br /&gt;
Local bookmarking or single-file bookmarking, as the word implies is within a single file. When we want to go to a specific position we can use this. Local bookmarking is always in lowercase. So to create a local bookmark type "m" followed by the bookmark-name in vim's command mode.&lt;br /&gt;
&lt;br /&gt;
&lt;div class="code"&gt;m{bookmark-name}&lt;/div&gt;&lt;br /&gt;
The thing to note here is {bookmark-name} should be always be an alphabet to refer to the name of the bookmark. So if you type "ms" it will create a bookmark on the current line at the current location with name "s". Now to access the bookmark you need to type "'" or "`" followed by the created bookmark-name in vim's command mode.&lt;br /&gt;
&lt;br /&gt;
&lt;div class="code"&gt;'{bookmark-name}&lt;br /&gt;
&lt;br /&gt;
`{bookmark-name}&lt;/div&gt;&lt;br /&gt;
Using both of these commands you can access the bookmarked position. So what is the difference? '{bookmark-name}, which is "single-quote"{bookmark-name} takes you to the beginning of the bookmarked line. Now `{bookmark-name}, which is "backtick"{bookmark-name} takes you to the exact bookmarked position on the line.&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;Global Bookmarking:&lt;/b&gt;&lt;br /&gt;
&lt;b&gt;&lt;br /&gt;
&lt;/b&gt;&lt;br /&gt;
Global bookmarking or multiple-file bookmarking, is when you have multiple files open. If you want to go to a particular position in any one of the open files, then you can use Global bookmarking feature. This is very powerful as you can move across different files without losing context. Global bookmarking is always in upper case.&lt;br /&gt;
&lt;br /&gt;
&lt;div class="code"&gt;m{BOOKMARKS-NAME}&lt;/div&gt;&lt;br /&gt;
Lets see this example&lt;br /&gt;
&lt;br /&gt;
&lt;div class="code"&gt;Open multiple files&lt;br /&gt;
$ vim /var/www/css/style.css /var/www/css/global.css&lt;br /&gt;
&lt;br /&gt;
style.css file go to a specific line and type mA to create a global bookmark called A&lt;br /&gt;
&lt;br /&gt;
Now :n from style.css file to go to global.css file&lt;br /&gt;
&lt;br /&gt;
Inside global.css file go to a specific line and type mB to create a global bookmark called B&lt;br /&gt;
&lt;br /&gt;
Now type `A, to go back to the bookmarked place in style.css&lt;br /&gt;
&lt;br /&gt;
Now from style.css, type `B, it take you back to global.css&lt;/div&gt;&lt;br /&gt;
&lt;b&gt;Display All Bookmarks:&lt;/b&gt;&lt;br /&gt;
&lt;b&gt;&lt;br /&gt;
&lt;/b&gt;&lt;br /&gt;
To display all the bookmarks you have made use the "marks" in the last line mode of vim.&lt;br /&gt;
&lt;br /&gt;
&lt;div class="code"&gt;All bookmarks&lt;br /&gt;
:marks&lt;br /&gt;
&lt;br /&gt;
A specific bookmark&lt;br /&gt;
:marks {bookmark-name}&lt;/div&gt;&lt;br /&gt;
&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://2.bp.blogspot.com/__dBufINvtwM/TMFtommR28I/AAAAAAAAFUQ/DI9QnvAWk38/s1600/marks.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" src="http://2.bp.blogspot.com/__dBufINvtwM/TMFtommR28I/AAAAAAAAFUQ/DI9QnvAWk38/s1600/marks.jpg" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;
&lt;br /&gt;
Apart from the above bookmarks, you can also notice that there are other marks as well like ‘ (single-quote), ” (double quote), [ , ], ^ and . (period) are created by vim by default and you don’t have any control over it. For example, the mark . (period) indicates the last position where a change was made. So, you can always do `. (back-tick followed by period), which will take you to the position where the last change was done.&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;Utilities of Bookmarking:&lt;/b&gt;&lt;br /&gt;
&lt;b&gt;&lt;br /&gt;
&lt;/b&gt;&lt;br /&gt;
There are much more you can do using marks other than bookmarking. We can use them as boundary when doing stuff over multiple lines. Just see these examples, assume you have marked the beginning of the area with a and the end with b. Now we can do stuff like:&lt;br /&gt;
&lt;br /&gt;
&lt;div class="code"&gt;delete from a specific area to another area&lt;br /&gt;
:'a,'b d&lt;br /&gt;
&lt;br /&gt;
write from a specific area to another area to a new file&lt;br /&gt;
:'a,'b w {filename}&lt;br /&gt;
&lt;br /&gt;
substitute only a specific area&lt;br /&gt;
:'a,'b s/this/that/g&lt;/div&gt;&lt;br /&gt;
&lt;b&gt;Summary:&lt;/b&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;div class="code"&gt;:marks         – Display all the bookmarks&lt;br /&gt;
&lt;br /&gt;
m{bookmark-name}       – Creates a bookmark called {bookmark-name}&lt;br /&gt;
&lt;br /&gt;
`{bookmark-name}       – Go to the exact location of the bookmark {bookmark-name}&lt;br /&gt;
&lt;br /&gt;
‘{bookmark-name}       – Go to the beginning of the line of the bookmark {bookmark-name}&lt;br /&gt;
&lt;br /&gt;
:marks {bookmark-name} – Display the details of the bookmark with name {bookmark-name}&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1781780735331941940-855814642882681802?l=www.arunnambiar.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://www.arunnambiar.com/feeds/855814642882681802/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.arunnambiar.com/2010/10/bookmarking-in-vim-editor.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1781780735331941940/posts/default/855814642882681802?v=2'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1781780735331941940/posts/default/855814642882681802?v=2'/><link rel='alternate' type='text/html' href='http://www.arunnambiar.com/2010/10/bookmarking-in-vim-editor.html' title='Bookmarking in vim editor'/><author><name>Arun Nambiar</name><uri>http://www.blogger.com/profile/16732190994577891585</uri><email>mailarunkk@gmail.com</email></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://2.bp.blogspot.com/__dBufINvtwM/TMFtommR28I/AAAAAAAAFUQ/DI9QnvAWk38/s72-c/marks.jpg' height='72' width='72'/><thr:total>0</thr:total></entry><entry gd:etag='W/&quot;CkEEQ3s8eip7ImA9Wx9TEEs.&quot;'><id>tag:blogger.com,1999:blog-1781780735331941940.post-1993683294659803632</id><published>2010-10-21T02:27:00.000-07:00</published><updated>2010-11-17T22:10:02.572-08:00</updated><app:edited xmlns:app='http://www.w3.org/2007/app'>2010-11-17T22:10:02.572-08:00</app:edited><category scheme='http://www.blogger.com/atom/ns#' term='JavaScript'/><category scheme='http://www.blogger.com/atom/ns#' term='IE8'/><category scheme='http://www.blogger.com/atom/ns#' term='IE7'/><category scheme='http://www.blogger.com/atom/ns#' term='CSS'/><category scheme='http://www.blogger.com/atom/ns#' term='jQuery'/><category scheme='http://www.blogger.com/atom/ns#' term='IE6'/><title>IE fix for fixed width select cuts off options</title><content type='html'>While working the other day I came across one more problem with IE :), If we set a static width on the &amp;lt;select&amp;gt; element, any &amp;lt;option&amp;gt; elements that are wider get cut of in all Internet Explorers.&lt;br /&gt;
&lt;br /&gt;
&lt;table cellpadding="0" cellspacing="0" class="tr-caption-container" style="float: left; margin-right: 1em; text-align: left;"&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td style="text-align: center;"&gt;&lt;a href="http://1.bp.blogspot.com/__dBufINvtwM/TL__55YzkVI/AAAAAAAAFUA/49lt_kLHwvM/s1600/ieSelect.jpg" imageanchor="1" style="clear: left; margin-bottom: 1em; margin-left: auto; margin-right: auto;"&gt;&lt;img border="0" src="http://1.bp.blogspot.com/__dBufINvtwM/TL__55YzkVI/AAAAAAAAFUA/49lt_kLHwvM/s1600/ieSelect.jpg" /&gt;&lt;/a&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class="tr-caption" style="text-align: center;"&gt;Select rendered in IEs&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;&lt;table align="center" cellpadding="0" cellspacing="0" class="tr-caption-container" style="margin-left: auto; margin-right: auto; text-align: left;"&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td style="text-align: center;"&gt;&lt;a href="http://2.bp.blogspot.com/__dBufINvtwM/TMAAL6eaUjI/AAAAAAAAFUE/JD4yopZpWpo/s1600/ffSelect.jpg" imageanchor="1" style="clear: left; margin-bottom: 1em; margin-left: auto; margin-right: auto;"&gt;&lt;img border="0" height="77" src="http://2.bp.blogspot.com/__dBufINvtwM/TMAAL6eaUjI/AAAAAAAAFUE/JD4yopZpWpo/s320/ffSelect.jpg" width="320" /&gt;&lt;/a&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class="tr-caption" style="text-align: center;"&gt;Select rendered in other bowsers(this is in firefox)&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;&lt;br /&gt;
&lt;br /&gt;
In almost all other browsers if you fix the width of the element, the pulldown still displays the options at the width required to allow you to read them all. In IE however the pulldown is limited to the width of the select, which means wide options get cut off. After doing some searching and scratching I found that there is no good CSS solution for this. But it can be tackled with JavaScript in a number of ways.&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;Solution:&lt;/b&gt;&lt;br /&gt;
&lt;br /&gt;
The normal way:&lt;br /&gt;
&lt;br /&gt;
&lt;div class="code"&gt;&amp;lt;style&amp;gt;&lt;br /&gt;
&lt;br /&gt;
select.normal {&lt;br /&gt;
&lt;br /&gt;
&amp;nbsp;&amp;nbsp; &amp;nbsp;width: 100px;&lt;br /&gt;
&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
select.expand {&lt;br /&gt;
&lt;br /&gt;
&amp;nbsp;&amp;nbsp; &amp;nbsp;width: auto;&lt;br /&gt;
&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/style&amp;gt;&lt;/div&gt;&lt;br /&gt;
&lt;div class="code"&gt;&amp;lt;select class="normal"&lt;br /&gt;
&lt;br /&gt;
&lt;span class="Apple-tab-span" style="white-space: pre;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;  &lt;/span&gt;onMouseDown="if(document.all) this.className='expand';"&lt;br /&gt;
&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; onBlur="if(document.all) this.className='normal';"&lt;br /&gt;
&lt;br /&gt;
&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;onChange="if(document.all) this.className='normal';"&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;span class="Apple-tab-span" style="white-space: pre;"&gt; &lt;/span&gt;&amp;lt;option&amp;gt;Select from this list&amp;lt;/option&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;span class="Apple-tab-span" style="white-space: pre;"&gt; &lt;/span&gt;&amp;lt;option&amp;gt;Hey this is a long text here which needs to shown in IE&amp;lt;/option&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;span class="Apple-tab-span" style="white-space: pre;"&gt; &lt;/span&gt;&amp;lt;option&amp;gt;This is another long text here which needs to shown in IE&amp;lt;/option&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/select&amp;gt;&lt;/div&gt;&lt;br /&gt;
Now if you want to use a library like jQuery this can be again written as:&lt;br /&gt;
&lt;br /&gt;
&lt;div class="code"&gt;&amp;lt;select class="normal"&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;span class="Apple-tab-span" style="white-space: pre;"&gt; &lt;/span&gt;&amp;lt;option&amp;gt;Select from this list&amp;lt;/option&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;span class="Apple-tab-span" style="white-space: pre;"&gt; &lt;/span&gt;&amp;lt;option&amp;gt;Hey this is a long text here which needs to shown in IE&amp;lt;/option&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;span class="Apple-tab-span" style="white-space: pre;"&gt; &lt;/span&gt;&amp;lt;option&amp;gt;This is another long text here which needs to shown in IE&amp;lt;/option&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/select&amp;gt;&lt;/div&gt;&lt;br /&gt;
&lt;div class="code"&gt;&amp;lt;script&amp;gt;&lt;br /&gt;
&lt;br /&gt;
jQuery(document).ready(function(){&lt;br /&gt;
&lt;br /&gt;
&lt;span class="Apple-tab-span" style="white-space: pre;"&gt; &lt;/span&gt;var isIE &amp;nbsp;= jQuery.browser.msie;&lt;br /&gt;
&lt;span class="Apple-tab-span" style="white-space: pre;"&gt; &lt;/span&gt;&lt;br /&gt;
&lt;span class="Apple-tab-span" style="white-space: pre;"&gt; &lt;/span&gt;if (isIE) {&lt;br /&gt;
&lt;br /&gt;
&lt;span class="Apple-tab-span" style="white-space: pre;"&gt;  &lt;/span&gt;var select = jQuery("select.normal");&lt;br /&gt;
&lt;br /&gt;
&lt;span class="Apple-tab-span" style="white-space: pre;"&gt;  &lt;/span&gt;select.mousedown(function(){&lt;br /&gt;
&lt;br /&gt;
&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; jQuery(this).removeClass('normal').addClass('expand');&lt;br /&gt;
&lt;br /&gt;
&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;});&lt;br /&gt;
&lt;br /&gt;
&lt;span class="Apple-tab-span" style="white-space: pre;"&gt;  &lt;/span&gt;select.blur(function(){&lt;br /&gt;
&lt;br /&gt;
&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; jQuery(this).removeClass('expand').addClass('normal');&lt;br /&gt;
&lt;br /&gt;
&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;});&lt;br /&gt;
&lt;br /&gt;
&lt;span class="Apple-tab-span" style="white-space: pre;"&gt;  &lt;/span&gt;select.change(function(){&lt;br /&gt;
&lt;br /&gt;
&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; jQuery(this).removeClass('expand').addClass('normal');&lt;br /&gt;
&lt;br /&gt;
&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; });&lt;br /&gt;
&lt;br /&gt;
&lt;span class="Apple-tab-span" style="white-space: pre;"&gt;  &lt;/span&gt;&lt;br /&gt;
&lt;span class="Apple-tab-span" style="white-space: pre;"&gt; &lt;/span&gt;}&lt;br /&gt;
&lt;br /&gt;
});&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/script&amp;gt;&lt;/div&gt;&lt;br /&gt;
So as you find here, the solution is fairly simple. Have two classes one for the normal way of showing and the next when we click on the select box. The only thing thing that changes here is width. The select box is given the width:auto so that it can expand to what ever length the content is out there in the options. Also we should make sure that this behavior is done only for IEs.&lt;br /&gt;
&lt;br /&gt;
Every thing is well and fine for this normal case. But consider a case where we have select box in a container which cannot expand beyond specific width, since it could break the layout.&lt;br /&gt;
&lt;br /&gt;
&lt;div style="text-align: left;"&gt;&lt;a href="http://2.bp.blogspot.com/__dBufINvtwM/TMAFGNtSOfI/AAAAAAAAFUI/Pgkq8q5Vs5w/s1600/ieSelectColumnsBreak.jpg" imageanchor="1" style="clear: left; float: left; margin-bottom: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="175" src="http://2.bp.blogspot.com/__dBufINvtwM/TMAFGNtSOfI/AAAAAAAAFUI/Pgkq8q5Vs5w/s640/ieSelectColumnsBreak.jpg" width="640" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;
&lt;br /&gt;
In this case we can have a small fix to the CSS class. Add position absolute so that it just layers over the other contents.&lt;br /&gt;
&lt;br /&gt;
&lt;div class="code"&gt;&amp;lt;style&amp;gt;&lt;br /&gt;
&lt;br /&gt;
select.normal {&lt;br /&gt;
&lt;br /&gt;
&amp;nbsp;&amp;nbsp; &amp;nbsp;width: 100px;&lt;br /&gt;
&lt;br /&gt;
&lt;span class="Apple-tab-span" style="white-space: pre;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;position:static;&lt;br /&gt;
&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
select.expand {&lt;br /&gt;
&lt;br /&gt;
&amp;nbsp;&amp;nbsp; &amp;nbsp;width: auto;&lt;br /&gt;
&lt;br /&gt;
&lt;span class="Apple-tab-span" style="white-space: pre;"&gt;    &lt;/span&gt;position:absolute;&lt;br /&gt;
&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/style&amp;gt;&lt;/div&gt;&lt;br /&gt;
&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://3.bp.blogspot.com/__dBufINvtwM/TMAFgzNEF7I/AAAAAAAAFUM/mww-tqQA9NA/s1600/ieSelectColumns.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="195" src="http://3.bp.blogspot.com/__dBufINvtwM/TMAFgzNEF7I/AAAAAAAAFUM/mww-tqQA9NA/s640/ieSelectColumns.jpg" width="640" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;
As you can see the select opens without breaking the layout.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1781780735331941940-1993683294659803632?l=www.arunnambiar.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://www.arunnambiar.com/feeds/1993683294659803632/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.arunnambiar.com/2010/10/ie-fix-for-fixed-width-select-cuts-off.html#comment-form' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1781780735331941940/posts/default/1993683294659803632?v=2'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1781780735331941940/posts/default/1993683294659803632?v=2'/><link rel='alternate' type='text/html' href='http://www.arunnambiar.com/2010/10/ie-fix-for-fixed-width-select-cuts-off.html' title='IE fix for fixed width select cuts off options'/><author><name>Arun Nambiar</name><uri>http://www.blogger.com/profile/16732190994577891585</uri><email>mailarunkk@gmail.com</email></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://1.bp.blogspot.com/__dBufINvtwM/TL__55YzkVI/AAAAAAAAFUA/49lt_kLHwvM/s72-c/ieSelect.jpg' height='72' width='72'/><thr:total>1</thr:total></entry><entry gd:etag='W/&quot;CUEFSX09fip7ImA9Wx5UGEk.&quot;'><id>tag:blogger.com,1999:blog-1781780735331941940.post-3642862197122769306</id><published>2010-06-30T04:35:00.000-07:00</published><updated>2010-10-23T07:20:18.366-07:00</updated><app:edited xmlns:app='http://www.w3.org/2007/app'>2010-10-23T07:20:18.366-07:00</app:edited><category scheme='http://www.blogger.com/atom/ns#' term='IE8'/><category scheme='http://www.blogger.com/atom/ns#' term='IE7'/><category scheme='http://www.blogger.com/atom/ns#' term='CSS'/><category scheme='http://www.blogger.com/atom/ns#' term='HTML'/><category scheme='http://www.blogger.com/atom/ns#' term='IE6'/><category scheme='http://www.blogger.com/atom/ns#' term='Firefox'/><title>How to break a long text on a submit button</title><content type='html'>This an interesting thing I have found out while I was working on one of my project. If you have an input&amp;nbsp;submit button with a long text it won't wrap according to the size of the column it is in. It crosses the&amp;nbsp;column and overlaps in firefox and in IE it expands the column for the button to accomodate. While&amp;nbsp;development I tried lot of things to make the text wrap in the button but in wain. My HTML looked some thing&amp;nbsp;like this:&lt;br /&gt;
&lt;br /&gt;
&lt;div class="code"&gt;&amp;lt;input type="submit" name="Submit" value="This is a very very very very long text" /&amp;gt;&lt;/div&gt;&lt;br /&gt;
&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://4.bp.blogspot.com/__dBufINvtwM/TDGjOIPYdEI/AAAAAAAAFEI/dnRBEAcJBo4/s1600/longButton.JPG" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="158" src="http://4.bp.blogspot.com/__dBufINvtwM/TDGjOIPYdEI/AAAAAAAAFEI/dnRBEAcJBo4/s320/longButton.JPG" width="320" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;
In the end I came up with a solution.&lt;br /&gt;
&lt;br /&gt;
My first solution for this problem was to remove the input submit button itself and use&amp;nbsp;&amp;lt;button&amp;gt;&amp;nbsp;instead,&amp;nbsp;which worked well. So I changed my code in this way.&lt;br /&gt;
&lt;br /&gt;
&lt;div class="code"&gt;&amp;lt;button type="submit"&amp;gt;This is a very&amp;nbsp;&amp;lt;br&amp;gt;&amp;nbsp;very very&amp;nbsp;&amp;lt;br&amp;gt;&amp;nbsp;very long text&amp;lt;/button&amp;gt;&lt;/div&gt;&lt;br /&gt;
This worked well in both firefox and IE as the text got wrapped because of&amp;nbsp;&amp;lt;br&amp;gt;. But lately I found a problem with this solution in IE. If you have more than one&amp;nbsp;&amp;lt;button type="submit"&amp;gt;&amp;nbsp;in the page IE will submit the last button even though you have clicked the first&amp;nbsp;&amp;lt;button&amp;gt;&amp;nbsp;which was not the desired behaviour.&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;Solution&lt;/b&gt;&lt;br /&gt;
&lt;br /&gt;
The solution was a fairly small which worked well for me. Still I am not sure its the correct way to do&amp;nbsp;this. There is two things that need to be done for firefox and IE. For firefox we need to add a css&amp;nbsp;declaration white-space: normal and for IE you need to add HTML Coded Character&lt;span class="Apple-style-span" style="font-family: Arial, Helvetica, sans-serif;"&gt;&amp;nbsp;&lt;/span&gt;&lt;span class="Apple-style-span" style="border-collapse: collapse;"&gt;&lt;span class="Apple-style-span" style="font-family: inherit;"&gt;&amp;amp;#13;&lt;/span&gt;&lt;span class="Apple-style-span" style="border-collapse: separate;"&gt;&lt;span class="Apple-style-span" style="font-family: inherit;"&gt;&amp;nbsp;- Carriage Return&amp;nbsp;where ever you require the text to break. So the code looks like this:&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;div class="code"&gt;&amp;lt;style&amp;gt;&lt;br /&gt;
input {&lt;br /&gt;
&amp;nbsp;&amp;nbsp;white-space: normal;&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/style&amp;gt;&lt;/div&gt;&lt;br /&gt;
&lt;div class="code"&gt;&amp;lt;input type="submit" value="This is a very&amp;nbsp;&lt;span class="Apple-style-span" style="border-collapse: collapse;"&gt;&amp;amp;#13;&amp;nbsp;&lt;span class="Apple-style-span" style="border-collapse: separate;"&gt;very   very very&amp;nbsp;&lt;span class="Apple-style-span" style="border-collapse: collapse;"&gt;&amp;amp;#13;&amp;nbsp;&lt;span class="Apple-style-span" style="border-collapse: separate;"&gt;long text" /&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;br /&gt;
and it works!&lt;br /&gt;
&lt;br /&gt;
&lt;div&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1781780735331941940-3642862197122769306?l=www.arunnambiar.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://www.arunnambiar.com/feeds/3642862197122769306/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.arunnambiar.com/2010/06/how-to-break-long-text-on-submit-button.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1781780735331941940/posts/default/3642862197122769306?v=2'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1781780735331941940/posts/default/3642862197122769306?v=2'/><link rel='alternate' type='text/html' href='http://www.arunnambiar.com/2010/06/how-to-break-long-text-on-submit-button.html' title='How to break a long text on a submit button'/><author><name>Arun Nambiar</name><uri>http://www.blogger.com/profile/16732190994577891585</uri><email>mailarunkk@gmail.com</email></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://4.bp.blogspot.com/__dBufINvtwM/TDGjOIPYdEI/AAAAAAAAFEI/dnRBEAcJBo4/s72-c/longButton.JPG' height='72' width='72'/><thr:total>0</thr:total></entry><entry gd:etag='W/&quot;DUQNR3s4eCp7ImA9Wx5UF08.&quot;'><id>tag:blogger.com,1999:blog-1781780735331941940.post-6232459047829021897</id><published>2009-09-14T05:18:00.000-07:00</published><updated>2010-10-21T23:03:16.530-07:00</updated><app:edited xmlns:app='http://www.w3.org/2007/app'>2010-10-21T23:03:16.530-07:00</app:edited><category scheme='http://www.blogger.com/atom/ns#' term='IE7'/><category scheme='http://www.blogger.com/atom/ns#' term='CSS'/><category scheme='http://www.blogger.com/atom/ns#' term='HTML'/><category scheme='http://www.blogger.com/atom/ns#' term='IE6'/><title>How to disable HTML Select Option in IE</title><content type='html'>One of the project I was working had a requirement to disable one or more of the option element in a select field. A fairly straight forward use case, normally you can just write ‘disabled’, but to be valid XHTML, you need the disabled=’disabled’ variant. The point is, this works fine and looks great in Firefox. The options are not selectable and are nicely grayed out.&lt;br /&gt;
&lt;br /&gt;
&lt;div class="code"&gt;&amp;lt;select name="range"&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;option value="1" disabled="disabled"&amp;gt;option1&amp;lt;/option&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;option value="2"&amp;gt;option2&amp;lt;/option&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;option value="3"&amp;gt;option3&amp;lt;/option&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;option value="4" disabled="disabled"&amp;gt;option4&amp;lt;/option&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/select&amp;gt;&lt;br /&gt;
&lt;/div&gt;&lt;br /&gt;
&lt;a href="http://3.bp.blogspot.com/__dBufINvtwM/Sq4r-aEZziI/AAAAAAAADnc/xk1ZymbUXkk/s1600-h/option.gif" imageanchor="1" style="clear: left; float: left; margin-bottom: 1em; margin-right: 1em;"&gt;&lt;img border="0" src="http://3.bp.blogspot.com/__dBufINvtwM/Sq4r-aEZziI/AAAAAAAADnc/xk1ZymbUXkk/s200/option.gif" /&gt;&lt;/a&gt; But the problem I found was with IE. It totally refuses to understand this and whats interesting is that its the problem with  IE6 &amp;amp; IE7, IE8 has come up with updates.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;Solution&lt;/b&gt;&lt;br /&gt;
&lt;br /&gt;
One of the main solution that is suggested is using JavaScript. Traverse through the DOM and pick the option having attribute disabled and apply the gray color and change the focus when mouse over. Sounds good but what happens when JavaScript is turned off. So this solution wont work in all cases. So we need some kind of work around on this and interestingly HTML comes again for the rescue. There is an element in HTML called the &lt;b&gt;optgroup&lt;/b&gt; which allows you to group similar items in a select box. Using this we can emulate the so called disabled property. The code is as follows &lt;br /&gt;
&lt;br /&gt;
&lt;div class="code"&gt;optgroup{ color:#ccc; font-weight:normal; font-style:normal; }&lt;br /&gt;
&lt;/div&gt;&lt;br /&gt;
&lt;div class="code"&gt;&amp;lt;select name="range"&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;lt;optgroup label="option1"&amp;gt;&amp;lt;/optgroup&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;option value="2"&amp;gt;option2&amp;lt;/option&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;option value="3"&amp;gt;option3&amp;lt;/option&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;optgroup label="option4"&amp;gt;&amp;lt;/optgroup&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/select&amp;gt;&lt;br /&gt;
&lt;/div&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
You can see that the optgroup is used to emulate the disabled property and the gray out is done using CSS. Any one facing the IE disabled problem can use this as a work around. Comments and faq are most welcome.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1781780735331941940-6232459047829021897?l=www.arunnambiar.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://www.arunnambiar.com/feeds/6232459047829021897/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.arunnambiar.com/2009/09/how-to-disable-html-select-option-in-ie.html#comment-form' title='2 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1781780735331941940/posts/default/6232459047829021897?v=2'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1781780735331941940/posts/default/6232459047829021897?v=2'/><link rel='alternate' type='text/html' href='http://www.arunnambiar.com/2009/09/how-to-disable-html-select-option-in-ie.html' title='How to disable HTML Select Option in IE'/><author><name>Arun Nambiar</name><uri>http://www.blogger.com/profile/16732190994577891585</uri><email>mailarunkk@gmail.com</email></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://3.bp.blogspot.com/__dBufINvtwM/Sq4r-aEZziI/AAAAAAAADnc/xk1ZymbUXkk/s72-c/option.gif' height='72' width='72'/><thr:total>2</thr:total></entry></feed>