SlideShare uma empresa Scribd logo
1 de 35
Basic Programming Part 1:

    HTML & CSS




<WEB NINJA/>
                                              Alfi Rizka T.
                                        alfi@dedicated-it.com
                      FB: fb.com/avikaco | twitter : @avikaco
TODAY AGENDA
 •   How to be a HTML & CSS Ninja?
 •   Tools
 •   Understanding HTML
 •   Understanding CSS
 •   DEMO
 •   Design Psychology
 •   Resources
 •   QA?
 •   TRY your self: create your own website.



<WEB NINJA/>
                                                                  Alfi Rizka T.
                                                            alfi@dedicated-it.com
                                          FB: fb.com/avikaco | twitter : @avikaco
HOW TO BE A
 HTML & CSS NINJA?



<WEB NINJA/>
                                       Alfi Rizka T.
                                 alfi@dedicated-it.com
               FB: fb.com/avikaco | twitter : @avikaco
TOOLS


<WEB NINJA/>
                                       Alfi Rizka T.
                                 alfi@dedicated-it.com
               FB: fb.com/avikaco | twitter : @avikaco
• IDE (Dreamweaver / Zend Studio / Notepad++ / etc)
• Web Browser + Firebug / Developer
  Toolbar
• Zen Coding (code.google.com/p/zen-coding/)
• LESS CSS (lesscss.org)
• SimpLESS       (wearekiss.com/simpless)

• SpritePad (pritepad.wearekiss.com)




TOOLS
                                                                    Alfi Rizka T.
                                                              alfi@dedicated-it.com
                                            FB: fb.com/avikaco | twitter : @avikaco
HTML
      (HYPERTEXT MARKUP LANGUAGE)




<WEB NINJA/>
                                                  Alfi Rizka T.
                                            alfi@dedicated-it.com
                          FB: fb.com/avikaco | twitter : @avikaco
HTML TIMELINE
1991 : HTML
1994 : HTML 2
1996 : CSS 1 + Javascript
1997 : HTML 4
1998 : CSS 2
2000 : XHTML
2002 : Tableless web design era
2005 : Asynchronous JavaScript and XML (AJAX)
2009 : HTML 5


HTML
                                                       Alfi Rizka T.
                                                 alfi@dedicated-it.com
                               FB: fb.com/avikaco | twitter : @avikaco
What is Doctype?
Doctype is a pre-defined string that is used to tell a client’s web browser what
type of code will be contained in the file.


4 doctype most frequently used
• HTML 4.01 Strict
   <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN"
   "http://www.w3.org/TR/html4/strict.dtd">

• HTML 4.01 Transitional
   <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
   "http://www.w3.org/TR/html4/loose.dtd">

• XHTML 1.0 Strict
   <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
   "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">

• HTML 5
   <!DOCTYPE HTML>




HTML
                                                                            Alfi Rizka T.
                                                                      alfi@dedicated-it.com
                                                    FB: fb.com/avikaco | twitter : @avikaco
