Skip to main content

Useful IE CSS hacks

Many of the developers feel pain to develop their applications in cross platform, especially when there is Internet Explorer 6. This is because, IE6 do not support some core css Styles like min-height. Also, Many times it is observed that IE renders the things a bit different compared to other browsers. The following are the useful hacks for developing websites in IE.

Min-Height Property in IE6:
This is a very commonly used property to set the look and feel of the page. There is a workaround for this tag in IE6. Use the following styles in sequence:
min-height: 600px;
height:auto !important;
height:600px;
These lines can solve the problem of fixing min-height for ie6.

IE6 specific functionality:
Many times, IE6 require different styles from other browsers for constant look across the browsers. Then we have to define those properties two times, once for all the browsers and second for IE6. Many of the developers define a special css file for IE6 and will add that on checking the client browser. Another workaround for this is to add IE6 specific hack for all the properties.

IE6 hack is to prefixing an underscore(_) before the property. For Example,
If we need the height of an object to 450px and in IE6 it is 430px then write these styles as

height: 450px;
_height:450px;

Only IE6 can understood these properties and render the page. These hacks are handy while developing the web pages in a cross browser platform.

Happy Programming.!!

Comments

Popular posts from this blog

Linq: Query for multiple join conditions in Linq to SQL

This is common to join a table with another on multiple conditions, Like Select * from Customer c Join Invoice i on c.CustomerID = i.CustomerID and c.CustomerTypeID = i.CustomerTypeID I need to write a Linq to SQL query for the same scenario. But the syntax for this query is a bit different to expect. The Linq query is as follows: From c in DataContext .Customers Join i in DataContext .Invoices on new { c.CustomerID, c.CustomerTypeID } equals new { i.CustomerID, i.CustomerTypeID } *DataContext in the above query should be replaced with actual datacontext name.

Solution Array for List in WCF

Here is another common problem encounters with WCF Service in initial days. Suppose there is a method which returns a List of Objects the proxy will be generated as method which returns an array of objects. Reason: This problem is due to the default interpretation of collections. While generating proxy for the service all the collections are by default interpreted as arrays. That is why all the lists will be converted to arrays. Solution: If you are generating proxy by adding service reference from visual studio directly, there will be a 'advanced' button. Click that button and select the System.Generic.List as your Collection. This will resolve the problem. If you are generating proxy with svcutil here is the command to do the job. svcutil.exe http://ServerName/ServiceName/Servic.svc?wsdl /collectionType:System.Collections.Generic.List`1 or in short svcutil http://ServerName/ServiceName/Servic.svc?wsdl /ct:System.Collections.Generic.List`1 for more information go through this

How to: show dynamic columns in SQL server Reporting services

How to display dynamic columns in Reports? Let me explain what I mean dynamic here. I have a stored procedure which return some columns depending on User choice. In that case I dont have any clue about the columns which are in the report. In plain english, whatever dataset is coming from database, I need to display that information in a table or matrix. The dataset may contain 2columns or 25 columns. How to achieve this? After so much search I found an interesting property in SQL Server Reporting services for all Fields. There will be a property 'IsMissing' for each Field in the Dataset we defined in the report. To achieve dynamic behavior, I Created a table with all possible columns and toggled the visibility of the columns depending on their IsMissing status. For each column in the table there will be a Visibility Expression set on Hide Property. For Example, say the column is binded to a column 'Name' the details cell will have text Fields!Name.Value. The visibility