DOM: Document Object Model. What are trees? Or more like this…
-
Upload
paulina-campbell -
Category
Documents
-
view
213 -
download
1
Transcript of DOM: Document Object Model. What are trees? Or more like this…
![Page 1: DOM: Document Object Model. What are trees? Or more like this…](https://reader035.fdocuments.in/reader035/viewer/2022072005/56649ce35503460f949af150/html5/thumbnails/1.jpg)
DOM:Document
Object Model
![Page 2: DOM: Document Object Model. What are trees? Or more like this…](https://reader035.fdocuments.in/reader035/viewer/2022072005/56649ce35503460f949af150/html5/thumbnails/2.jpg)
What are trees?
![Page 3: DOM: Document Object Model. What are trees? Or more like this…](https://reader035.fdocuments.in/reader035/viewer/2022072005/56649ce35503460f949af150/html5/thumbnails/3.jpg)
Or more like this…
![Page 4: DOM: Document Object Model. What are trees? Or more like this…](https://reader035.fdocuments.in/reader035/viewer/2022072005/56649ce35503460f949af150/html5/thumbnails/4.jpg)
A Better ExampleSam & Bessie
Al & Jewel Paul & Dawn
Leo & Bea
Peter &
Cate
Mark &
Dina
Abby &
Phil
Tess &
John
Barb &
Ray
Kari & Hal
Dan &
Cora
Stu & Chi
Sue
Leah LoriMary Jen AndyAl Noah
BenJake
Amy Sara Moe AndyDi Lady
![Page 5: DOM: Document Object Model. What are trees? Or more like this…](https://reader035.fdocuments.in/reader035/viewer/2022072005/56649ce35503460f949af150/html5/thumbnails/5.jpg)
DescendentsSam & Bessie
Al & Jewel Paul & Dawn
Leo & Bea
Peter &
Cate
Mark &
Dina
Abby &
Phil
Tess &
John
Barb &
Ray
Kari & Hal
Dan &
Cora
Stu & Chi
Sue
Leah LoriMary Jen AndyAl Noah
BenJake
Amy Sara Moe AndyDi Lady
![Page 6: DOM: Document Object Model. What are trees? Or more like this…](https://reader035.fdocuments.in/reader035/viewer/2022072005/56649ce35503460f949af150/html5/thumbnails/6.jpg)
ChildrenSam & Bessie
Al & Jewel Paul & Dawn
Leo & Bea
Peter &
Cate
Mark &
Dina
Abby &
Phil
Tess &
John
Barb &
Ray
Kari & Hal
Dan &
Cora
Stu & Chi
Sue
Leah LoriMary Jen AndyAl Noah
BenJake
Amy Sara Moe AndyDi Lady
![Page 7: DOM: Document Object Model. What are trees? Or more like this…](https://reader035.fdocuments.in/reader035/viewer/2022072005/56649ce35503460f949af150/html5/thumbnails/7.jpg)
ChildrenSam & Bessie
Al & Jewel Paul & Dawn
Leo & Bea
Peter &
Cate
Mark &
Dina
Abby &
Phil
Tess &
John
Barb &
Ray
Kari & Hal
Dan &
Cora
Stu & Chi
Sue
Leah LoriMary Jen Andy Noah
BenJake
Amy Sara Moe AndyDi Lady
Al
![Page 8: DOM: Document Object Model. What are trees? Or more like this…](https://reader035.fdocuments.in/reader035/viewer/2022072005/56649ce35503460f949af150/html5/thumbnails/8.jpg)
SiblingsSam & Bessie
Al & Jewel Paul & Dawn
Leo & Bea
Peter &
Cate
Mark &
Dina
Abby &
Phil
Tess &
John
Barb &
Ray
Kari & Hal
Dan &
Cora
Stu & Chi
Sue
Leah LoriMary Jen AndyAl Noah
BenJake
Amy Sara Moe AndyDi Lady
![Page 9: DOM: Document Object Model. What are trees? Or more like this…](https://reader035.fdocuments.in/reader035/viewer/2022072005/56649ce35503460f949af150/html5/thumbnails/9.jpg)
HTML Creates a tree: DOM
HTML tags create a treeCalled the DOM
(Document Object Model)
![Page 10: DOM: Document Object Model. What are trees? Or more like this…](https://reader035.fdocuments.in/reader035/viewer/2022072005/56649ce35503460f949af150/html5/thumbnails/10.jpg)
HTMLbody
div footerheader
h1 section
ul p tablediv p figureul
li pli tr trp li divli
td td td tdtd td
![Page 11: DOM: Document Object Model. What are trees? Or more like this…](https://reader035.fdocuments.in/reader035/viewer/2022072005/56649ce35503460f949af150/html5/thumbnails/11.jpg)
HTMLbody
div footerheader
h1 section
ul p tablediv p figureul
li pli tr trp li divli
td td td tdtd td
siblings
child
![Page 12: DOM: Document Object Model. What are trees? Or more like this…](https://reader035.fdocuments.in/reader035/viewer/2022072005/56649ce35503460f949af150/html5/thumbnails/12.jpg)
Using the DOM
CSS will allow us to format selectively based on the tree
![Page 13: DOM: Document Object Model. What are trees? Or more like this…](https://reader035.fdocuments.in/reader035/viewer/2022072005/56649ce35503460f949af150/html5/thumbnails/13.jpg)
CSS Selectors context tag {
Applies to any tag inside context
Space is a descendant selector
context > tag { Applies to any tag directly inside context
> is a child selector
Context + tag { Applies only to a tag that DIRECTLY FOLLOWS a
context
+ is an adjacent sibling selector
![Page 14: DOM: Document Object Model. What are trees? Or more like this…](https://reader035.fdocuments.in/reader035/viewer/2022072005/56649ce35503460f949af150/html5/thumbnails/14.jpg)
HTMLbody
div footerheader
h1 section
ul p tablediv p figureul
li pli tr trp li divli
td td td tdtd td
![Page 15: DOM: Document Object Model. What are trees? Or more like this…](https://reader035.fdocuments.in/reader035/viewer/2022072005/56649ce35503460f949af150/html5/thumbnails/15.jpg)
Child pseudo elements
W3schools
first-child, last-child, nth-child(), nth-last-child()
() options:
Number
Even-odd
Formula
Every 3rd would be 3n+0
4, 7, 11 would be 3n+1
nth-last-child counts from end
![Page 16: DOM: Document Object Model. What are trees? Or more like this…](https://reader035.fdocuments.in/reader035/viewer/2022072005/56649ce35503460f949af150/html5/thumbnails/16.jpg)
CSS Inheritence
If you have 2 entries in your CSS:
div {}
div.class {}
BOTH are applied to <div class=“class”>
Taking advantage: “all my divs will have a border”
Problems: widths can conflict and rules aren’t obvious
![Page 17: DOM: Document Object Model. What are trees? Or more like this…](https://reader035.fdocuments.in/reader035/viewer/2022072005/56649ce35503460f949af150/html5/thumbnails/17.jpg)
Excel tables to the web
![Page 18: DOM: Document Object Model. What are trees? Or more like this…](https://reader035.fdocuments.in/reader035/viewer/2022072005/56649ce35503460f949af150/html5/thumbnails/18.jpg)
Getting Tables to the Web
Tableizer
No classes
Not formatted
We have had Mac problems
HTML Formatter
![Page 19: DOM: Document Object Model. What are trees? Or more like this…](https://reader035.fdocuments.in/reader035/viewer/2022072005/56649ce35503460f949af150/html5/thumbnails/19.jpg)
Getting Tables to the Web
Mr. Data Converter
Sets up classes
Formatted
Caveat: it requires that there be a value in the upper left cell