What New in HTML 5
• CSS3 and many new & extended Javascript API.
•   More than 50 new tags & attribute (@see http://www.w3.org/TR/html5-diff/).
•   Scalable Vector Graphic (SVG) & Canvas support
•   Web GL
•   GeoLocation
•   New form input type (date, time, number, range, email, etc) and native input
    validation
•   Drag and Drop
•   Video and Audio
•   Query Selector
•   Local Storage
•   App Cache
•   Much more……
                      When HTML 5 will be final release?
                                       click here



HTML
                                                                                Alfi Rizka T.
                                                                          alfi@dedicated-it.com
                                                        FB: fb.com/avikaco | twitter : @avikaco
Basic Structure HTML Tags
<!DOCTYPE HTML>
<html lang="en-US">
<head>
  <meta charset="UTF-8">
  <title>HTML &amp; CSS Ninja</title>
</head>
<body>

</body>
</html>




HTML
                                                                Alfi Rizka T.
                                                          alfi@dedicated-it.com
                                        FB: fb.com/avikaco | twitter : @avikaco
Basic Structure HTML Tags



                                 text node


 <a href="#ninja-div"> Goto Ninja </a>
          property

                     element




HTML
                                                       Alfi Rizka T.
                                                 alfi@dedicated-it.com
                               FB: fb.com/avikaco | twitter : @avikaco
Understanding href Attribute
•   Beginning with protocol (eg: http / ftp / mailto / etc)
•   Beginning with sharp # (eg: #bottom)
•   File name (eg: index.php)
•   Beginning with single slash (eg: /main)
•   Beginning with double slash (eg: //api.google.com/maps)




HTML
                                                                 Alfi Rizka T.
                                                           alfi@dedicated-it.com
                                         FB: fb.com/avikaco | twitter : @avikaco
HTML COMMON MISTAKE
WRONG
<span>
  <div>Hello Ninja.</div>
</span>
<p>
  Hello
  <p>Ninja.</p>
</p>

CORRECT
<div>
  <span>Hello Ninja.</span>
</div>
<p>Hello</p>
<p>Ninja.</p>




HTML
                                                      Alfi Rizka T.
                                                alfi@dedicated-it.com
                              FB: fb.com/avikaco | twitter : @avikaco
HTML COMMON MISTAKE
WRONG
<a href=“index.html?get=ini&itu” title=“link “ title”>
  Hello Ninja.
</a>

CORRECT
<a href=“index.html?get=ini%26itu” title=“link &quote; title”>
  Hello Ninja.
</a>




HTML
                                                                    Alfi Rizka T.
                                                              alfi@dedicated-it.com
                                            FB: fb.com/avikaco | twitter : @avikaco
CSS
       (CASCADING STYLE SHEETS)




<WEB NINJA/>
                                                   Alfi Rizka T.
                                             alfi@dedicated-it.com
                           FB: fb.com/avikaco | twitter : @avikaco
ALL YOU HAVE TO KNOW ABOUT CSS
1. All browser have different standard for each html element, that why you
   need reset.css
2. Urutan embed file CSS berpengaruh
3. No space on name of CSS rule (use underscrore or dash),
   eg: #main-menu, #logo_wrapper
4. Whitespace has no effect in CSS file parsing
5. Default CSS position: absolute will be relative to <BODY>
6. All document (import css, bg image, font-face, etc) that loaded from CSS file
   is relative path to css file.
7. You can set specific media target by adding attribute
   media=“all/screen/print/projector”
8. CSS3 support animation, gradient, multiple background, and much more.




CSS
                                                                           Alfi Rizka T.
                                                                     alfi@dedicated-it.com
                                                   FB: fb.com/avikaco | twitter : @avikaco
BASIC CSS CODE
h1 {
   margin: 0 0 0 1em; /* 1em = 16px = 12 pt = 100% */
   font-size: 1.5;     /* default = em */
   letter-spacing : +2pt;
}
#site-logo {
   width: 200px;
   height: 80px;
}
.important {
   color: red;/* #F00 or #FF0000 or rgb(255,0,0) or rgba(255,0,0,1)*/
}
.border-radius {
   border-radius: 4px;           /* W3C */
   -webkit-border-radius: 4px; /* Webkit = Chrome / Safari */
   -moz-border-radius: 4px;      /* Firefox */
}



CSS
                                                                    Alfi Rizka T.
                                                              alfi@dedicated-it.com
                                            FB: fb.com/avikaco | twitter : @avikaco
BASIC CSS CODE

margin: 10px;

/* equal with */
margin: 10px 10px 10px 10px;
/* top right bottom left */

/* equal with */
margin-top:         10px;
margin-right:       10px;
margin-bottom:      10px;
margin-left:        10px;



CSS
                                                       Alfi Rizka T.
                                                 alfi@dedicated-it.com
                               FB: fb.com/avikaco | twitter : @avikaco
BASIC CSS CODE

background: url(bg.png) #f90 repeat-x 0 10px;

/* equal with */
background-color:      #f90;
background-image:      url(bg.png);
background-repeat:     repeat-x;
background-position:   0 10px;




CSS
                                                       Alfi Rizka T.
                                                 alfi@dedicated-it.com
                               FB: fb.com/avikaco | twitter : @avikaco
HOW TO LOAD CSS TO HTML FILE
1. Use inline HTML tag (very-very not recomended)
   <div style=“font: „arial black‟ 40pt/60pt;color:red”>Hello World</div>


2. Using @import (not recomended)
   <style type='text/css' media='all'>
     @import url('style.css');
   </style>


3. Embed to HTML file (not recomended)
   <style type='text/css' media='all'>
      #logo{text-indent:-5000px}
   </style>



4. Use link tag
   <link rel=“stylesheet” type=“text/css” media=“all” href=“style.css” />




CSS
                                                                            Alfi Rizka T.
                                                                      alfi@dedicated-it.com
                                                    FB: fb.com/avikaco | twitter : @avikaco
UNDERSTANDING CSS POSITION

  (x = 0, y = 0)




                   Browser visible area




CSS
                                                                  Alfi Rizka T.
                                                            alfi@dedicated-it.com
                                          FB: fb.com/avikaco | twitter : @avikaco
UNDERSTANDING CSS POSITION




      #container {
        width: 980px;
        margin: 40px auto;
        background: #FFF;
      }




CSS
                                                     Alfi Rizka T.
                                               alfi@dedicated-it.com
                             FB: fb.com/avikaco | twitter : @avikaco
UNDERSTANDING CSS POSITION

                                          #sticky {
                                            width: 200px;
                                            position: absolute;
                                            top: 100px;
                                            right: -60px;
                                          }




      #container {
        width: 980px;
        margin: 40px auto;
        background: #FFF;
      }




CSS
                                                     Alfi Rizka T.
                                               alfi@dedicated-it.com
                             FB: fb.com/avikaco | twitter : @avikaco
UNDERSTANDING CSS POSITION

         (x = 0, y = 0)       #sticky {
                                width: 200px;
                                position: absolute;
                                top: 100px;
                                right: -60px;
                              }




      #container {
        position: relative;
        width: 980px;
        margin: 40px auto;
        background: #FFF;
      }




CSS
                                                           Alfi Rizka T.
                                                     alfi@dedicated-it.com
                                   FB: fb.com/avikaco | twitter : @avikaco
UNDERSTANDING CSS SPRITE



Normal
Hover
Active/clicked
Current




CSS
                                           Alfi Rizka T.
                                     alfi@dedicated-it.com
                   FB: fb.com/avikaco | twitter : @avikaco
