IE6 again, "height.html" is an example code of div height error on IE6.
This code running no problem on IE7 & Firefox, but when it reach IE6, the height change to 20px.
Same case as my previous post, I look for Mr Google again. This time I get some post said:
1) IE6 height will have some white space if image is smaller then 12px, we need to set line-height to 0px.
2) IE6 height will have some white space if image is smaller then 20px, we need to set line-height to 0px & set a smaller font-size.
So, my code end up like "height_ie6_fix.html".
Finally, it work perfectly on IE6, IE7 & Firefox browsers.
"Any fool can write code that a computer can understand. Good programmers write code that humans can understand." - Martin Fowler
Showing posts with label css. Show all posts
Showing posts with label css. Show all posts
Saturday, March 1, 2008
Monday, February 25, 2008
padding + height problem on Firefox
I though I was facing an error on Firefox browser when using padding & height attributes together in a CSS class. But I was error, in the end, it is still IE browser problem.
Let take an example "height_without_doctype.html"
When we run this code, it will display different output on Firefox & IE.
Firefox height = padding-top + height = 50px + 50px = 100px
IE height = height = 50px
After I find Mr Google, it point me to this url which is perfectly solve my above problem.
The solution is simple, just add in a DOC type, then IE will follow a common standard same as Firefox.
So, the code changed to "height_with_doctype.html"
Both browsers work the same now.
Let take an example "height_without_doctype.html"
When we run this code, it will display different output on Firefox & IE.
Firefox height = padding-top + height = 50px + 50px = 100px
IE height = height = 50px
After I find Mr Google, it point me to this url which is perfectly solve my above problem.
The solution is simple, just add in a DOC type, then IE will follow a common standard same as Firefox.
So, the code changed to "height_with_doctype.html"
Both browsers work the same now.
Friday, February 22, 2008
Javascript Menu Navigation
Recently I research on how to implement a javascript menu navigation. At the beginning, I was thinking of use library to make one. But there are so many different request coming in until I decided to develop my own javascript menu navigation.
Here is the sample code that I write (3 levels menu navigation):
During testing on this sample code, I find out that IE6 having some different behavior then IE7 & Firefox on onmouseout() function. If possible, avoid to use that function.
Here is the sample code that I write (3 levels menu navigation):
During testing on this sample code, I find out that IE6 having some different behavior then IE7 & Firefox on onmouseout() function. If possible, avoid to use that function.
Thursday, November 8, 2007
"div" Tag
I facing a lot of problems with "div" tag in IE browser, I just wondering is it IE not understand this tag or they don't want to understand this tag.
Just fix a small bug on IE browser which they don't understand "whitespace: pre" CSS under "div" tag, I use "pre" tag then the problem solve.
Just fix a small bug on IE browser which they don't understand "whitespace: pre" CSS under "div" tag, I use "pre" tag then the problem solve.
Wednesday, October 17, 2007
"code" Support
Yo, I add in something that will be useful on my own posting since I am a programmer.
Here is the CSS I used to create this "code" tag:
I am still thinking how to implement this into RSS feed which is a XML, not support CSS. If you didn't understand what I mean, open this post in a browser, then you will see the different.
Here is the CSS I used to create this "code" tag:
I am still thinking how to implement this into RSS feed which is a XML, not support CSS. If you didn't understand what I mean, open this post in a browser, then you will see the different.
Subscribe to:
Posts (Atom)