Apr 22, 2014

Web Programming Style - HTML5 as Layouts and CSS3 as Templates

To learn Web UI Design based on HTML and CSS, you should start from the http://www.w3schools.com/. A good design of web pages, sites and Apps is based on optimal tool integrations of HTML5, CSS3, JavaScript, SQL, Web API, jQuery, etc.
 

CSS (Cascading Style Sheets) / CSS Tutorial
What is CSS (Cascading Style Sheets)?
  • Styles define how to display HTML elements (advanced topic: realize HTML DOM to learn Javascript well!)
  • External Style Sheets stored in CSS files (.css files) are powerful to reuse presentation-style modules in HTML documents
HTML DOM structures (http://upload.wikimedia.org/wikipedia/commons/e/e4/JKDOM.SVG)
A CSS rule set consists of a selector and a declaration block. A CSS comment starts with /* and ends with */.
Apply to HTML files, all text within <h1> tag is blue color .
The HTML elements are corresponding to HTML tags with content located in the DOM tree. After an HTML source code is parsed into elements, the linked .css files will be applied to those elements according to following matching methods.
  • element selector selects elements based on the element name. E.g.  body {background-color: black;}
  • id selector uses the id attribute of an HTML tag (e.g. <h1 id="font_em"> to find the specific element. E.g.  #font_em {font-size: 2em;}
  • class selector finds elements with the specific class (e.g. <h1 class="font_red">). E.g.  .font_red {color: red;}
CSS is referred through three ways as followings. If multiple styles are defined, different property values will be applied. Common property values will be chosen from the more specific style sheet (inline > internal > external > browser default settings).
  • External style sheet: e.g. <head><link rel="stylesheet" type="text/css" href="my.css"></head>
  • Internal style sheet: e.g. <head><style>body {background-image:url("images/background.gif");}</style></head>
  • Inline style: e.g. <p style="color:sienna;margin-left:20px;">This is a paragraph.</p>

HTML5 / HTML Tutorial
HTML (Hyper Text Markup Language) is a language for describing web pages with HTML tags and plain text. Start (e.g. <p>, <h1>, <b>) and end HTML tags (e.g. </p>, </h1>, </b>) are also called opening tags and closing tags. Some empty-content tags, not for containing text, start/end tags can be written in the same place, e.g. <p />, <b /> . All tags should be written in lowercases. HTML elements (tags) can have attributes to provide additional information about the element, e.g. <a href="http://www.w3schools.com">This is a link</a>. Some attributes (id, style, class, title) can be used on any HTML element.
  • Attributes are always specified in the start tag.
  • Attributes come in name/value pairs like: name="value".
  • Attributes should be named with lowercase characters.
Inner anchor (<a id="tips">Tips</a>) can be referred by (<a herf="#tips">Back to Tips</a>) within the same page or outside pages (<a href="http://www.w3schools.com/html_links.htm#tips">
Go to w3schools Tips</a>).


Tips (like a specialist)
  • Often <strong> renders as <b>, and <em> renders as <i>. However, <strong> or <em> means the text to be rendered in a way that the user understands as "important". Although, the rendering results look the same in all major browsers; keep the correct design concept. If a browser one day wants to make a text highlighted with the strong feature, you'll know you do a nice job.
  • href="http://www.w3schools.com/html" vs. href="http://www.w3schools.com/html/": first URL will send two http requests, the first URL and redirect to the second URL.
  • use <div> with CSS to design blocks: http://www.w3schools.com/html/tryit.asp?filename=tryhtml_styles
  • Common use of the <div> element is for page layout. It replaces the "old way" of defining layout using <table> elements. The correct use of <table> and related tags is to display tabular datahttp://www.w3schools.com/html/tryit.asp?filename=tryhtml_layout_divs
  • HTML <span> element is an inline element that can be used as a container for text.
  • Learn how to get your desire color code: http://www.w3schools.com/html/html_colors.asp
  • Realize HTML Entities (reserved character and symbols), HTML Encoding (Character Sets), and URL Encode.
  • The <head> element is a container for all the head elements including: <title>, <style>, <meta>, <link>, <script>, <noscript>, and <base>. The more information you filled in these inside-<head> tags, the more you look like a specialist.
  • Widely used attributes of <meta> tags: 
<meta charset="UTF-8">
<meta http-equiv="Content-Type" content="text/html;charset=ISO-8859-1">
<meta name="keywords" content="HTML, CSS, XML, XHTML, JavaScript">
<meta name="description" content="Web tutorials on HTML and CSS">
<meta name="author" content="ilearnblogger">
<meta http-equiv="refresh" content="5">

No comments :

Post a Comment