UNDERSTANDING CSS SPRITE
Normal
Hover
Active/clicked
Current



HTML                                     CSS
<ul id="main">                           #main{
  <li>                                   margin:0;padding:0;list-style:inside
      <a href="#" id="home">Home</a>     none;height:40px}
  </li>                                  #main li{
  <li>                                   display:block;float:left;margin:0}
      <a href="#" id="store">Store</a>   #main li a {
  </li>                                  display:block;width:120px;height:40px;
  <li>                                   Background:url(apple.png) top left;
      <a href="#" id="mac">MAC</a>       Text-indent:-5000px;
  </li>                                  }
  <li>                                   #main li a:hover {}
      <a href="#" id="ipod">iPod</a>     #main li a:active,
  </li>                                    #main li a:focus {}
  /* ... More ... */                     #main li a.current{}
</ul>




CSS
                                                                        Alfi Rizka T.
                                                                  alfi@dedicated-it.com
                                                FB: fb.com/avikaco | twitter : @avikaco
All you have to know about CSS sprite
• Tidak boleh ada gambar yang saling timpa
• Ukuran sprite item kalo bisa sama untuk semua item, agar mempermudah
  perhitungan background position
• Element yang bisa menggunakan sprite hanya yang
   display: block / inline-block
• BIASANYA (bukan berarti tidak bisa) sprite image tidak bisa digunakan
  untuk repeat bg




CSS
                                                                         Alfi Rizka T.
                                                                   alfi@dedicated-it.com
                                                 FB: fb.com/avikaco | twitter : @avikaco
UNDERSTANDING GRID SYSTEM
•   960 Grid System (960.gs)
•   Blueprint CSS (blueprintcss.org)
•   Twitter Bootstrap (twitter.github.com/bootstrap)
•   Yahoo User Interface (developer.yahoo.com/yui)
•   Etc..




CSS
                                                                               Alfi Rizka T.
                                                                         alfi@dedicated-it.com
                                                       FB: fb.com/avikaco | twitter : @avikaco
DEMO
      Undestanding Column and Row




CSS
                                                       Alfi Rizka T.
                                                 alfi@dedicated-it.com
                               FB: fb.com/avikaco | twitter : @avikaco
DESIGN
   PSYCHOLOGY


<WEB NINJA/>
                                       Alfi Rizka T.
                                 alfi@dedicated-it.com
               FB: fb.com/avikaco | twitter : @avikaco
<WEB NINJA/>
                                       Alfi Rizka T.
                                 alfi@dedicated-it.com
               FB: fb.com/avikaco | twitter : @avikaco
RESOURCES


<WEB NINJA/>
                                       Alfi Rizka T.
                                 alfi@dedicated-it.com
               FB: fb.com/avikaco | twitter : @avikaco
HTML & CSS RESOURCES
• W3 (www.w3.org)
•   validator.w3.org
•   HTML5 Rock (www.html5rocks.com )
•   beta.html5test.com
•   html5readiness.com
•   caniuse.com
•   quirksmode.org
•   html5doctor.com
•   ishtml5readyyet.com




RESOURCES
                                                               Alfi Rizka T.
                                                         alfi@dedicated-it.com
                                       FB: fb.com/avikaco | twitter : @avikaco
QUESTIONS?


<WEB NINJA/>
                                       Alfi Rizka T.
                                 alfi@dedicated-it.com
               FB: fb.com/avikaco | twitter : @avikaco
THANKS


<WEB NINJA/>
                                       Alfi Rizka T.
                                 alfi@dedicated-it.com
               FB: fb.com/avikaco | twitter : @avikaco

Mais conteúdo relacionado

Mais procurados

Cufon - Javascript Font Replacement
Cufon - Javascript Font ReplacementCufon - Javascript Font Replacement
Cufon - Javascript Font Replacement
Dave Ross
 
09-10-2012-getting-started-with-word-press
09-10-2012-getting-started-with-word-press09-10-2012-getting-started-with-word-press
09-10-2012-getting-started-with-word-press
Jerome Miller
 
GDI WordPress 4 January 2012 (white)
GDI WordPress 4 January 2012 (white)GDI WordPress 4 January 2012 (white)
GDI WordPress 4 January 2012 (white)
pamselle
 

Mais procurados (19)

Websites On Speed
Websites On SpeedWebsites On Speed
Websites On Speed
 
Before you build a website 2015
Before you build a website 2015Before you build a website 2015
Before you build a website 2015
 
Selfish Accessibility — WordCamp Europe 2017
Selfish Accessibility — WordCamp Europe 2017Selfish Accessibility — WordCamp Europe 2017
Selfish Accessibility — WordCamp Europe 2017
 
Fabulous Freebies
Fabulous FreebiesFabulous Freebies
Fabulous Freebies
 
Fringe Accessibility: A11y Camp Toronto 2015
Fringe Accessibility: A11y Camp Toronto 2015Fringe Accessibility: A11y Camp Toronto 2015
Fringe Accessibility: A11y Camp Toronto 2015
 
Getting Started with WordPress Development
Getting Started with WordPress DevelopmentGetting Started with WordPress Development
Getting Started with WordPress Development
 
