+ All Categories
Home > Documents > HTML and CSS- Layout. HTML Layout Frame Table – Block HTML5 layout elements.

HTML and CSS- Layout. HTML Layout Frame Table – Block HTML5 layout elements.

Date post: 12-Jan-2016
Category:
Upload: melanie-marshall
View: 248 times
Download: 2 times
Share this document with a friend
Popular Tags:
30
Lecture 5 Kanida Sinmai [email protected] http://mis.csit.sci.tsu.ac.th/kanida HTML and CSS- Layou
Transcript
Page 1: HTML and CSS- Layout. HTML Layout Frame Table – Block HTML5 layout elements.

Lecture 5Kanida Sinmai

[email protected]://mis.csit.sci.tsu.ac.th/kanida

HTML and CSS- Layout

Page 2: HTML and CSS- Layout. HTML Layout Frame Table – Block HTML5 layout elements.

HTML Layout• Frame• Table• <div> – Block• HTML5 layout elements

Page 3: HTML and CSS- Layout. HTML Layout Frame Table – Block HTML5 layout elements.

Example

Page 4: HTML and CSS- Layout. HTML Layout Frame Table – Block HTML5 layout elements.

HTML5 Layout

Page 5: HTML and CSS- Layout. HTML Layout Frame Table – Block HTML5 layout elements.

HTML Layout – using Frame<!DOCTYPE html><html><head><title>HTML Frames</title></head><frameset rows="10%,80%,10%"> <frame name="top" src="top_frame.html" /> <frame name="main" src="main_frame.html" /> <frame name="bottom" src="bottom_frame.html" /> <noframes> <body> Your browser does not support frames. </body> </noframes></frameset></html>

Page 6: HTML and CSS- Layout. HTML Layout Frame Table – Block HTML5 layout elements.

HTML Layout – using Frame

<!DOCTYPE html><html><head><title>HTML Frames</title></head><frameset cols="25%,50%,25%"> <frame name="top" src="top_frame.html" /> <frame name="main" src="main_frame.html" /> <frame name="bottom" src="bottom_frame.html" /> <noframes> <body> Your browser does not support frames. </body> </noframes></frameset></html>

Page 7: HTML and CSS- Layout. HTML Layout Frame Table – Block HTML5 layout elements.

HTML5 doesn’t support Frame anymore!!!

Page 8: HTML and CSS- Layout. HTML Layout Frame Table – Block HTML5 layout elements.

iFrame – inline Frame<!DOCTYPE html><html><body>

<iframe src="demo_iframe.html" width="200" height="200"></iframe>

</body></html>

Page 9: HTML and CSS- Layout. HTML Layout Frame Table – Block HTML5 layout elements.

iFrame – inline CSS

<!– no border --><iframe src="demo_iframe.htm" style="border:none"></iframe>

<!– dotted style and size = 5px <iframe src="demo_iframe.htm" style="border:5px dotted red"></iframe>

Page 10: HTML and CSS- Layout. HTML Layout Frame Table – Block HTML5 layout elements.

iFrame – Try this and see what happen

<!DOCTYPE html><html><body>

<iframe src="http://www.w3schools.com" style="border:medium solid black"></iframe>

</body></html>

Page 11: HTML and CSS- Layout. HTML Layout Frame Table – Block HTML5 layout elements.

What do you see any differences between them?

<iframe src="me.html" style="overflow: scroll;">This is an iframe.</iframe>

<iframe src=”me.html" scrolling="no">This is an iframe.</iframe>

Page 12: HTML and CSS- Layout. HTML Layout Frame Table – Block HTML5 layout elements.

HTML – Table layout

Page 13: HTML and CSS- Layout. HTML Layout Frame Table – Block HTML5 layout elements.

