Showing posts with label Browser. Show all posts
Showing posts with label Browser. Show all posts

Saturday, September 20, 2014

Problem opening an image with alpha transparent channel

There might be situations that you might be opening up a png file that was created by someone else and you have to edit it. So here's the question, how can you workaround the problem?

You have a png like the above.

Outcome when you open it using Photoshop.
There's a strange black border around the image.

So here's a workaround for it.

First click here to open up 'Photo editor online - Pixlr.com'.

Reopen and save the image as a new file.

This would be the new file that I have created using "Pixlr.com".

Now, when you open it using Photoshop, you won't be getting anymore
unnecessary black color border. :D Case closed. Happy Days...

* Click here for the official website of 'Pixlr.com'.

Monday, February 24, 2014

Hiding a Option element in your webpage

By applying a style="display:none" to the <option> element in your webpage will not give you the desired results across all the browsers. Therefore, you either remove or add the <option> element when needed or create 2 different set of <select> element to provide the user the correct set of menu.

Here's the source code of the page that I have created, try viewing it using different browsers like 'Internet Explorer', 'Mozilla Firefox' and 'Google Chrome' and you can spot the difference.
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Hide a menu option</title>
</head>
<body>
Fruits:
<select>
    <option value="apple">Apple</option>
    <option value="orange">Orange</option>
    <option value="pear" style="display:none">Pear</option>
    <option value="pineapple">Pineapple</option>
</select>
</body>
</html>
* Click here for the demo shown in this post.

Wednesday, February 12, 2014

Managing plugin detection on IE11

If you have been creating and managing various type of contents online, you might want to take note of the change on IE11. It seems that in order to make the life of the developers much more easier, IE11 now supports the javascript code "navigator.plugins". However, it seems that this doesn't really return the desired outcome. I have run the script on IE11 and it only returns 'Microsoft Silverlight', whereby my Chrome and Firefox has much more results. (Ex: Flash, Quicktime, etc...) Therefore if you are detecting browser plugins, you should still check for ActiveXObject first followed by "navigator.plugins". But looking on the bright side, seems that Microsoft is trying to make everyone's life much more easier which is a (+). However, it looks like they have to spend a bit more time improving it.

* Click here to check the results of "navigator.plugins" on your browser.
^ Click here for the changes that Internet Explorer 11 has.

Thursday, June 13, 2013

HTML: Background Colour with Opacity

Well, I was working the other day and one of my colleagues told me that the div that has a background colour with an opacity of 70 doesn't work in IE. After a bit of Googling and a bit of trial and error, I managed to get it working. (It works in Google Chrome, Mozilla Firefox, Internet Explorer 7, 8 and 9. However, the solution doesn't really work with Internet Explorer with different standards.)

Let's go through parts of the source codes first. The following liner will enforce your Internet Explorer 9 onwards to fall back and use Internet Explorer 8 standards. However, this will also caused all your Internet Explorer 9 codes to malfunction.
<meta http-equiv="X-UA-Compatible" content="IE=8" >
The following codes are meant for super old browsers that doesn't supports the css RGBa(3 primary colours and alpha).
/* Fallback for web browsers that doesn't support RGBa */
background: rgb(0, 0, 0) transparent;
The following codes are meant for super new browsers that supports the css RGBa(3 primary colours and alpha). (For example: latest Mozilla Firefox, Google Chrome, etc.)
/* RGBa with 0.7 opacity */
background: rgba(0, 0, 0, 0.7);
The following codes are meant for the older Internet Explorers. Would need to add the condition <!--[if lte IE 8]>, because browsers like Internet Explorer 9 will apply both filters and RGBa. =.=""
    <!--[if lte IE 8]>
        <style>
            #mainbg1 {
                /* For IE 5.5 - 7*/ filter:progid:DXImageTransform.Microsoft.gradient(startColorstr=#b2000000, endColorstr=#b2000000);
                /* For IE 8*/
                -ms-filter: "progid:DXImageTransform.Microsoft.gradient(startColorstr=#b2000000, endColorstr=#b2000000)";
            }
        </style>
    <![endif]-->
And here's all the source codes at one glance.
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "https://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=8" >
    <title>Test</title>
    <style type="text/css" media="screen"> 
        body{
            margin: 0px;
			background-color:#00FF00;
		}
        #mainbg {
            width:100%; 
			height:1000px; 
			text-align:center; 
			position:absolute;
        }
        #mainbg1 {
            width:500px;
            height:500px;
            margin: 0px auto;
	
            /* Fallback for web browsers that doesn't support RGBa */
            background: rgb(0, 0, 0) transparent;
            /* RGBa with 0.7 opacity */
            background: rgba(0, 0, 0, 0.7);
        }
    </style>
    <!--[if lte IE 8]>
        <style>
            #mainbg1 {
                /* For IE 5.5 - 7*/ filter:progid:DXImageTransform.Microsoft.gradient(startColorstr=#b2000000, endColorstr=#b2000000);
                /* For IE 8*/
                -ms-filter: "progid:DXImageTransform.Microsoft.gradient(startColorstr=#b2000000, endColorstr=#b2000000)";
            }
        </style>
    <![endif]-->
</head>
<body>
<div id="mainbg">
    <div id="mainbg1">
    </div>
</div>
</body>
</html>
* Click here for the demo shown in this post.
^ Click here for the source files for the demo.

Saturday, December 8, 2012

OMG it still exists....

Do you have experience creating a website? Spending too much time creating and debugging a website? And how much time have you spent on the debugging process? But do you know that IE6 still holds more than 5% of the overall market share for web browsers?


Image taken from 'NetMarketShare'.
According to the website shown in the above, more than 50% of the market
share are IE browsers. On top of that just by combining IE6, IE8 and IE9
still takes up more than 50% of the overall market share. And if you do
a search for the term 'IE6' in google, you will be getting all sorts of
results related to articles asking users to upgrade their browser to a better one.

Anyway the website doesn't provide statistics of the desktop browser alone.
There's statistics for the Operating System used by desktop users,
Operating System used by mobile, Search Engines, etc...
(I wonder when can we reach the day where IE6 would drop to less than 1%
in the overall market share for Web browsers. O.O)

* Click here to find out more about 'NetMarketShare'.