Hitchhiker's Guide to Web Standards
Hitchhiker's Guide to Web StandardsHitchhiker's Guide to Web Standards
Hitchhiker's Guide to Web Standards
 
Mind your lang (for role=drinks at CSUN 2017)
Mind your lang (for role=drinks at CSUN 2017)Mind your lang (for role=drinks at CSUN 2017)
Mind your lang (for role=drinks at CSUN 2017)
 
Wordpress for Newbies 2010-03-27
Wordpress for Newbies 2010-03-27Wordpress for Newbies 2010-03-27
Wordpress for Newbies 2010-03-27
 
Cufon - Javascript Font Replacement
Cufon - Javascript Font ReplacementCufon - Javascript Font Replacement
Cufon - Javascript Font Replacement
 
2015 rubyconf - 百大媒體網站從 Wordpress 到 Rails 的大小事
2015 rubyconf - 百大媒體網站從 Wordpress 到 Rails 的大小事2015 rubyconf - 百大媒體網站從 Wordpress 到 Rails 的大小事
2015 rubyconf - 百大媒體網站從 Wordpress 到 Rails 的大小事
 
Typography For The Web
Typography For The WebTypography For The Web
Typography For The Web
 
Functional Web Apps with WebMachine Framework - Mikhail Bortnyk
Functional Web Apps with WebMachine Framework - Mikhail BortnykFunctional Web Apps with WebMachine Framework - Mikhail Bortnyk
Functional Web Apps with WebMachine Framework - Mikhail Bortnyk
 
PHP Without PHP—Automattic
PHP Without PHP—AutomatticPHP Without PHP—Automattic
PHP Without PHP—Automattic
 
Coffee & Pi - Fall into Pi
Coffee & Pi - Fall into PiCoffee & Pi - Fall into Pi
Coffee & Pi - Fall into Pi
 
09-10-2012-getting-started-with-word-press
09-10-2012-getting-started-with-word-press09-10-2012-getting-started-with-word-press
09-10-2012-getting-started-with-word-press
 
GDI WordPress 4 January 2012 (white)
GDI WordPress 4 January 2012 (white)GDI WordPress 4 January 2012 (white)
GDI WordPress 4 January 2012 (white)
 
All you need is front
All you need is frontAll you need is front
All you need is front
 
let's talk web standards
let's talk web standardslet's talk web standards
let's talk web standards
 

Destaque

Background on the civil war
Background on the civil warBackground on the civil war
Background on the civil war
AlleyDj
 
Social networking-presentation2601
Social networking-presentation2601Social networking-presentation2601
Social networking-presentation2601
Maadhav Maaxy
 
Generals of civil war
Generals of civil warGenerals of civil war
Generals of civil war
AlleyDj
 
Ch. 8 Supplement
Ch. 8 SupplementCh. 8 Supplement
Ch. 8 Supplement
KellyRapp
 
Educational Psychology Overview
Educational Psychology OverviewEducational Psychology Overview
Educational Psychology Overview
KellyRapp
 
No bully keynote presentation
No bully keynote presentationNo bully keynote presentation
No bully keynote presentation
Martin Dunn
 
Modification of Curriculum Instruction and Activities For the Gifted
Modification of Curriculum Instruction and Activities For the GiftedModification of Curriculum Instruction and Activities For the Gifted
Modification of Curriculum Instruction and Activities For the Gifted
Myamor Estrella
 
Apr 2007_SK Corp Earnings Forecast for FY 2007
Apr 2007_SK Corp Earnings Forecast for FY 2007Apr 2007_SK Corp Earnings Forecast for FY 2007
Apr 2007_SK Corp Earnings Forecast for FY 2007
Alfred Park
 
Dollar General - Burlington, CO - OM
Dollar General - Burlington, CO - OMDollar General - Burlington, CO - OM
Dollar General - Burlington, CO - OM
Brian Bailey
 
Khilafat Magazine Issue 5
Khilafat Magazine Issue 5Khilafat Magazine Issue 5
Khilafat Magazine Issue 5
Khilafat
 

Destaque (20)

Background on the civil war
Background on the civil warBackground on the civil war
Background on the civil war
 
Heart
HeartHeart
Heart
 
デジタルサイネージメモ
デジタルサイネージメモデジタルサイネージメモ
デジタルサイネージメモ
 
Social networking-presentation2601
Social networking-presentation2601Social networking-presentation2601
Social networking-presentation2601
 
©
©©
©
 
Generals of civil war
Generals of civil warGenerals of civil war
Generals of civil war
 
Ch. 8 Supplement
Ch. 8 SupplementCh. 8 Supplement
Ch. 8 Supplement
 
There is only...
There is only...There is only...
There is only...
 
Using Symbols
Using SymbolsUsing Symbols
Using Symbols
 
Educational Psychology Overview
Educational Psychology OverviewEducational Psychology Overview
Educational Psychology Overview
 
No bully keynote presentation
No bully keynote presentationNo bully keynote presentation
No bully keynote presentation
 
スマート家電プロダクト案
スマート家電プロダクト案スマート家電プロダクト案
スマート家電プロダクト案
 
Modification of Curriculum Instruction and Activities For the Gifted
Modification of Curriculum Instruction and Activities For the GiftedModification of Curriculum Instruction and Activities For the Gifted
Modification of Curriculum Instruction and Activities For the Gifted
 
