Showing posts with label HTML5. Show all posts
Showing posts with label HTML5. Show all posts

Tuesday, 23 April 2013

CSS and HTML5: background image in buttons

   


Would you like to do something like:

Or maybe you prefer it another way, like:




They look the same, don't they? However they are a bit different in the making. Let's see how...

The first way to do such thing is to use the <button> tag:
<button>
<img src="http://www.w3.org/html/logo/downloads/HTML5_Logo_32.png" />
</button>
The image is just like any text we usually put inside the tag.


Thursday, 14 March 2013

HTML5: geolocation

   


With HTML5 is now possible to use the target browser in order to determine the location from which the user is accessing the web. It is not, as you may understand, a GPS location (unless the user is surfing from a GPS capable device), but it can be quite interesting in some cases where special services are supplied on a web page.

How can we develop a geolocation service on our web page?

Well, first of all try and see the final effect: go here and enjoy. After that, please get back on the web thought...

First of all let me say that all location services on the target browser must be granted by the user. As you may have noticed by visiting the above live example, the browser has asked you permission for the use of location services (unless you've granted permanent access to your location).

Thursday, 7 March 2013

HTML5: telephone numbers on web pages

   


Every day on TV we hear news saying that most of the people in the world is surfing the web using a mobile device. You are probably reading this very article with your iPhone or Galaxy, or maybe using your favourite tablet.
As many of the above mobile devices are actually capable of making phone calls, we can insert telephone numbers on web page and make them clickable, so that any mobile user will be able to use the link to call the shown number.


Thursday, 25 October 2012

HTML5: video on a web page

   


Using HTML5 in order to display a video on a web page is easy and complex at the same time.
You might wonder why I'm saying so and that's why I wrote the following short guide. We will see the syntax, advantages and disadvantages of using just HTML5 to display videos.



The syntax
Let's start from the HTML syntax:
<video width="800px" height="600px" controls="controls">
  <source src="test1.mp4" type="video/mp4">
  <source src="test2.ogg" type="video/ogg">
Your browser does not support the HTML5 video tag.
</video>
Fairly easy, isn't it? Well, maybe not...

Wednesday, 2 May 2012

JavaScript: asynchronous loading

   


JavaScript is an important part of web developing. We heavily rely on JavaScript library and more than often we use external reference to load js snippets. In order to link an external js file we usually insert the following code where needed:
<script src="http://externalDomain.com/script.js"></script>
If the externalDomain is someway busy or down, our page will hang, waiting for the externalDomain. The page will eventually be loaded and displayed when the resource becomes free. Worst case scenario: the externalDomain stays busy and our page stays completely blank.
There's a solution to the above issue: using asynchronous loading and here I show you how to use it.

Monday, 9 April 2012

CSS: text to path generator with csswarp

   


Today I would like to share an online tool which some of you might find interesting, at least as an clever example on what we could do with CSS3 and HTML5.
But before showing you this "wonder", I would like to spend a few general words and possibly gather your ideas on the matter.

I've recently read that in 2012 there will be an incredible expansion of HTML5 webapp. The use of the not-so-new HTML version will help developers in building specific applications that will work with recent browsers. For what I have seen lately, the most of those new webapp are basically drawing tools. Canvas, trasformation and animation are wisely used in order to allow free hand drawing using only the browser.
In a perfect future, we might end up without desktop applications, while the web will be the place where everyone can find the right tool, when needed.
It is an old idea that I've partially already encountered in a book by Jeremy Rifkin, in the early 2000. People will eventually use software on-demand and they will just pay for the time they use it. That could be the future... the not so far future, as I can see. Following the reasoning, we might just need a pc with a minimum set of system tools, while when we will need to write a document, prepare a spreadsheet or retouch a photo, we will just open the browser and go to the appropriate web site where the application will be always updated and ready to be used. With that in mind, it won't matter which will be our hardware: it could a smartphone, a tablet or a pc. At the same time, it won't matter where we will be - we will just need a data connection.

Monday, 23 January 2012

HTML5: is div dead? Not, really...

   


I must admit I am not a great fan of HTML5. First I've tried to understand the new tags and then I've started using them on new projects, sometimes ago. I even contacted the Doctors on HTML5 Doctor to submit some questions and prepare an interview to be published on the web thought. They were obviously too busy and, even if they initially agreed on the interview, they've never got back to me with the answers.
Anyway, in this short post I will try to explain where the new content formatting tags should be used and how they can replace the div tag... if ever.

Friday, 18 November 2011

HTML: HTML5 new input types

   


HTML5 introduced some new input types with better control and validation. When the features will be completely supported by all main browsers, creating forms will surely be easier and faster.
The new types are:
  • email;
  • url;
  • number;
  • range;
  • dates;
  • color.
As you can see they are quite interesting. Let's take a tour and see how they work.

Wednesday, 14 September 2011

CSS3 and HTML5: Adobe expressive web

   


I've recently stumbled upon an interesting new web site by Adobe: the expressive web (beta). Launched at the beginning of August, it deals with CSS3 and HTML5 in a new and interesting way.

The site explains in details the new features, in a totally interactive and original way. It uses small coloured cubes, which with effective animations, gather to form shapes, explaining in details the effect of those new features.

The expressive web shows examples, browser support, fall back strategies and resources for CSS3:
  • animations;
  • gradients;
  • media queries;
  • shadows;
  • transforms;
  • transitions;
  • web fonts.
As for HTML5:
  • audio;
  • canvas;
  • forms;
  • video;
  • web storage.

I know it is difficult to imagine, following my explanation, how the site is working. It is definetly better to visit it.

Please remember that the site is still in beta, so it might still have things to be adjusted.

Friday, 26 August 2011

HTML5: The importance of !DOCTYPE

   


As our beloved W3C site states:
"When authoring document is HTML or XHTML, it is important to Add a Doctype declaration."
And you perfectly know why... don't you?
Ok... for those of you that don't know why, here's the explanation:
"There is not just one type of HTML, there are actually many: HTML 4.01 Strict, HTML 4.01 Transitional, XHTML 1.0 Strict, and many more. [...] Why specify a doctype? Because it defines which version of (X)HTML your document is actually using, and this is a critical piece of information needed by some tools processing the document. [...] with most families of browsers, a doctype declaration will make a lot of guessing unnecessary, and will thus trigger a "standard" rendering mode."
As you can see it's definitely not trivial. But why am I talking about it? Well, it has to do with HTML5.

Friday, 10 June 2011

HTML5: the progress element

   


Progress bars have always been a needed element in web applications. Every time a user sends requests to the server, it is quite usual that some sort of immediate response is needed, just to make the user aware that something's really happening and that the whole application is not just frozen. In the past, we used JavaScript and CSS to show some sort of progress bar. We usually used animated gifs like
and many sites still use those kind of solutions.
With HTML5, a new element has been introduced. It is progress and it will give us a new way to show the user that something's really going on after that button has been pressed.
"The HTML progress (<progress>) element is used to view the completion progress of a task. While the specifics of how it's displayed is left up to the browser developer, it's typically displayed as a progress bar." (quote from Mozilla Developer Network).

Friday, 13 May 2011

HTML5 & CSS3: compatibility issues

   


HTML5
In the past weeks, I have posted different articles about HTML5 and CSS3. In almost every one of them, we ended up describing the possible compatibility issues we might face implementing new features and solutions offered by the two standards. As a start, I would like to share some thoughts about the use of HTML5 and CSS3.

CSS3
a) Do we really need them?  What I am saying is that we do not really want to use new features just because they are cool and they make us great web designers. We need to understand when new stuff really serves our purposes. If it’s only a matter of style – believe me – it is not worth it.
b) Are we ready for possible non standard solutions? In the past when HTML or CSS couldn’t help us with a specific effect, we looked for help with JavaScript. Today it is the same: Modernizr, CSS3 PIE or Selectivzr can really help us in dealing with compatibility issues. That might affect site speed and usability.
c) Are HTML5 and CSS3 the future? Well, this is difficult to answer. It is my personal opinion that they will be. It is decided – someway.
d) Are HTML5 and CSS3 really helping us? Before the (slow) introduction of the new standards, we were used to find alternative solutions (as said just before). HTML5 and CSS3 were conceived to help us in creating astonishing new web site in an easier way. With compatibility issues, we are actually back to square one: we need possibly more workarounds to ensure that – almost – every possible user will be able to use our web site the way it was meant to. That means more work just for possibly not necessary embellishments.

