banner
Welcome to HTML.co.uk, the number one resource for all news, information, and happenings regarding HTML.

Updates: HTML.co.uk has just been relaunched. Subscribe to our RSS Feed to stay on top of HTML news and techniques.
Oct
14th

Cross Browser Compatibility

Author: Editor | Files under HTML Browsers
Tags for this article: , , , , , ,

Cross browser compatibility can be well stated as compatibility of any given website with all the major browsers available such as Internet Explorer, Netscape, Firefox, Safari, Opera and JAWS. It is a very common feature that your ideal version of the site is not able to create a pixel perfect replication in all the browsers. A website designer always writes the code considering any particular web browser, most commonly internet explorer; as a result a website may be working fine with one browser but not supporting the other browsers the same way. Therefore it is very important that each website owner should always test for the cross browser compatibility of their respective websites.

Although you may be having your own preference for a browser but the visitors for your website may not be using the same web browser as you. This is where the cross browser compatibility makes all the difference. Cross browser compatibility mainly deals with the functionality of the website and not with how it would look like. Infact, it has very little to do with browsers as well and can be well stated as multi user agent compatibility. When we refer to the term compatibility here, we do not mean looks and behaves identically; instead here it typically means that it performs equivalently under alternative conditions.

Functionality is simply the absolute key to cross browser compatibility. A lack of cross browser compatibility does not mean that the site looks different on all the different types of browsers but it simply means that the site doesn’t work on all the other browsers except for one, for which it has been designed. It is entirely possible though occasionally, to make two browsers renders a same design, but only on a condition that you make certain factors such as the user settings constant. Everything would just go out of the window if you try to tamper with those settings. It is always desirable to make the designs of your website as similar as possible between various browsers, but at the same time it is quite important to understand that there are always certain limitations to it.

It is very important to take certain factors into consideration which designing any website which would aid in cross browser compatibility. Firstly, it is very important to use only standard compliant coding. The HTML tags and features used while coding should not be browser specific. As these would only work in those browsers that they have been created for and can even lead to breakage of the web page when viewed in any other browser. Always remember to validate all your web pages which include the HTML or XHTML coding and cascading style sheets using the free validation service from W3C.

There is nothing much that can be done to keep a similar view across all the different browsers, instead you should try and guarantee something which is achievable, i.e. an equivalent view for all. Equivalent here means that the users should be able to get the similar information and also use the website to perform similar functions. Our main goal with cross browser compatibility is to make the website viewable in all major browsers and at the same time have the pages rendered correctly. Always remember that a website that doesn’t work in any choice o browser will surely drive the visitors away.


May
13th

Embedding Background Music

Author: Editor | Files under HTML Tutorials
Tags for this article: , , ,

You can allow background music to be played every time an HTML file is accessed. There are two methods to do so. Both of the solutions described here – one for Microsoft’s Internet Explorer and the other for Netscape – are proprietary. As in both solutions do not belong to the HTML standard.

Moreover, if you wish to embed background music, you should know that it only annoys most users and will cause them to leave your website more quickly.

An Example:

<html>
<head>
<title>Background Music</title>
<bgsound src=“background.mid” loop= “infinite”>
</head>
<body>
<embed src=“background.mid” autostart=“true” loop=“true” hidden=“true” height=“0” width=“0”>
<h1>Page Content</h1>
</body>
</html>

Explanation:

With <bgsound …> you determine the background music in the HTML file header according to the Microsoft syntax for displaying the site. You achieve the same thing for Netscape with <embed …>. In both cases the src attribute determines the desired music file. The files should really be in either MID, AU or WAV formats. In order to prevent a visible display of the music player, the elements hidden= “true” height= “0” are necessary for the Netscape syntax. The automatic music start also has to be explicitly stated in the Netscape syntax – through autostart= “true”. Then you can determine if the music plays only once, multiple times, or continuously. You can also achieve an endless effect in the Microsoft syntax through loop= “infinite”. If you wish to limit the amount of times the music file is replayed, then replace infinite with this number. With the Netscape syntax you only have the choice between endless loop and no replay. In order to produce an endless loop, write loop= “true”. Otherwise you can simply do without the element.

Take Note:

In the upper example it is required that the music file is found in the same directory as the HTML file. If the file is another directory, then you must enter the relative or absolute path name. This works in the same way as embedding graphics.

Playing background music sets certain requirements for the visitor (such as having the right hardware, or speakers). Moreover, the web browser must also have the ability to control the music file playback.