Web Ninja
Web NinjaWeb Ninja
Web Ninja
 
Seo presentation by mahendra
Seo presentation by mahendraSeo presentation by mahendra
Seo presentation by mahendra
 
Sample Day One
Sample Day OneSample Day One
Sample Day One
 
Apr 2007_SK Corp Earnings Forecast for FY 2007
Apr 2007_SK Corp Earnings Forecast for FY 2007Apr 2007_SK Corp Earnings Forecast for FY 2007
Apr 2007_SK Corp Earnings Forecast for FY 2007
 
Dollar General - Burlington, CO - OM
Dollar General - Burlington, CO - OMDollar General - Burlington, CO - OM
Dollar General - Burlington, CO - OM
 
Monitoring 2011
Monitoring 2011Monitoring 2011
Monitoring 2011
 
Khilafat Magazine Issue 5
Khilafat Magazine Issue 5Khilafat Magazine Issue 5
Khilafat Magazine Issue 5
 

Semelhante a Web ninja html & css

WordPress&映像配信セミナー+さぶみっと!オフ会- 第2回 さぶみっと! WEB制作セミナー Supported by NTTスマートコネクト
WordPress&映像配信セミナー+さぶみっと!オフ会- 第2回 さぶみっと! WEB制作セミナー Supported by NTTスマートコネクトWordPress&映像配信セミナー+さぶみっと!オフ会- 第2回 さぶみっと! WEB制作セミナー Supported by NTTスマートコネクト
WordPress&映像配信セミナー+さぶみっと!オフ会- 第2回 さぶみっと! WEB制作セミナー Supported by NTTスマートコネクト
Hiromichi Koga
 
Even faster web sites presentation 3
Even faster web sites presentation 3Even faster web sites presentation 3
Even faster web sites presentation 3
Felipe Lavín
 

Semelhante a Web ninja html & css (20)

Html5 ux london
Html5 ux londonHtml5 ux london
Html5 ux london
 
WordPress&映像配信セミナー+さぶみっと!オフ会- 第2回 さぶみっと! WEB制作セミナー Supported by NTTスマートコネクト
WordPress&映像配信セミナー+さぶみっと!オフ会- 第2回 さぶみっと! WEB制作セミナー Supported by NTTスマートコネクトWordPress&映像配信セミナー+さぶみっと!オフ会- 第2回 さぶみっと! WEB制作セミナー Supported by NTTスマートコネクト
WordPress&映像配信セミナー+さぶみっと!オフ会- 第2回 さぶみっと! WEB制作セミナー Supported by NTTスマートコネクト
 
さぶみっと
さぶみっとさぶみっと
さぶみっと
 
Html&Browser
Html&BrowserHtml&Browser
Html&Browser
 
Using HTML5 and CSS3 today
Using HTML5 and CSS3 todayUsing HTML5 and CSS3 today
Using HTML5 and CSS3 today
 
Html5
Html5Html5
Html5
 
Modular HTML & CSS Turbo Workshop
Modular HTML & CSS Turbo WorkshopModular HTML & CSS Turbo Workshop
Modular HTML & CSS Turbo Workshop
 
WHAT IS HTML5?(20100510)
WHAT IS HTML5?(20100510)WHAT IS HTML5?(20100510)
WHAT IS HTML5?(20100510)
 
Intro to HTML 5 / CSS 3
Intro to HTML 5 / CSS 3Intro to HTML 5 / CSS 3
Intro to HTML 5 / CSS 3
 
[In Control 2010] HTML5
[In Control 2010] HTML5[In Control 2010] HTML5
[In Control 2010] HTML5
 
CSS Best practices
CSS Best practicesCSS Best practices
CSS Best practices
 
Progressive Prototyping w/HTML5, CSS3 and jQuery
Progressive Prototyping w/HTML5, CSS3 and jQueryProgressive Prototyping w/HTML5, CSS3 and jQuery
Progressive Prototyping w/HTML5, CSS3 and jQuery
 
Html workshop 1
Html workshop 1Html workshop 1
Html workshop 1
 
Even faster web sites presentation 3
Even faster web sites presentation 3Even faster web sites presentation 3
Even faster web sites presentation 3
 
HTML5+CSS3 (入門編)
HTML5+CSS3 (入門編)HTML5+CSS3 (入門編)
HTML5+CSS3 (入門編)
 
Pertemuan 7
Pertemuan 7Pertemuan 7
Pertemuan 7
 
WordCamp Boston 2012 - Creating Content With Shortcodes
WordCamp Boston 2012 - Creating Content With ShortcodesWordCamp Boston 2012 - Creating Content With Shortcodes
WordCamp Boston 2012 - Creating Content With Shortcodes
 
Modular HTML & CSS Workshop
Modular HTML & CSS WorkshopModular HTML & CSS Workshop
Modular HTML & CSS Workshop
 
Html workshop 1
Html workshop 1Html workshop 1
Html workshop 1
 
A Primer on HTML 5 - By Nick Armstrong
A Primer on HTML 5 - By Nick ArmstrongA Primer on HTML 5 - By Nick Armstrong
A Primer on HTML 5 - By Nick Armstrong
 

Último

Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Safe Software
 
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Victor Rentea
 

Último (20)

Polkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin WoodPolkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin Wood
 