Wednesday, 6 April 2011

HTML5 and Internet Explorer 8: not good friends

   


With the gradual introduction of HTML5 new tags, web developers have questioned its use because of compatibility issues. I've already explained that with new elements you might always have troubles. Personally, what makes me really mad is not knowing exactly what will happen when I use HTML5. Will the web site look as I thought? Will it always look and behave as I see it in my testing browsers?

There's another thing to be considered: the future of internet will be "mobile". We've already noticed that the most used word when talking about the future internet is "mobile". Everything's going mobile. New technologies and new devices are capable of surfing the internet with mobile applications. I'm thinking about smartphones or tablets (prominent market analists think that 2011 and 2012 will be tablet years).

Said that, it is quite clear that web developers will have to (or should have already) start to develop sites and applications in a different way and use HTML5 new features. We should consider the way an iPhone user will see a web site. Possibly we will have to create a standard version and a mobile version of the sites - if we don't want to let mobile users go away or maybe even never reach our homepage.

To get to the point, it's been quite a while since I've started to look around to gather information regarding HTML5. It is quite known that Internet Explorer and HTML5 are not very good friends. Actually, IE doesn't even consider HTML5 new elements. That could be a big problem. But there's a workaround!

Wednesday, 9 March 2011

Browser statistics: which is the most popular browser?

   


When publishing recent post on CSS3 and HTML5, I started wondering about browser compatibility. What's the point in using state of the art technologies when - potentially - only few browsers can benefit from it?
Recently some well known blogs have published statistics about browsers popularity and so I thought I should share some thoughts about it.

Monday, 21 February 2011

HTML 4.01 & HTML 5: deprecated and not supported tags

   


As you may already know we are near the introduction of HTML 5, even if it is not a W3C recommendation yet. It is quite clear that browsers will not stop understanding HTML 4.01 tags, probably for a long time, however it is time to start thinking about what will be or it is already deprecated in HTML 4.01 and HTML 5. The new version will improve "interoperability and reduce development costs by making precise rules on how to handle all HTML elements, and how to recover from errors.
Some of the new features in HTML5 are functions for embedding audio, video, graphics, client-side data storage, and interactive documents. HTML5 also contains new elements like <nav>, <header>, <footer>, and <figure>.
The HTML5 working group includes AOL, Apple, Google, IBM, Microsoft, Mozilla, Nokia, Opera, and many hundreds of other vendors." (quoted from W3C web site)
That is actually very interesting, but it could pose some issues. In fact, if you think about the code you wrote in the past years, it could be that many times you used already deprecated tags. That means you should go back and change all your code. HTML 5 ready browsers will continue to interpret old tags, otherwise millions of web sites would stop working correctly. And nobody wants that to happen.
So, you can still sleep tight, however it is important to know what will happen.