SlideShare ist ein Scribd-Unternehmen logo
1 von 19
Downloaden Sie, um offline zu lesen
Base HTML & CSS
Nick
HTML DOCTYPE?
HTML DOCTYPE
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">

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

HTML5 DOCTYPE
<!DOCTYPE html>
<body>
SAMPLE CODE
<style type="text/css">
.text-layer {
font-family: Monaco, "Courier New", monospace;
font-size: 12px;
cursor: text;
}
.bg-red {
background-color: red;
}
</style>
<body>
<h1 style="color:red">Juhu Kinners</h1>
<div id="elem_id"></div>
<div class="text-layer bg-red"></div>
</body>
<h1>
<h1> ~ <h6>
h1

h2

h2

h3

h3
attr id
Attribute id
<div id="elem_id"></div>

Identity of HTML Element
●
●

It is the only
Always use in JavaScript
attr class
Attribute class
<div class="text-layer bg-red"></div>

Styling the HTML Element
●
●

It can be many
Each class match with their css in stylesheet

.text-layer {
font-family: Monaco, "Courier New", monospace;
font-size: 12px;
cursor: text;
}

.bg-red {
background-color: red;
}
<table>

VS
<div>
<table> VS <div>
<table> Base usage
<table>
<tr>
<td>row1 column1</td>
<td>row1 column2</td>
</tr>
<tr>
<td>row2 column1</td>
<td>row2 column2</td>
</tr>
</table>

row1 column1

row1 column2

row2 column1

row2 column2
<table> VS <div>
<table> colspan
<table>
<tr>
<td colspan=”2”>
row1 column1 + row1 column2
</td>
</tr>
<tr>
<td>row2 column1</td>
<td>row2 column2</td>
</tr>
</table>

row1 column1 + row1 column2
row2 column1

row2 column2
<table> VS <div>
<table> rowspan
<table>
<tr>
<td rowspan=”2”>
row1 column1 + row2 column1
</td>
<td>row1 column2</td>
</tr>
<tr>
<td>row2 column2</td>
</tr>
<tr>
<td>row3 column1</td>
<td>row3 column2</td>
</tr>
</table>

row1 column1 + row2 column1

row1 column2
row2 column2

row3 column1

row3 column2
<table> VS <div>
Tips for using <table>
●
●

When the container has margin or padding, do not set table in 100% width
Do not try to set the height, if you want to make it flexible

padding

<table width=”100%”>

padding

<table width=”auto”>
<table> VS <div>
Why <div> ?
●
●
●

Easy to control
No any extra css
Default display “Block”

<div id=”1” style=”position: absolute”>

<div id=”1” style=”
position: relative”>

<div id=”2” style=”
position: relative”>

<div id=”4” style=”position: absolute”>

<div id=”3” style=”
position: relative”>

<div id=”4” style=”
position: relative”>

<div id=”5” style=”
position: relative”>

<div id=”6” style=”
position: relative”>

<div id=”2” style=”
position: absolute”>

<div id=”3” style=”
position: absolute”>
<table> VS <div>
So...
<table>
●
●
●

Not too much customize
Seems simple
Have a some format

<div>
●
●
●

Lots of customize
Complex layout
Not in same format
margin & padding
margin & padding
margin
margin

content
margin & padding
padding
padding

content
About transparent
About transparent
Cross browser
/* IE 8 */
-ms-filter: "progid:DXImageTransform.Microsoft.Alpha(Opacity=50)";
/* IE 5-7 */
filter: alpha(opacity=50);
/* Good browsers */
opacity: 0.5;
<END/>

Weitere ähnliche Inhalte

Was ist angesagt?

Html beginner
Html beginnerHtml beginner
Html beginner
wihrbt
 
Kristina benjamin fonttag
Kristina benjamin fonttagKristina benjamin fonttag
Kristina benjamin fonttag
kristibenjamin
 
The Ulta-Handy HTML Guide
The Ulta-Handy HTML GuideThe Ulta-Handy HTML Guide
The Ulta-Handy HTML Guide
jsved
 

Was ist angesagt? (20)

Internet and Web Technology (CLASS-8) [jQuery and JSON] | NIC/NIELIT Web Tech...
Internet and Web Technology (CLASS-8) [jQuery and JSON] | NIC/NIELIT Web Tech...Internet and Web Technology (CLASS-8) [jQuery and JSON] | NIC/NIELIT Web Tech...
Internet and Web Technology (CLASS-8) [jQuery and JSON] | NIC/NIELIT Web Tech...
 
Html beginner
Html beginnerHtml beginner
Html beginner
 
What is HTML- d3brand.com
What is HTML- d3brand.comWhat is HTML- d3brand.com
What is HTML- d3brand.com
 
XHTML
XHTMLXHTML
XHTML
 
Html basics-auro skills
Html basics-auro skillsHtml basics-auro skills
Html basics-auro skills
 
Css1
Css1Css1
Css1
 
Cascading Style Sheets - CSS - Tutorial
Cascading Style Sheets - CSS  -  TutorialCascading Style Sheets - CSS  -  Tutorial
Cascading Style Sheets - CSS - Tutorial
 