AXA XL - Insurer Innovation Award Americas 2024
AXA XL - Insurer Innovation Award Americas 2024AXA XL - Insurer Innovation Award Americas 2024
AXA XL - Insurer Innovation Award Americas 2024
 
Exploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone ProcessorsExploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone Processors
 
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost SavingRepurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
 
ICT role in 21st century education and its challenges
ICT role in 21st century education and its challengesICT role in 21st century education and its challenges
ICT role in 21st century education and its challenges
 
Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...
Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...
Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...
 
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, AdobeApidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
 
2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...
 
Spring Boot vs Quarkus the ultimate battle - DevoxxUK
Spring Boot vs Quarkus the ultimate battle - DevoxxUKSpring Boot vs Quarkus the ultimate battle - DevoxxUK
Spring Boot vs Quarkus the ultimate battle - DevoxxUK
 
Boost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfBoost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdf
 
Manulife - Insurer Transformation Award 2024
Manulife - Insurer Transformation Award 2024Manulife - Insurer Transformation Award 2024
Manulife - Insurer Transformation Award 2024
 
FWD Group - Insurer Innovation Award 2024
FWD Group - Insurer Innovation Award 2024FWD Group - Insurer Innovation Award 2024
FWD Group - Insurer Innovation Award 2024
 
Exploring Multimodal Embeddings with Milvus
Exploring Multimodal Embeddings with MilvusExploring Multimodal Embeddings with Milvus
Exploring Multimodal Embeddings with Milvus
 
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
 
[BuildWithAI] Introduction to Gemini.pdf
[BuildWithAI] Introduction to Gemini.pdf[BuildWithAI] Introduction to Gemini.pdf
[BuildWithAI] Introduction to Gemini.pdf
 
MS Copilot expands with MS Graph connectors
MS Copilot expands with MS Graph connectorsMS Copilot expands with MS Graph connectors
MS Copilot expands with MS Graph connectors
 
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
 
CNIC Information System with Pakdata Cf In Pakistan
CNIC Information System with Pakdata Cf In PakistanCNIC Information System with Pakdata Cf In Pakistan
CNIC Information System with Pakdata Cf In Pakistan
 
Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...
 