HTML Layout – using Tables<!DOCTYPE html><html><head><title>HTML Layout using Tables</title></head><body><table width="100%" border="0"> <tr> <td colspan="2" bgcolor="#b5dcb3"> <h1>This is Web Page Main title</h1> </td> </tr> <tr valign="top"> <td bgcolor="#aaa" width="50"> <b>Main Menu</b><br /> HTML<br /> PHP<br /> PERL... </td> <td bgcolor="#eee" width="100" height="200"> Technical and Managerial Tutorials </td> </tr> <tr> <td colspan="2" bgcolor="#b5dcb3"> <center> Copyright © 2007 Tutorialspoint.com </center> </td> </tr></table></body></html>

Page 14: HTML and CSS- Layout. HTML Layout Frame Table – Block HTML5 layout elements.

HTML Layout – using Tables<!DOCTYPE html><html><head><title>Three Column HTML Layout</title></head><body><table width="100%" border="0"> <tr valign="top"> <td bgcolor="#aaa" width="20%"> <b>Main Menu</b><br /> HTML<br /> PHP<br /> PERL... </td> <td bgcolor="#b5dcb3" height="200" width="60%"> Technical and Managerial Tutorials </td> <td bgcolor="#aaa" width="20%"> <b>Right Menu</b><br /> HTML<br /> PHP<br /> PERL... </td> </tr><table></body></html>

Page 15: HTML and CSS- Layout. HTML Layout Frame Table – Block HTML5 layout elements.

HTML Layout using <div> <!DOCTYPE html><html><head><title>HTML Layouts using DIV, SPAN</title></head><body><div style="width:100%"> <div style="background-color:#b5dcb3; width:100%"> <h1>This is Web Page Main title</h1> </div> <div style="background-color:#aaa; height:200px;width:100px;float:left;"> <div><b>Main Menu</b></div> HTML<br /> PHP<br /> PERL... </div> <div style="background-color:#eee; height:200px;width:350px;float:left;"> <p>Technical and Managerial Tutorials</p> </div> <div style="background-color:#aaa; height:200px;width:100px;float:right;"> <div><b>Right Menu</b></div> HTML<br /> PHP<br /> PERL... </div> <div style="background-color:#b5dcb3;clear:both"> <center> Copyright © 2007 Tutorialspoint.com </center> </div></div></body></html>

Page 16: HTML and CSS- Layout. HTML Layout Frame Table – Block HTML5 layout elements.

HTML using <div>#header { background-color:black; color:white; text-align:center; padding:5px;}#nav { line-height:30px; background-color:#eeeeee; height:300px; width:100px; float:left; padding:5px; }#section { width:350px; float:left; padding:10px; }#footer { background-color:black; color:white; clear:both; text-align:center; padding:5px; }

<body>

<div id="header"><h1>City Gallery</h1></div>

<div id="nav">London<br>Paris<br>Tokyo<br></div>

<div id="section"><h2>London</h2><p>London is the capital city of England. It is the most populous city in the United Kingdom,with a metropolitan area of over 13 million inhabitants.</p><p>Standing on the River Thames, London has been a major settlement for two millennia,its history going back to its founding by the Romans, who named it Londinium.</p></div>

<div id="footer">Copyright W3Schools.com�</div></body>

HTML

CSS

Page 17: HTML and CSS- Layout. HTML Layout Frame Table – Block HTML5 layout elements.

HTML5 Layout

Page 18: HTML and CSS- Layout. HTML Layout Frame Table – Block HTML5 layout elements.