Introduction to HTML and CSS
Introduction to HTML and CSSIntroduction to HTML and CSS
Introduction to HTML and CSS
 
Chilliz
ChillizChilliz
Chilliz
 
Internet and Web Technology (CLASS-5) [HTML DOM]
Internet and Web Technology (CLASS-5) [HTML DOM] Internet and Web Technology (CLASS-5) [HTML DOM]
Internet and Web Technology (CLASS-5) [HTML DOM]
 
Kristina benjamin fonttag
Kristina benjamin fonttagKristina benjamin fonttag
Kristina benjamin fonttag
 
Introducing HTML
Introducing HTMLIntroducing HTML
Introducing HTML
 
The Ulta-Handy HTML Guide
The Ulta-Handy HTML GuideThe Ulta-Handy HTML Guide
The Ulta-Handy HTML Guide
 
Html.ppt
Html.pptHtml.ppt
Html.ppt
 
HTML Introduction, HTML History, HTML Uses, HTML benifits
HTML Introduction, HTML History, HTML Uses, HTML benifitsHTML Introduction, HTML History, HTML Uses, HTML benifits
HTML Introduction, HTML History, HTML Uses, HTML benifits
 
Internet and Web Technology (CLASS-6) [BOM]
Internet and Web Technology (CLASS-6) [BOM] Internet and Web Technology (CLASS-6) [BOM]
Internet and Web Technology (CLASS-6) [BOM]
 
CSS-3 Course Slide
CSS-3 Course SlideCSS-3 Course Slide
CSS-3 Course Slide
 
Introduction to HTML and CSS
Introduction to HTML and CSSIntroduction to HTML and CSS
Introduction to HTML and CSS
 
Learning HTML
Learning HTMLLearning HTML
Learning HTML
 
Html & CSS
Html & CSSHtml & CSS
Html & CSS
 

Ähnlich wie Base HTML & CSS

Doctype html public
Doctype html publicDoctype html public
Doctype html public
ecuapool
 
Sustainable livelihood-framework-sr-presentation
Sustainable livelihood-framework-sr-presentationSustainable livelihood-framework-sr-presentation
Sustainable livelihood-framework-sr-presentation
guest6899d4f
 
Introduction to XML, XHTML and CSS
Introduction to XML, XHTML and CSSIntroduction to XML, XHTML and CSS
Introduction to XML, XHTML and CSS
Jussi Pohjolainen
 
Leksion 1 hyrje ne xhtml
Leksion 1   hyrje ne xhtmlLeksion 1   hyrje ne xhtml
Leksion 1 hyrje ne xhtml
mariokenga
 

Ähnlich wie Base HTML & CSS (20)

Frfrfrf
FrfrfrfFrfrfrf
Frfrfrf
 
HTML5 CSS3 Basics
HTML5 CSS3 Basics HTML5 CSS3 Basics
HTML5 CSS3 Basics
 
Doctype html public
Doctype html publicDoctype html public
Doctype html public
 
Web basic
Web basicWeb basic
Web basic
 
Sustainable livelihood-framework-sr-presentation
Sustainable livelihood-framework-sr-presentationSustainable livelihood-framework-sr-presentation
Sustainable livelihood-framework-sr-presentation
 
Eclampsia 4-real-presentation
Eclampsia 4-real-presentationEclampsia 4-real-presentation
Eclampsia 4-real-presentation
 
Eye catching HTML BASICS tips: Learn easily
Eye catching HTML BASICS tips: Learn easilyEye catching HTML BASICS tips: Learn easily
Eye catching HTML BASICS tips: Learn easily
 
DIWE - Coding HTML for Basic Web Designing
DIWE - Coding HTML for Basic Web DesigningDIWE - Coding HTML for Basic Web Designing
DIWE - Coding HTML for Basic Web Designing
 
HTML5
HTML5HTML5
HTML5
 
Html 5
Html 5Html 5
Html 5
 
Dhtml chapter2
Dhtml chapter2Dhtml chapter2
Dhtml chapter2
 
Introduction to XML, XHTML and CSS
Introduction to XML, XHTML and CSSIntroduction to XML, XHTML and CSS
Introduction to XML, XHTML and CSS
 
HTML5
HTML5HTML5
HTML5
 
Intro to JavaScript
Intro to JavaScriptIntro to JavaScript
Intro to JavaScript
 
Html&Browser
Html&BrowserHtml&Browser
Html&Browser
 
Html5
Html5Html5
Html5
 
Leksion 1 hyrje ne xhtml
Leksion 1   hyrje ne xhtmlLeksion 1   hyrje ne xhtml
Leksion 1 hyrje ne xhtml
 
HTML and CSS Sitting in a Tree. K i s s i n O M G
HTML and CSS Sitting in a Tree. K i s s i n O M GHTML and CSS Sitting in a Tree. K i s s i n O M G
HTML and CSS Sitting in a Tree. K i s s i n O M G
 