Web ninja html & css

  • 1. Basic Programming Part 1: HTML & CSS <WEB NINJA/> Alfi Rizka T. alfi@dedicated-it.com FB: fb.com/avikaco | twitter : @avikaco
  • 2. TODAY AGENDA • How to be a HTML & CSS Ninja? • Tools • Understanding HTML • Understanding CSS • DEMO • Design Psychology • Resources • QA? • TRY your self: create your own website. <WEB NINJA/> Alfi Rizka T. alfi@dedicated-it.com FB: fb.com/avikaco | twitter : @avikaco
  • 3. HOW TO BE A HTML & CSS NINJA? <WEB NINJA/> Alfi Rizka T. alfi@dedicated-it.com FB: fb.com/avikaco | twitter : @avikaco
  • 4. TOOLS <WEB NINJA/> Alfi Rizka T. alfi@dedicated-it.com FB: fb.com/avikaco | twitter : @avikaco
  • 5. • IDE (Dreamweaver / Zend Studio / Notepad++ / etc) • Web Browser + Firebug / Developer Toolbar • Zen Coding (code.google.com/p/zen-coding/) • LESS CSS (lesscss.org) • SimpLESS (wearekiss.com/simpless) • SpritePad (pritepad.wearekiss.com) TOOLS Alfi Rizka T. alfi@dedicated-it.com FB: fb.com/avikaco | twitter : @avikaco
  • 6. HTML (HYPERTEXT MARKUP LANGUAGE) <WEB NINJA/> Alfi Rizka T. alfi@dedicated-it.com FB: fb.com/avikaco | twitter : @avikaco
  • 7. HTML TIMELINE 1991 : HTML 1994 : HTML 2 1996 : CSS 1 + Javascript 1997 : HTML 4 1998 : CSS 2 2000 : XHTML 2002 : Tableless web design era 2005 : Asynchronous JavaScript and XML (AJAX) 2009 : HTML 5 HTML Alfi Rizka T. alfi@dedicated-it.com FB: fb.com/avikaco | twitter : @avikaco
  • 8. What is Doctype? Doctype is a pre-defined string that is used to tell a client’s web browser what type of code will be contained in the file. 4 doctype most frequently used • HTML 4.01 Strict <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd"> • HTML 4.01 Transitional <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> • XHTML 1.0 Strict <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> • HTML 5 <!DOCTYPE HTML> HTML Alfi Rizka T. alfi@dedicated-it.com FB: fb.com/avikaco | twitter : @avikaco
  • 9. What New in HTML 5 • CSS3 and many new & extended Javascript API. • More than 50 new tags & attribute (@see http://www.w3.org/TR/html5-diff/). • Scalable Vector Graphic (SVG) & Canvas support • Web GL • GeoLocation • New form input type (date, time, number, range, email, etc) and native input validation • Drag and Drop • Video and Audio • Query Selector • Local Storage • App Cache • Much more…… When HTML 5 will be final release? click here HTML Alfi Rizka T. alfi@dedicated-it.com FB: fb.com/avikaco | twitter : @avikaco
  • 10. Basic Structure HTML Tags <!DOCTYPE HTML> <html lang="en-US"> <head> <meta charset="UTF-8"> <title>HTML &amp; CSS Ninja</title> </head> <body> </body> </html> HTML Alfi Rizka T. alfi@dedicated-it.com FB: fb.com/avikaco | twitter : @avikaco
  • 11. Basic Structure HTML Tags text node <a href="#ninja-div"> Goto Ninja </a> property element HTML Alfi Rizka T. alfi@dedicated-it.com FB: fb.com/avikaco | twitter : @avikaco
  • 12. Understanding href Attribute • Beginning with protocol (eg: http / ftp / mailto / etc) • Beginning with sharp # (eg: #bottom) • File name (eg: index.php) • Beginning with single slash (eg: /main) • Beginning with double slash (eg: //api.google.com/maps) HTML Alfi Rizka T. alfi@dedicated-it.com FB: fb.com/avikaco | twitter : @avikaco
  • 13. HTML COMMON MISTAKE WRONG <span> <div>Hello Ninja.</div> </span> <p> Hello <p>Ninja.</p> </p> CORRECT <div> <span>Hello Ninja.</span> </div> <p>Hello</p> <p>Ninja.</p> HTML Alfi Rizka T. alfi@dedicated-it.com FB: fb.com/avikaco | twitter : @avikaco
  • 14. HTML COMMON MISTAKE WRONG <a href=“index.html?get=ini&itu” title=“link “ title”> Hello Ninja. </a> CORRECT <a href=“index.html?get=ini%26itu” title=“link &quote; title”> Hello Ninja. </a> HTML Alfi Rizka T. alfi@dedicated-it.com FB: fb.com/avikaco | twitter : @avikaco
  • 15. CSS (CASCADING STYLE SHEETS) <WEB NINJA/> Alfi Rizka T. alfi@dedicated-it.com FB: fb.com/avikaco | twitter : @avikaco
  • 16. ALL YOU HAVE TO KNOW ABOUT CSS 1. All browser have different standard for each html element, that why you need reset.css 2. Urutan embed file CSS berpengaruh 3. No space on name of CSS rule (use underscrore or dash), eg: #main-menu, #logo_wrapper 4. Whitespace has no effect in CSS file parsing 5. Default CSS position: absolute will be relative to <BODY> 6. All document (import css, bg image, font-face, etc) that loaded from CSS file is relative path to css file. 7. You can set specific media target by adding attribute media=“all/screen/print/projector” 8. CSS3 support animation, gradient, multiple background, and much more. CSS Alfi Rizka T. alfi@dedicated-it.com FB: fb.com/avikaco | twitter : @avikaco
  • 17. BASIC CSS CODE h1 { margin: 0 0 0 1em; /* 1em = 16px = 12 pt = 100% */ font-size: 1.5; /* default = em */ letter-spacing : +2pt; } #site-logo { width: 200px; height: 80px; } .important { color: red;/* #F00 or #FF0000 or rgb(255,0,0) or rgba(255,0,0,1)*/ } .border-radius { border-radius: 4px; /* W3C */ -webkit-border-radius: 4px; /* Webkit = Chrome / Safari */ -moz-border-radius: 4px; /* Firefox */ } CSS Alfi Rizka T. alfi@dedicated-it.com FB: fb.com/avikaco | twitter : @avikaco
  • 18. BASIC CSS CODE margin: 10px; /* equal with */ margin: 10px 10px 10px 10px; /* top right bottom left */ /* equal with */ margin-top: 10px; margin-right: 10px; margin-bottom: 10px; margin-left: 10px; CSS Alfi Rizka T. alfi@dedicated-it.com FB: fb.com/avikaco | twitter : @avikaco
  • 19. BASIC CSS CODE background: url(bg.png) #f90 repeat-x 0 10px; /* equal with */ background-color: #f90; background-image: url(bg.png); background-repeat: repeat-x; background-position: 0 10px; CSS Alfi Rizka T. alfi@dedicated-it.com FB: fb.com/avikaco | twitter : @avikaco
  • 20. HOW TO LOAD CSS TO HTML FILE 1. Use inline HTML tag (very-very not recomended) <div style=“font: „arial black‟ 40pt/60pt;color:red”>Hello World</div> 2. Using @import (not recomended) <style type='text/css' media='all'> @import url('style.css'); </style> 3. Embed to HTML file (not recomended) <style type='text/css' media='all'> #logo{text-indent:-5000px} </style> 4. Use link tag <link rel=“stylesheet” type=“text/css” media=“all” href=“style.css” /> CSS Alfi Rizka T. alfi@dedicated-it.com FB: fb.com/avikaco | twitter : @avikaco
  • 21. UNDERSTANDING CSS POSITION (x = 0, y = 0) Browser visible area CSS Alfi Rizka T. alfi@dedicated-it.com FB: fb.com/avikaco | twitter : @avikaco
  • 22. UNDERSTANDING CSS POSITION #container { width: 980px; margin: 40px auto; background: #FFF; } CSS Alfi Rizka T. alfi@dedicated-it.com FB: fb.com/avikaco | twitter : @avikaco
  • 23. UNDERSTANDING CSS POSITION #sticky { width: 200px; position: absolute; top: 100px; right: -60px; } #container { width: 980px; margin: 40px auto; background: #FFF; } CSS Alfi Rizka T. alfi@dedicated-it.com FB: fb.com/avikaco | twitter : @avikaco
  • 24. UNDERSTANDING CSS POSITION (x = 0, y = 0) #sticky { width: 200px; position: absolute; top: 100px; right: -60px; } #container { position: relative; width: 980px; margin: 40px auto; background: #FFF; } CSS Alfi Rizka T. alfi@dedicated-it.com FB: fb.com/avikaco | twitter : @avikaco
  • 25. UNDERSTANDING CSS SPRITE Normal Hover Active/clicked Current CSS Alfi Rizka T. alfi@dedicated-it.com FB: fb.com/avikaco | twitter : @avikaco
  • 26. UNDERSTANDING CSS SPRITE Normal Hover Active/clicked Current HTML CSS <ul id="main"> #main{ <li> margin:0;padding:0;list-style:inside <a href="#" id="home">Home</a> none;height:40px} </li> #main li{ <li> display:block;float:left;margin:0} <a href="#" id="store">Store</a> #main li a { </li> display:block;width:120px;height:40px; <li> Background:url(apple.png) top left; <a href="#" id="mac">MAC</a> Text-indent:-5000px; </li> } <li> #main li a:hover {} <a href="#" id="ipod">iPod</a> #main li a:active, </li> #main li a:focus {} /* ... More ... */ #main li a.current{} </ul> CSS Alfi Rizka T. alfi@dedicated-it.com FB: fb.com/avikaco | twitter : @avikaco
  • 27. All you have to know about CSS sprite • Tidak boleh ada gambar yang saling timpa • Ukuran sprite item kalo bisa sama untuk semua item, agar mempermudah perhitungan background position • Element yang bisa menggunakan sprite hanya yang display: block / inline-block • BIASANYA (bukan berarti tidak bisa) sprite image tidak bisa digunakan untuk repeat bg CSS Alfi Rizka T. alfi@dedicated-it.com FB: fb.com/avikaco | twitter : @avikaco
  • 28. UNDERSTANDING GRID SYSTEM • 960 Grid System (960.gs) • Blueprint CSS (blueprintcss.org) • Twitter Bootstrap (twitter.github.com/bootstrap) • Yahoo User Interface (developer.yahoo.com/yui) • Etc.. CSS Alfi Rizka T. alfi@dedicated-it.com FB: fb.com/avikaco | twitter : @avikaco
  • 29. DEMO Undestanding Column and Row CSS Alfi Rizka T. alfi@dedicated-it.com FB: fb.com/avikaco | twitter : @avikaco
  • 30. DESIGN PSYCHOLOGY <WEB NINJA/> Alfi Rizka T. alfi@dedicated-it.com FB: fb.com/avikaco | twitter : @avikaco
  • 31. <WEB NINJA/> Alfi Rizka T. alfi@dedicated-it.com FB: fb.com/avikaco | twitter : @avikaco
  • 32. RESOURCES <WEB NINJA/> Alfi Rizka T. alfi@dedicated-it.com FB: fb.com/avikaco | twitter : @avikaco
  • 33. HTML & CSS RESOURCES • W3 (www.w3.org) • validator.w3.org • HTML5 Rock (www.html5rocks.com ) • beta.html5test.com • html5readiness.com • caniuse.com • quirksmode.org • html5doctor.com • ishtml5readyyet.com RESOURCES Alfi Rizka T. alfi@dedicated-it.com FB: fb.com/avikaco | twitter : @avikaco
  • 34. QUESTIONS? <WEB NINJA/> Alfi Rizka T. alfi@dedicated-it.com FB: fb.com/avikaco | twitter : @avikaco
  • 35. THANKS <WEB NINJA/> Alfi Rizka T. alfi@dedicated-it.com FB: fb.com/avikaco | twitter : @avikaco

Notas do Editor

  1. Kelebihanmenggunakan XHTMLDoctype:Elements must be properly nested:  &lt;i&gt;&lt;b&gt;Test&lt;/i&gt;&lt;/b&gt; is allowed in HTML, but in XHTML would be:  &lt;i&gt;&lt;b&gt;Test&lt;/b&gt;&lt;/i&gt;Elements must always be closed, including elements with only one tag: HTML is &lt;hr&gt;, but in XHTML:  &lt;hr /&gt;Elements must be defined in lowercase.  HTML allows &lt;H1&gt;, but in XHTML it must be &lt;h1&gt;Elements must be nested and rooted together.  This goes hand-in-hand with item #1, but goes on to require that all text is contained in an element.
  2. Kelebihanmenggunakan XHTMLDoctype:Elements must be properly nested:  &lt;i&gt;&lt;b&gt;Test&lt;/i&gt;&lt;/b&gt; is allowed in HTML, but in XHTML would be:  &lt;i&gt;&lt;b&gt;Test&lt;/b&gt;&lt;/i&gt;Elements must always be closed, including elements with only one tag: HTML is &lt;hr&gt;, but in XHTML:  &lt;hr /&gt;Elements must be defined in lowercase.  HTML allows &lt;H1&gt;, but in XHTML it must be &lt;h1&gt;Elements must be nested and rooted together.  This goes hand-in-hand with item #1, but goes on to require that all text is contained in an element.