HTML5

LocalStorage

LocalStorage in JavaScript: How to To use localStorage in your web applications, there are five methods to choose from: setItem(): Add key and value to localStoragegetItem(): Retrieve a value by the key from localStorageremoveItem(): Remove an item by key from localStorageclear(): Clear all localStoragekey(): Passed a number to retrieve nth key of a localStorage setItem() This method just as the name implies allows you to store values in the localStorage object. It takes two parameters, a key and a value. The key can be referenced later to fetch the value...

Read more...

HTML Tables

HTML Table Example CompanyContactCountryAlfreds FutterkisteMaria AndersGermanyCentro comercial MoctezumaFrancisco ChangMexicoErnst HandelRoland MendelAustriaIsland TradingHelen BennettUKLaughing Bacchus WinecellarsYoshi TannamuriCanadaMagazzini Alimentari RiunitiGiovanni RovelliItaly Defining an HTML Table An HTML table is defined with the <table> tag. Each table row is defined with the <tr> tag. A table header is defined with the <th> tag. By default, table headings are bold and centered. A table data/cell is defined with the <td> tag. Example <table style="width:100%">  <tr>    <th>Firstname</th>    <th>Lastname</th>    <th>Age</th>  </tr>  <tr>    <td>Jill</td>    <td>Smith</td>    <td>50</td>  </tr>  <tr>    <td>Eve</td>    <td>Jackson</td>    <td>94</td>  </tr></table> Note: The <td> elements are the data containers of the table.They can contain all sorts of HTML elements; text, images, lists, other tables, etc. HTML Table - Adding...

Read more...

HTML Images

Images can improve the design and the appearance of a web page. Example <img src="pic_trulli.jpg" alt="Italian Trulli"> Example <img src="img_girl.jpg" alt="Girl in a jacket"> Example <img src="img_chania.jpg" alt="Flowers in Chania"> HTML Images Syntax In HTML, images are defined with the <img> tag. The <img> tag is empty, it contains attributes only, and does not have a closing tag. The src attribute specifies the URL (web address) of the image:<img src="url"> The alt Attribute The alt attribute provides an alternate text for an image, if the user for some reason cannot view it (because of slow connection, an error in the src attribute, or if the user uses...

Read more...

HTML Styles – CSS

Styling HTML with CSS CSS stands for Cascading Style Sheets. CSS describes how HTML elements are to be displayed on screen, paper, or in other media. CSS saves a lot of work. It can control the layout of multiple web pages all at once. CSS can be added to HTML elements in 3 ways: Inline - by using the style attribute in HTML elementsInternal - by using a <style> element in the <head> sectionExternal - by using an external CSS file The most common way to add CSS, is to keep the styles in separate CSS files. However,...

Read more...

HTML Colors

HTML colors are specified using predefined color names, or RGB, HEX, HSL, RGBA, HSLA values. Color Names In HTML, a color can be specified by using a color name: Tomato Orange Dodger Blue Medium Sea Green Gray Slate Blue Violet Light Gray Background Color You can set the background color for HTML elements:Hello World Lorem ipsum dolor sit amet, consectetuer adipiscing elit, sed diam nonummy nibh euismod tincidunt ut laoreet dolore magna aliquam erat volutpat. Ut wisi enim ad minim veniam, quis nostrud exerci tation ullamcorper suscipit lobortis nisl ut aliquip ex ea commodo consequat. Example <h1 style="background-color:DodgerBlue;">Hello World</h1><p style="background-color:Tomato;">Lorem...

Read more...