HTML & CSS 2017
HTML & CSS 2017HTML & CSS 2017
HTML & CSS 2017
 
Index
IndexIndex
Index
 

Kürzlich hochgeladen

Histor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slideHistor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slide
vu2urc
 
Artificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsArtificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and Myths
Joaquim Jorge
 

Kürzlich hochgeladen (20)

Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdfUnderstanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
 
Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024
 
What Are The Drone Anti-jamming Systems Technology?
What Are The Drone Anti-jamming Systems Technology?What Are The Drone Anti-jamming Systems Technology?
What Are The Drone Anti-jamming Systems Technology?
 
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
 
AWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of TerraformAWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of Terraform
 
Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...
 
Histor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slideHistor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slide
 
Artificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsArtificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and Myths
 
Tech Trends Report 2024 Future Today Institute.pdf
Tech Trends Report 2024 Future Today Institute.pdfTech Trends Report 2024 Future Today Institute.pdf
Tech Trends Report 2024 Future Today Institute.pdf
 
GenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationGenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day Presentation
 
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
 
Developing An App To Navigate The Roads of Brazil
Developing An App To Navigate The Roads of BrazilDeveloping An App To Navigate The Roads of Brazil
Developing An App To Navigate The Roads of Brazil
 
Real Time Object Detection Using Open CV
Real Time Object Detection Using Open CVReal Time Object Detection Using Open CV
Real Time Object Detection Using Open CV
 
presentation ICT roal in 21st century education
presentation ICT roal in 21st century educationpresentation ICT roal in 21st century education
presentation ICT roal in 21st century education
 
[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf
 
Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024
 
Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024
 
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot TakeoffStrategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
 
Advantages of Hiring UIUX Design Service Providers for Your Business
Advantages of Hiring UIUX Design Service Providers for Your BusinessAdvantages of Hiring UIUX Design Service Providers for Your Business
Advantages of Hiring UIUX Design Service Providers for Your Business
 
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationFrom Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
 

Base HTML & CSS

  • 1. Base HTML & CSS Nick
  • 2. HTML DOCTYPE? HTML DOCTYPE <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> XHTML DOCTYPE <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd" > HTML5 DOCTYPE <!DOCTYPE html>
  • 3. <body> SAMPLE CODE <style type="text/css"> .text-layer { font-family: Monaco, "Courier New", monospace; font-size: 12px; cursor: text; } .bg-red { background-color: red; } </style> <body> <h1 style="color:red">Juhu Kinners</h1> <div id="elem_id"></div> <div class="text-layer bg-red"></div> </body>
  • 5. attr id Attribute id <div id="elem_id"></div> Identity of HTML Element ● ● It is the only Always use in JavaScript
  • 6. attr class Attribute class <div class="text-layer bg-red"></div> Styling the HTML Element ● ● It can be many Each class match with their css in stylesheet .text-layer { font-family: Monaco, "Courier New", monospace; font-size: 12px; cursor: text; } .bg-red { background-color: red; }
  • 8. <table> VS <div> <table> Base usage <table> <tr> <td>row1 column1</td> <td>row1 column2</td> </tr> <tr> <td>row2 column1</td> <td>row2 column2</td> </tr> </table> row1 column1 row1 column2 row2 column1 row2 column2
  • 9. <table> VS <div> <table> colspan <table> <tr> <td colspan=”2”> row1 column1 + row1 column2 </td> </tr> <tr> <td>row2 column1</td> <td>row2 column2</td> </tr> </table> row1 column1 + row1 column2 row2 column1 row2 column2
  • 10. <table> VS <div> <table> rowspan <table> <tr> <td rowspan=”2”> row1 column1 + row2 column1 </td> <td>row1 column2</td> </tr> <tr> <td>row2 column2</td> </tr> <tr> <td>row3 column1</td> <td>row3 column2</td> </tr> </table> row1 column1 + row2 column1 row1 column2 row2 column2 row3 column1 row3 column2
  • 11. <table> VS <div> Tips for using <table> ● ● When the container has margin or padding, do not set table in 100% width Do not try to set the height, if you want to make it flexible padding <table width=”100%”> padding <table width=”auto”>
  • 12. <table> VS <div> Why <div> ? ● ● ● Easy to control No any extra css Default display “Block” <div id=”1” style=”position: absolute”> <div id=”1” style=” position: relative”> <div id=”2” style=” position: relative”> <div id=”4” style=”position: absolute”> <div id=”3” style=” position: relative”> <div id=”4” style=” position: relative”> <div id=”5” style=” position: relative”> <div id=”6” style=” position: relative”> <div id=”2” style=” position: absolute”> <div id=”3” style=” position: absolute”>
  • 13. <table> VS <div> So... <table> ● ● ● Not too much customize Seems simple Have a some format <div> ● ● ● Lots of customize Complex layout Not in same format
  • 18. About transparent Cross browser /* IE 8 */ -ms-filter: "progid:DXImageTransform.Microsoft.Alpha(Opacity=50)"; /* IE 5-7 */ filter: alpha(opacity=50); /* Good browsers */ opacity: 0.5;