Posts filed under ‘css’

Jquery | Some useful and qucik scripts

1. How to get x-axis and y-axis on mouse move
//display the x and y axis values inside the mouseOverMe div
$('#mouseOverMe').html("X Axis : " + e.pageX + " | Y Axis " + e.pageY);

<div id=”mouseOverMe”>Mouse over me</div>

2. Disabling Right click

return false;

May 1, 2010 at 4:55 am 2 comments

z-index issue with IE7

Hi all, I spent almost a day to figure out how to fix z-index issue with IE7.



<div id=”wrapper”>
<div id=”inner”>

<div id=”menu”></div>

Assume I have a menu with z-index:10 and I want wrapper to sit on top of menu . What I did was I had

Hoping it to work in all browsers, It worked in all except IE7.

reasons : IE7 except us to provide postion:relative, So what I did was added position relative to #inner

Now #inner{z-index:999;position:relative;} Still it didnt worked. IE7 creates its own stack I mean the there is one more div on top of inner div i.e. wrapper

so Wrapper by default adds stack to all its children so even though inner has 999 z-index it wont work.

Solution is to provide z-index to wrapper and position it rather than to inner div


April 1, 2010 at 4:42 am 1 comment

Is Indian Team World No 1

Well there’s been lot of discussion happening all around the world is Dhoni’s men in Blue are the next world No 1 side?. Beating Aussies in their own backyard then at home and then beating England and Now srilanka. But I still feel their is a long way to go

Indian fielding looks crap except Suresh Raina.

Bowling looks ordinary especially spin department

Controlling the middle overs 15-40 [ Give away lot of runs without many wickets].

They won series in Srilanka as then won toss in all the four games they won.

February 9, 2009 at 6:34 am Leave a comment

Solution for PNG images in css

Many of us might have nightmare’s using png images as they are not supported in IE. Here is the solution we can use to overcome that nightmare


Method 1:

html>body .className{
 background: url(“../images/suresh kumar.png”) no-repeat;

Method 2:

* html #id{
 filter: progid XImageTransform.Microsoft.AlphaImageLoader(src=’images/sureshkumar.png’, sizingmethod=’crop’);
 cursor: hand;

August 5, 2008 at 9:21 am 1 comment

min-height hack/workaround in IE6,IE7 & Firefox

Hey i was wondering how to use min-height for all the 3 browsers and came across a workaround and which works wonders in all the 3 browsers.

click here for solution

June 13, 2008 at 4:37 am 20 comments

Common Mistakes Webdeveloper commit

It’s been more than 3 years now me working on web and I’ve been guilty of making many mistakes myself through the all these years  However, I do my best to learn, and avoid making the same mistakes over and over again.

DOCTYPE confusion

Completely missing, incorrect, or in the wrong place. I have seen HTML 4.0 Transitional used in documents containing XHTML markup as well as in <frameset> documents, DOCTYPE declarations appearing after the opening <html> tag, and incomplete DOCTYPES.

<span> mania
A common way of styling something with CSS is to wrap it in a <span> element with a class attribute and use that to hook up the styling. I’m sure we’ve all seen things like <span class="heading"> and <span class="bodytext">.
(too much) Visual thinking
Treating the web as WYSIWYG – starting off by focusing on how things look instead of thinking about structure first, and presentation later.
Lack of semantics
Non-semantic markup. Basing the choice of which HTML element to use on the way most graphical browsers render it by default, instead of on which meaning the element has.
Character encoding mismatches
Specifying one character encoding in the HTTP header sent by the server, and using another in the document. This may confuse browsers and make them display the document improperly.
Bad alt-attributes
Missing or useless. <img> elements with missing alt attributes can be found in billions on the web. Not quite as common are useless attribute values like “spacer GIF used to make the layout look good”, “big blue bullet with dropshadow”, and “JPEG image, 123 KB”. Remember, the alt attribute is required for <img> and <area> elements.
Invalid id and class attributes
Multiple uses of the same value for the id attribute. Invalid characters used in id and class attributes and CSS selectors.For CSS:

In CSS 2.1, identifiers (including element names, classes, and IDs in selectors) can contain only the characters [A-Za-z0-9] and ISO 10646 characters U+00A1 and higher, plus the hyphen (-) and the underscore (_); they cannot start with a digit.


ID and NAME tokens must begin with a letter ([A-Za-z]) and may be followed by any number of letters, digits ([0-9]), hyphens (“-“), underscores (“_”), colons (“:”), and periods (“.”).

Browser sniffing
Using scripts, server or client side, in an attempt to detect the visitor’s browser, and send or execute browser-specific code. Very commonly fails for reasons like new browsers, updated browsers, and user agent spoofing (Opera does this by default).
Missing units in CSS
Length values (horizontal or vertical measurements) require units in CSS, except when the value is zero. It’s not like in HTML, where you can type width="10". In CSS, it has to be width:10px; (or whatever unit you’re using).
Browser-specific CSS.
Scrollbar styling, expressions, filters etc. Proprietary CSS that only works in Internet Explorer. Invalid, too.
JavaScript dependency
Making a site depend on JavaScript. More people than you’d like are either using a browser with no JavaScript support, or have disabled JavaScript in their browser. Current stats indicate that this is 8-10 percent of web users. Search engine robots currently don’t interpret JavaScript very well either, so if your site requires JavaScript to navigate, say goodbye to good search engine rankings.
Flash dependency
Assuming everybody has Flash installed. Not everybody has. And most search engine robots do not (Google has reportedly started experimenting with indexing of Flash files, but they still recommend that you make sure all your text content and navigation is available in HTML files), so if your whole site depends on Flash being available, you’re not going to score high with search engines.
Text as image
Making images of text, and not providing a more accessible alternative. Not only does it take longer for visitors to download images instead of text, you also make it impossible for most visitors to enlarge the text.
Bad forms
Inaccessible, hard-to-use forms. Learn to use the <label>, <fieldset>, and <legend> elements, and do not use a “Reset” button.
Old skool HTML
Multiple nested tables, spacer GIFs, <font> elements, presentational markup. So common I don’t really have to mention it here.
Being IE-centric
Coding for IE/Win first, then adjusting for others, if there is time.
Invalid HTML attributes
Using deprecated or browser specific attributes like marginwidth, leftmargin, language, height for <table> elements, and border for <img> elements (in strict DOCTYPEs) just to name a few.
Unencoded ampersands
Many URIs contain long query strings with unencoded ampersands (&). This is invalid, and may cause problems. Ampersands must be written as &.

Did I miss your favourite mistake? Add it to the list


March 18, 2008 at 4:04 am 2 comments

using getElementByTagsName

var divelements=document.getElementById(divid).getElementsByTagName(“input”);

March 12, 2008 at 12:55 pm Leave a comment

Older Posts

Flickr Photos

Sunset Over The Groyne


Selwicks Bay Storm Dawn

More Photos

Blog Stats

  • 707,302 hits