How do I try to make a site compatible with major browsers?

Asked

Viewed 3,002 times

3

I don’t have much experience yet and wanted to know tips on what to do to increase the chances of a site being compatible with most browsers.

  • 1

    Good first is essential that you learn Html and Css. With html you will do the part we call markup (site skeleton) and with Css you will cut the look of your site. It is important that your websites are made using Divs and not tables like this will run perfectly in any browser without problems. This technique of Divs is called tableless. Start by studying this site http://www.w3schools.com/html/ is free and you will learn a lot of cool stuff. Good luck.

  • 1

    The only solution is to avoid using advanced technologies to use simple things if you want to keep compatible with older browsers.... If the case is all modern browsers only ie11, edge, Firefox, Chrome will depend on whether the technology is implemented in the browser or not. There is no magic formula and not ready for this, the way is going to test how much builds in all browsers to avoid headache.

  • 3

    It depends on the site. What’s on it? If you have Flash or Java it will never be compatible with all. On the other hand you can have a site basically composed of text, in which case it is automatically compatible with all browsers. It also depends on what you mean by compatible. Several websites are readable in all browsers, although they present differences in behavior and visualization. Still, whenever you use something beyond the most trivial, you will always have that user accessing with IE6 or old phone. Summary: there is no solution or hint that works miracles.

3 answers

3

Gilmar , the issue of maintaining compatibility with all browsers is very wide.

About how browsers work:

When you type an address in the navigation bar, click a button that sends a form,links... you send a request (usually using the protocol http) to a server, which understands your request returns the corresponding files .

You can receive several types of files(html,css,xml,javascript,txt.) and the browser will interpret and generate a visual representation of this interpretation.

But he interprets / displays the way he wants ?

Not ! Or at least should not.

There are patterns to be followed and the W3C is the main regulatory organisation.

The browser must generate the content that agent ve the way the pattern specifies !

And in practice ? It really works ?

Na maioria dos casos SIM ! The problem is that time and again, little bits of code can be interpreted differently and zoned everything. In these cases you will have to change or write a specific code for different browsers .

In addition, this pattern changes over time as new technologies and needs emerge .

The early browsers were able to interpret only a simpler and rather coarse version of HTML ! We are entering the era of WEB 3.0 and every time comes a new technology that is supported only by the latest browsers .

And then how to do ?

There are a number of good practices to be followed, usually in the courses and tutorials they will be passed !

It is very common to use plugins , APIS, frameworks.. third party and in such cases it is legal to use those we know are well supported by the major browsers, good examples are Jquery and the wonderful bootstrap .

And my last tip is that as you develop, test the site on the browsers that want compatibility and something coming out different between them , search to find the solution .

  • So for some styles I have to put prefixes (-Moz-, -Webkit- and etc.)

  • 1

    @Gilmarsantos mainly in the novelties of HTML 5 that are still being standardized . Analyzing the top 3 browsers, Chrome and Firefox have walked together and the codes have been well compatible among them ! And Internet Explorer seems to still be in the war of browsers... does not want to support certain codecs , created the own version of the WEBRTC API... and so much will only run in IE and vice versa .

  • 1

    @Gilmarsantos forgot to say that the trend is the need to put the prefixes disappear as the standard is established and the new versions of the browsers are released .

  • I have another question, using some kind of CSS hack can harm the CSS of the site ?

  • 1

    @Gilmarsantos to fix what did not run in a specific browser I see no problems . And ! Used with moderation mportant can be a time saver .

2

Look man Leaving a site compatible for all browsers is not a very easy job because each browser has its own way of working and processing each code: javascript, html, css, etc. But for you to develop a site that will be more likely to work in all/or/large majority of browsers is developing your site following the W3C standard.

What would be the W3C standard? (W3C) is the main standardization organization of the World Wide Web, that is to say it is the standard of the web content, Browsers (Browsers) are made following this standard.

On the W3C website itself you can find tutorials/tips on html/css And if I’m not mistaken they also provide a little tool on the site that you put the URL of your site and check if it is with any error compared to the W3C standard.

I hope you gave it to me so I could get it straight, if that’s what you needed, just mark the answer as: Better Answer. And if you need more information Leave in the comments that I will be editing the question and trying to answer your questions clearly. W3C: www.w3c.br/

  • It would be good if I validate my CSS and html code on the w3c website ?

  • 1

    Yes. Using code aid tools like CSS Lint and Eslint can also give you clues to possible errors. Read the recommendations carefully and try to understand why something should or should not be done in a certain way.

2

A good start to making sure your sites are compatible with the browsers you’re working with (but not with everyone, as this is virtually impossible, especially when it comes to old browsers and mobile devices) is to check the compatibility of the features you intend to use.

A good tool for this is the Can I Use. To Mozilla Developer Network also cites browser compatibility in the documentation pages.

Using a ready-made library also relieves you of the work of dealing with the particularities of each browser in several important features. Jquery, for example, it is widely used to facilitate the use of AJAX and DOM manipulation.

  • 1

    It’s best not to need it, but if you solve your problem, use whatever is available. But make sure you understand why something works and why it doesn’t. Try to understand what is the right way to do it, even if it is not universal, because it guarantees you the future of that code.

Browser other questions tagged

You are not signed in. Login or sign up in order to post.