Category Archives: html5
Mobile device emulator as Chrome Browser extension
If you are a mobile application developer, then it would have been always a quest to find the devices to test the applications. Apart from that, one need particular environments to develop the application too. Some device applications can be developed and tested in particular Operating system. Then there are HTML5 and JS frameworks and tool kits to develop mobile applications. These frameworks and toolkits allow one to develop applications as web applications. While this option, opens up the opportunity to develop mobile applications in any environment, there is still a lot of work to do, when it comes to test these applications in various mobile devices.
Ripple is an extension to Chrome browser. I think this can not be more easier than this. Once installed, the interface is quite straight forward. Well the process goes like this. If you are in a webpage (any webpage), just right click and say
Emulator > Enable
That will render the webpage in a mobile device, there are choices to configure the devices also. That means, any web application can be tested with a number of device emulators, right in the browser itself. There are options for Device, Platform, Accelerometer along with a lot more.
I think this can not get easier than this.
Getting into web design action
Once we are familiar with the key concepts of the web, browser and how it works, now its time to see how to get started with it. If you have not yet gone through them, here are the links,
1. introduction
2. getting used to the terms
I hope by now you have gone through the above links. This is not mandatory, but then going through them will bring you to the same page with me. Else it will be a little difficult for any one to understand what is being referred in the tutorial here.
Well, lets get into action. By now, you must be knowing to start with a web-page we at least need 3 files (Not mandatory but good way to segregate different functionality in different files, refer to the “getting used to the terms” reference for more on this ). So the 3 files are, one HTML file, one Javascript file and one CSS file. We will start to put the basic code for these.
The HTML file is stored with an extension of “.html”, CSS files are stored as “.css” and javascript files are stored as “.js” files. Lets write our first html file.
The very basic HTML page code will look something like
< !DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
javascript library for converting SWFs to HTML/CSS3
When HTML and CSS3 are really catching up, its the animations which need a way to go to the web without flash plugin. Fortunately we have some very promising javascript libraries out there which does this. The two must mention libraries are
Gordon : http://github.com/tobeytailor/gordon/wiki
Smoke Screen : http://smokescreen.us/
While Adobe showed a tool on this years MAX, 2 days back, which converts FLA animations to HTML5/CSS3, its time to wait and watch, when people will have access to the tool.
Are you still thinking what HTML5 can do!
The less I say about Joshua Davis, the better. All his works speak or himself. The recent release project of his called “the endless mural” , is the technological and artistic extremes again. This is kind of a wakeup call for people who think, HTML5 is just a good topic to talk about. Go straight away to http://www.endlessmural.com/ for an experience of the project. The excitement is just not on the technological or artistic part, its the company involved in it too. Watch out the video for the details.
Getting used to the terms
Hope you guys are with me from the last tutorial. Lets move on and see what are things or terms we will deal with in a regular basis as a web designer/developer. There will be a lot of new words you will come across if you are starting up new to the web technology. In HTML5 there are going to be new APIs! Well, what API means. API in its fullest form is Application Programming Interface. I know. Hang on to understand. If terms like this frighten you from getting into a new technology, do not hesitate to join a local group, online forum or search for it in internet, or even ask me, I will try my best as per my understanding to make you understand. In a very rough term, API means there are some predefined key words, available to do certain things. Like, we have “<body>” in html to define the body section of a webpage. Similarly each programming/scripting language has its own set of APIs to define certain things. If we take another example, “gotoAndStop()” is available in Flash/actionscript. This simply takes the play head to a certain place in a flash movie. Now for any new language, one need to learn its API to get going in it. In coming days we will be learning what are the new APIs available to HTML5. Now CSS is another word. Lets understand how and why. If you have already desinged a couple of sites in HTML, then you must be knowing some of its styling. If you are new to web, just understand that its a way to separate content and its style. Style can be background colour of a webpage, font colour, type, size etc. So CSS, basically allows us to define all these styles in a different file and our web content remains in a different file. There are ways to link the style file with the content file. The advantage is, our content is no more linked to its design. We can take the same CSS file and apply all our styles to another HTML page, which will look and feel like the same site we desinged previously.There are things like “<div>” in an HTML document. These elements define the structural difference of elements. We can put similar type of content in a particular div. If things seems diffficult to understand now, do not worry, just remember the terms we will be using them soon. Each <div> element is associated with an id or class, this is just for us to refer to that particular section of the page. In CSS files we declare styles for these div elements by refereing to their id or class. And once we attach a CSS to an HTML page, the page reads the style and renders itself. Javascsript, is a scripting language for the web. How it can be used?! This is a nice question and must be understood for moving ahead in HTML. Like CSS can be defined in another file, Javascript also can be defined in another file and attached to an HTML page. This again, makes our content to be alone. All we have is an HTML page with desired content in it. All the style elements are in a CSS file and all the behaviours are in an external Javascript file. Behaviours include rollover a button or image or a certain part of a page, to clicking the button. Everything a user does with the page and how the page reacts to the user can be defined in a javascript file. So in a basic web page, we should be having 3 files atleast. An HTML file, a CSS file and a Javascript file. That way, a content editor will change the contents as per his/her requirement, never worrying about the design or behaviour of the page. A pure CSS designer can update the design of the page individually with some dummy content. And a javascript developer can start putting in logics inside a separate file without thinking of breaking the page design or content. When one is designing for the web, one must be aware of all these as to get the best out of everything.
Introduction to HTML
Before jumping directly into HTML5 and CSS3, it is important to understand, why and what is it. For that lets talk a little about HTML and browser. HTML is a set of instructions written in a difined way. The browsers know, how to understand these instructions. Depending upon these instructions browsers try and display the content. Well, then how these browsers understand these instructions?! This is an important question. The answer is simple, there are instructions written inside the browser itself to read the instructions of the page and understand it how/what to display. Now the question is, ” where it is written, how to write these instructions?” It is W3C, who used to do it for a long time. Then its moved to WHATWG (Web Hypertext Application Technology Working Group). If you visit WHATWG site, there is link toward the end of the home page, which shows what is the relation between W3C and WHATWG. The direct answer to the question is here, in the FAQ section of WHATWG website.
Now coming back to the instructions and how to write it. There are specifications for different types and versions of HTML. Basically there are 2 kinds of instructions one is based on only HTML standard and one is based on HTML and XML standards. So the names are HTML and XHTML. The versions of HTML are version 1.0, 2.0, 3.0, 3.2, 4.01 and then came XHTML1.0 and followed by XHTML 1.1 and XHTML 2.0. There are further more to add to this confusion are 3 different versions of each specification. Do not get scared, just read on. These different options are Strict, Transitional and Frameset. So the HTML instruction version could be HTML 4.01 Strict, HTML 4.01 Transitional, HTML 4.01 Frameset, XHTML 1.0 Strict, XHTML 1.0 Transitional, XHTML 1.0 Frameset. All these versions have there own instruction set as to, how to write an HTML instruction. The part of this specification is, a detailed information about the structure of the HTML instruction as to where and how to write the instructions. This structural information is know as Document Type Definition, in short DTD of that specification.
HTML 3.0 specification
HTML 4.01 specification
XHTML 1.0 Specification
XHTML 2.0 Specification
HTML5 specification
CSS3 specification
A must read, which shows a little inside of browser implementations of the specification, if you read about the HTML version 3. A little history of HTML versions. By this time you must be getting an idea of relations between specification,browser and their behaviour.
Well, enough of this, lets move on to browsers and see how these specifications affect us. As we already have known that browsers can read our HTML instruction and display the content, the thing to remember here is different browsers understand these instructions differently. Thats because there are different logics put inside different browsers. These processing of the instruction is done by the part of the browser know as browser engine. This is basically the part which understands the HTML instruction and tells other part of the browser, how to go ahead for the instruction received. Previously these engines were kind of one per browser, but now these engines are also getting specific as to their implementation and responsibility, browser displaying engine, javascript engine etc. Lets consider the browser engine and see how specifications affect it. Since there are different browser engines to process one single set of instructions, there are different kind of behaviour happening in different browsers for the same HTML page. Now, I think, it makes sense to you as to why your html page looks different in 2 different browsers
Since HTML 4.01, CSS (Cascading Style Sheets) are introduced, more on it later. The browser vendors like Safari, Opera, Firefox, Internet Explorer update their engines to support new features according to the new specifications. Now you must see the reason, why there are different updated versions are coming for the same browser. Well, so the point is, if specification is updated to a new standard (supporting new feature), browser vendors must update their browser engine to support the specification so that a web designer using the latest specification can use the new browser to see it in action. There is always a race between the browsers as to who supports the new specification and to what level. Now as we see, there are browser enhancements happening, the browser vendors sometimes put their innovation into action by supporting some features, which might not be in the specification but their own choice to support. There comes the difference in the support for features. So when we see something is supported in a particular browser, and not supported in another browser, there might be a chance that each browser is having their own features or may be all the specifications are not yet implemented in a particular browser.
Coming back to CSS, its basically putting all our style definitions into a different file and saving it as .css extention. Thatway, any change to the content in the HTML page, does not affect us to re-write the styles and the same styles can be applied to different pages. Since these styles can be combined together, its known as cascading of styles and so the name, cascading style sheet. Similarly one can put javascript in a different file and link it to the html document, this is just to add behaviour to our html pages. We will be covering that more on coming days. Like HTML instruction processing, different browser owners make their own javascript processing engine and layout or style processing engines. Since implementation of these different kind of engines are different we generally get different behaviour on different browsers. All these CSS, javascsript have their own version specifications too like HTML. Now, it should be getting clear as to what web technology is and how easily browsers are hiding all these complexities inside themselves. Seems intereting ? Yes, its a lot of interesting things going on.
Now, coming back to our original discussion, HTML5 and CSS3, now probably it is a little clear to you as to what it is? Its basically the next version of HTML specification and CSS specification. Since there were no updation to the HTML for a long time, no browser updated it, till now in that area, we were kind of living with the older technologies for a long time. But things are changing very fast. The HTML5 specification is still a draft, that means its not finalised yet. Still the browser owners are putting their efforts to support all these draft specifications. That means, browsers are constantly updating themselves to support new features in the specification, even though these specifications are just ideas, which may or may not be in the final version of the HTML5. Same thing is happening for CSS3, there are new features and specifications coming up and browsers are trying to catch up.
Does that mean we should try HTML5, CSS3 or ignore it till the specifications are final. well, the decision is yours but then with this fast changing technology age, you never know what could come up next. So its better to be trying out new things. All most all major browsers support HTML5 and CSS3 upto certain level, so there is a good chance that we can leverage the ability of the technology while going forward.
Would love to listen your comments and feedbacks.
Where are my blog design gone?
There seems to be something wrong in this blog!! Really! Well, the images and styling are all gone!
This is not accident but intentional. I have started porting my blog to HTML5 . Yeah, you heard it right. For those of you asking me to learn HTML5, lets start here. You can right click on the page and view source. That way, you can go through the HTML5 tags. Do not worry, if things look similar/different to/from previous version of HTML. I will be posting updates and tutorials about HTML5 and CSS3 here only. Stay tuned.