HTML5 Layoutheader { background-color:black; color:white; text-align:center; padding:5px; }nav { line-height:30px; background-color:#eeeeee; height:300px; width:100px; float:left; padding:5px; }section { width:350px; float:left; padding:10px; }footer { background-color:black; color:white; clear:both; text-align:center; padding:5px; }

<body>

<header><h1>City Gallery</h1></header>

<nav>London<br>Paris<br>Tokyo<br></nav>

<section><h1>London</h1><p>London is the capital city of England. It is the most populous city in the United Kingdom,with a metropolitan area of over 13 million inhabitants.</p><p>Standing on the River Thames, London has been a major settlement for two millennia,its history going back to its founding by the Romans, who named it Londinium.</p></section>

<footer>Copyright W3Schools.com�</footer>

HTML

CSS

Page 19: HTML and CSS- Layout. HTML Layout Frame Table – Block HTML5 layout elements.

Semantic Elements• A semantic element clearly describes its meaning to both the browser and

the developer.• Examples of non-semantic elements: <div> and <span> - Tells nothing

about its content.• Examples of semantic elements: <form>, <table>, and <img> - Clearly

defines its content.

Page 20: HTML and CSS- Layout. HTML Layout Frame Table – Block HTML5 layout elements.

New Semantic Elements in HTML5• <article>• <aside>• <details>• <figcaption>• <figure>• <footer>• <header>• <main>• <mark>• <nav>• <section>• <summary>• <time>

Page 21: HTML and CSS- Layout. HTML Layout Frame Table – Block HTML5 layout elements.

<section>• According to W3C's HTML5 documentation: "A section is a thematic

grouping of content, typically with a heading."

<section> <h1>WWF</h1> <p>The World Wide Fund for Nature (WWF) is....</p></section>

Page 22: HTML and CSS- Layout. HTML Layout Frame Table – Block HTML5 layout elements.

<article>• An article should make sense on its own, and it should be possible to read

it independently from the rest of the web site.• Examples of where an <article> element can be used:• Forum post• Blog post• Newspaper article

<article> <h1>What Does WWF Do?</h1> <p>WWF's mission is to stop the degradation of our planet's natural environment, and build a future in which humans live in harmony with nature.</p></article>

Page 23: HTML and CSS- Layout. HTML Layout Frame Table – Block HTML5 layout elements.

<footer>• A <footer> element should contain information about its containing

element.• A footer typically contains the author of the document, copyright

information, links to terms of use, contact information, etc.

<footer> <p>Posted by: Hege Refsnes</p> <p>Contact information: <a href="mailto:[email protected]"> [email protected]</a>.</p></footer>

Page 24: HTML and CSS- Layout. HTML Layout Frame Table – Block HTML5 layout elements.

<nav>• The <nav> element defines a set of navigation links.• The <nav> element is intended for large blocks of navigation links.

However, not all links in a document should be inside a <nav> element!

<nav> <a href="/html/">HTML</a> | <a href="/css/">CSS</a> | <a href="/js/">JavaScript</a> | <a href="/jquery/">jQuery</a></nav>

Page 25: HTML and CSS- Layout. HTML Layout Frame Table – Block HTML5 layout elements.

<aside>• The <aside> element defines some content aside from the content it is

placed in (like a sidebar).• The aside content should be related to the surrounding content.

<p>My family and I visited The Epcot center this summer.</p>

<aside> <h4>Epcot Center</h4> <p>The Epcot Center is a theme park in Disney World, Florida.</p></aside>

Page 27: HTML and CSS- Layout. HTML Layout Frame Table – Block HTML5 layout elements.
Page 28: HTML and CSS- Layout. HTML Layout Frame Table – Block HTML5 layout elements.

Layout trends 20151. Split screens

– http://www.deweyspizza.com– http://tympanus.net/Blueprints/SplitLayout/index.html– http://www.pixelatingbits.com/latest-web-trend-22-fantastic-vertically-split-layout-website-designs-for-insp

iration/

2. Block grids- http://www.sitepoint.com/web-layout-ideas-2015/

3. No chrome– http://www.webdesignerdepot.com

4. Single Screen– http://hatchcollective.co.uk

5. Big backgrounds/parallax- http://mintdesigncompany.com/

http://www.webdesignerdepot.com/2015/01/4-essential-layout-trends-for-2015/

Page 29: HTML and CSS- Layout. HTML Layout Frame Table – Block HTML5 layout elements.

Resources• w3schools.com• www.tutorialspoint.com

Page 30: HTML and CSS- Layout. HTML Layout Frame Table – Block HTML5 layout elements.

Practical• Please see practical #4 on my website


Recommended