SlideShare a Scribd company logo
Create divisions in a web page
Information and CommunicationTechnology – 8
Objectives
•Understand <div> tags and the new HTML semantic
tags in breaking a page into sections;
•Learn to place the division in a specified location within
your page; and
•Create a division-based layout to your web page.
GoodWeb Design Basics
HTML provides you a lot of ways to layout your page better.This lesson will
teach you how to use the <div> tag effectively.
We will also learn the HTML5 new elements to make appropriate and
meaningful divisions to your page.
Good Web Design Basics
The basic idea behind good web design is to partition your web page into various sections and
columns to give it a professional appeal and to make it more user-friendly.
• Creating a template that you can use on all your web pages to render a familiar look every time
a visitor goes to a different part of your site.
• Creating a header section that runs across the top of your page in order to designate a
prominent place your website’s logo, slogan, graphic, etc.
• Creating multiple columns that are clearly divided your webpage into various logical sections
such as:
• Menu Column – should contain a list of links to other pages on your website.
• Main Content Column –holds that text you are currently reading.This column should render the
main text and graphics which defines what your web page is about.
• Creating a footer section to hold copy right information and important links.This help to create visual
ending to your web page and provide other important sections or link.
Advantages of Division-based Lay-out
• The most popular way of structuring a web page is by creating
tables.This method of partitioning a web page has become
obsolete.
• Web designers today are geared towards a more appealing wat
of separating content into sections which is called the division-
based layout.
• A division-based layout defines the area of page with <div> tags.
Each part of the page you want to format separately should b a
division.
Table vs DIVs
• Most websites have put their content in multiple columns.
• Multiple columns can be created by using <div> or <table> elements.
• Even though it is possible to create nice layouts with HTML tables, tables
were designed for presenting tabular data - NOT as a layout tool!
• The div element is used for grouping HTML elements and for creating rows
and columns with the help of CSS.
Table div
Advantages of the Division-based Layout
• You can place layout styles externally, and then make the style changes
to many pages at once simply by modifying the style sheet.
• It reduces the number of lines of code needed to produce a page.
What is <div> tag?
• The <div> tag is used to establish separate divisions or areas of your
page.
• The <div> tag is used to group block-elements to format them with CSS.
Masthead/header andTop
Navigation
Web Content body (can
still be divided into sub
section)
Bottom Navigation and
Copy Right Notice
If you layout the web page using <div> tags,
you can break thus page into general parts:
the masthead/header or the top navigator
bar, the content body text, the bottom
navigation bar, and the copyright notices.
Masthead is used as the title of a
newspaper or periodical as it appears
across the first page, front cover, or title
page issue.
On a website masthead represents the
graphic image or text title on the top of
the web page.
The id attribute
• The id attribute can be used with any tag element. When used along with the <div>
tag, it will identify and define an area of your page.
• Things to remember:
• As a unique identifier, the id’s value should only be used once on your page.
• Start the id value with a letter followed by any of these: letters, number digits (1-
9), dashes (-) and underscore ( _ ). Don’t use space or special characters.
• The value is case-sensitive.
<div id= “title”> is different from <div id= “Title”>
Syntax:
<div id =“masthead”> . . . . . . . </div>
<div id =“top-navigation”> . . . . . . . </div>
<div id =“web-contentbody”> . . . . . . . </div>
<div id =“bottom-navigation”> . . . . . . . </div>
<div id =“copyright-section”> . . . . . . . </div>
Creating Division to your Page
The output does not show a layout.You
can clearly see how your page is
divided into different sections.
Page Layout with <div>Tags
• Putting a style in the <div> tag will allow you to set the
appearance or how your division of your web page behaves on
the screen.You can put various style such as the following:
• Border
• Background
• Margin
• Width
• Height
Web Layouting with <div>Tag Styles
The <div> tag is general-purpose tag.
Though, without the id attribute of each
<div> tag, it’s hard to tell what section of
document each <div>.
The HTML5 Approach
• You have learned in Lesson 4 the new Semantic tag that HTML5 offers. It
provides a set of tags that clearly defines blocks of content that make up
• your webpage.
• Header –This is your web titles, taglines, logo, etc.
• Section –This is meant to identify substantial portions of content on the webpage.
• Article –This identifies major segments of content within a web page.
• Aside –This tag can be used in two different contexts.
• Footer –This is for the copyright section; it can include navigational links, or contact
information.
• Nav – this is intended for navigational links.
Set <aside>
• The <aside> tag is a new element for HTML5.The context of this element is whether to use it inside or
outside the <article> element.
• You can use the <aside> tag inside the <article> element or
• You can use it outside the <article> element.
<aside> element being used as a pull-quote inside
the article.
Syntax:
<article>.
.
.
<aside>
.
.
<article>
Syntax:
<body>
<section>
<aside>. . . </aside>
<article>. . .</article>
</section>
</body>
<aside> being used outside the article.This can be
placed as another division to your page.
Positioning a Division
• If you insert an additional <aside> division to your web page layout, and place your division beside
another either to the right or left, you can easily use the float style rule.
Positioning Style - if you want to place a division on a specific spot of your page, you can use the
position style rule.
There areThree possible values for a position style rule:
1. Static - An element with position: static; is not positioned in any special way; it is always
positioned according to the normal flow of the page.
2. Absolute value – position:absolute ;This value specifies a fixed position with the respect to its
parent element or tag. Usually, the <body> tag as the parent element.
3. Relative value – position: relative,This value is compensated from the element’s natural
position.Other elements on the page are not affected, even if the new position cause overlap.
4. Fixed value - position:fixed;This value specifies a fixed position within the browser window that
doesn’t change even when the display is scrolled up or down.
Position Style
• You must use each of these values in combination with top, right, bottom,
and /or left style rule that specifies the location to which the position style
rules refers.
Example:
To position a section at exactly 100px from the top of the page and
200px from the left side, the syntax should be:
<section style=“top:100px;left:200px;position:absolute”>
Horizontal Lines
• Horizontal Lines can be useful as a visual dividers between sections of text in
a web page.
• You can add a horizontal line after your header then add another horizontal
line before your footer.This will clearly show your division in your web page.
• You can simply add the horizontal line <hr> (horizontal rule) tag where you
want the line to appear.
HTML5- Create divisions in a web page

More Related Content

What's hot

Beginners css tutorial for web designers
Beginners css tutorial for web designersBeginners css tutorial for web designers
Beginners css tutorial for web designersSingsys Pte Ltd
 
cascading style sheet ppt
cascading style sheet pptcascading style sheet ppt
cascading style sheet pptabhilashagupta
 
(Fast) Introduction to HTML & CSS
(Fast) Introduction to HTML & CSS (Fast) Introduction to HTML & CSS
(Fast) Introduction to HTML & CSS Dave Kelly
 
HTML Introduction
HTML IntroductionHTML Introduction
HTML Introductionc525600
 
Web Site Design Principles
Web Site Design PrinciplesWeb Site Design Principles
Web Site Design PrinciplesMukesh Tekwani
 
HTML CSS JS in Nut shell
HTML  CSS JS in Nut shellHTML  CSS JS in Nut shell
HTML CSS JS in Nut shellAshwin Shiv
 
CSS Positioning and Features of CSS3
CSS Positioning and Features of CSS3CSS Positioning and Features of CSS3
CSS Positioning and Features of CSS3Jaimin Brahmbhatt
 
Css types internal, external and inline (1)
Css types internal, external and inline (1)Css types internal, external and inline (1)
Css types internal, external and inline (1)Webtech Learning
 
HTML Semantic Elements
HTML Semantic ElementsHTML Semantic Elements
HTML Semantic ElementsReema
 
Div tag presentation
Div tag presentationDiv tag presentation
Div tag presentationalyssa_lum11
 
Html / CSS Presentation
Html / CSS PresentationHtml / CSS Presentation
Html / CSS PresentationShawn Calvert
 
Html table
Html tableHtml table
Html tableJayjZens
 
Introduction to Cascading Style Sheets (CSS)
Introduction to Cascading Style Sheets (CSS)Introduction to Cascading Style Sheets (CSS)
Introduction to Cascading Style Sheets (CSS)Chris Poteet
 

What's hot (20)

Beginners css tutorial for web designers
Beginners css tutorial for web designersBeginners css tutorial for web designers
Beginners css tutorial for web designers
 
cascading style sheet ppt
cascading style sheet pptcascading style sheet ppt
cascading style sheet ppt
 
Css Ppt
Css PptCss Ppt
Css Ppt
 
(Fast) Introduction to HTML & CSS
(Fast) Introduction to HTML & CSS (Fast) Introduction to HTML & CSS
(Fast) Introduction to HTML & CSS
 
Css Display Property
Css Display PropertyCss Display Property
Css Display Property
 
HTML Introduction
HTML IntroductionHTML Introduction
HTML Introduction
 
CSS Best practice
CSS Best practiceCSS Best practice
CSS Best practice
 
Web Site Design Principles
Web Site Design PrinciplesWeb Site Design Principles
Web Site Design Principles
 
Css position
Css positionCss position
Css position
 
Css
CssCss
Css
 
HTML CSS JS in Nut shell
HTML  CSS JS in Nut shellHTML  CSS JS in Nut shell
HTML CSS JS in Nut shell
 
CSS Positioning and Features of CSS3
CSS Positioning and Features of CSS3CSS Positioning and Features of CSS3
CSS Positioning and Features of CSS3
 
Css types internal, external and inline (1)
Css types internal, external and inline (1)Css types internal, external and inline (1)
Css types internal, external and inline (1)
 
HTML Semantic Elements
HTML Semantic ElementsHTML Semantic Elements
HTML Semantic Elements
 
Div tag presentation
Div tag presentationDiv tag presentation
Div tag presentation
 
Html / CSS Presentation
Html / CSS PresentationHtml / CSS Presentation
Html / CSS Presentation
 
Html table
Html tableHtml table
Html table
 
Introduction to Cascading Style Sheets (CSS)
Introduction to Cascading Style Sheets (CSS)Introduction to Cascading Style Sheets (CSS)
Introduction to Cascading Style Sheets (CSS)
 
Css margins
Css marginsCss margins
Css margins
 
Web design principles
Web design principlesWeb design principles
Web design principles
 

Similar to HTML5- Create divisions in a web page

Creating Web Sites with HTML and CSS
Creating Web Sites with HTML and CSSCreating Web Sites with HTML and CSS
Creating Web Sites with HTML and CSSBG Java EE Course
 
Understanding the Web Page Layout
Understanding the Web Page LayoutUnderstanding the Web Page Layout
Understanding the Web Page LayoutJhaun Paul Enriquez
 
Website development using dreamweaver
Website development using dreamweaverWebsite development using dreamweaver
Website development using dreamweaverTekblink Jeeten
 
Code &amp; design your first website (3:16)
Code &amp; design your first website (3:16)Code &amp; design your first website (3:16)
Code &amp; design your first website (3:16)Thinkful
 
Intermediate Web Design.doc
Intermediate Web Design.docIntermediate Web Design.doc
Intermediate Web Design.docbutest
 
Intermediate Web Design.doc
Intermediate Web Design.docIntermediate Web Design.doc
Intermediate Web Design.docbutest
 
Blog creationguide forestview
Blog creationguide forestviewBlog creationguide forestview
Blog creationguide forestviewNikos Stagakis
 
Streamlining Website Development in Dreamweaver
Streamlining Website Development in DreamweaverStreamlining Website Development in Dreamweaver
Streamlining Website Development in Dreamweaverjkchapman
 
Customizing the Appearance and HTML Output of Visualforce Pages
Customizing the Appearance and HTML Output of VisualforcePages Customizing the Appearance and HTML Output of VisualforcePages
Customizing the Appearance and HTML Output of Visualforce Pages Mohammed Safwat Abu Kwaik
 
Code & Design your first website 4/18
Code & Design your first website 4/18Code & Design your first website 4/18
Code & Design your first website 4/18TJ Stalcup
 
Margin vs Padding.pdf
Margin vs Padding.pdfMargin vs Padding.pdf
Margin vs Padding.pdfWebMaxy
 
E commerce Important practices
E commerce Important practicesE commerce Important practices
E commerce Important practicesinkacoy
 
CSS Layout Tutorial
CSS Layout TutorialCSS Layout Tutorial
CSS Layout Tutorialhstryk
 

Similar to HTML5- Create divisions in a web page (20)

Creating Web Sites with HTML and CSS
Creating Web Sites with HTML and CSSCreating Web Sites with HTML and CSS
Creating Web Sites with HTML and CSS
 
Understanding the Web Page Layout
Understanding the Web Page LayoutUnderstanding the Web Page Layout
Understanding the Web Page Layout
 
Slice and Dice
Slice and DiceSlice and Dice
Slice and Dice
 
Website development using dreamweaver
Website development using dreamweaverWebsite development using dreamweaver
Website development using dreamweaver
 
Code &amp; design your first website (3:16)
Code &amp; design your first website (3:16)Code &amp; design your first website (3:16)
Code &amp; design your first website (3:16)
 
Working with the Latest Tendenci Modules
Working with the Latest Tendenci ModulesWorking with the Latest Tendenci Modules
Working with the Latest Tendenci Modules
 
Intermediate Web Design.doc
Intermediate Web Design.docIntermediate Web Design.doc
Intermediate Web Design.doc
 
Intermediate Web Design.doc
Intermediate Web Design.docIntermediate Web Design.doc
Intermediate Web Design.doc
 
Campers Packet
Campers PacketCampers Packet
Campers Packet
 
Blog creationguide forestview
Blog creationguide forestviewBlog creationguide forestview
Blog creationguide forestview
 
Streamlining Website Development in Dreamweaver
Streamlining Website Development in DreamweaverStreamlining Website Development in Dreamweaver
Streamlining Website Development in Dreamweaver
 
Customizing the Appearance and HTML Output of Visualforce Pages
Customizing the Appearance and HTML Output of VisualforcePages Customizing the Appearance and HTML Output of VisualforcePages
Customizing the Appearance and HTML Output of Visualforce Pages
 
Html and html5 cheat sheets
Html and html5 cheat sheetsHtml and html5 cheat sheets
Html and html5 cheat sheets
 
ARTICULOENINGLES
ARTICULOENINGLESARTICULOENINGLES
ARTICULOENINGLES
 
Code & Design your first website 4/18
Code & Design your first website 4/18Code & Design your first website 4/18
Code & Design your first website 4/18
 
Margin vs Padding.pdf
Margin vs Padding.pdfMargin vs Padding.pdf
Margin vs Padding.pdf
 
Chapter 12
Chapter 12Chapter 12
Chapter 12
 
LO3 - Lesson 21 - Page Setup
LO3 - Lesson 21 - Page SetupLO3 - Lesson 21 - Page Setup
LO3 - Lesson 21 - Page Setup
 
E commerce Important practices
E commerce Important practicesE commerce Important practices
E commerce Important practices
 
CSS Layout Tutorial
CSS Layout TutorialCSS Layout Tutorial
CSS Layout Tutorial
 

More from Grayzon Gonzales, LPT

Lesson 2.2 Online Safety And Security.pptx
Lesson 2.2 Online Safety And Security.pptxLesson 2.2 Online Safety And Security.pptx
Lesson 2.2 Online Safety And Security.pptxGrayzon Gonzales, LPT
 
Computer hardware servicing practice occupational health and safety procedure
Computer hardware servicing   practice occupational health and safety procedure Computer hardware servicing   practice occupational health and safety procedure
Computer hardware servicing practice occupational health and safety procedure Grayzon Gonzales, LPT
 
HTML5 - create hyperlinks and anchors
HTML5 - create hyperlinks and anchorsHTML5 - create hyperlinks and anchors
HTML5 - create hyperlinks and anchorsGrayzon Gonzales, LPT
 
HTML5 - Insert images and Apply page backgrounds
HTML5 - Insert images and Apply page backgroundsHTML5 - Insert images and Apply page backgrounds
HTML5 - Insert images and Apply page backgroundsGrayzon Gonzales, LPT
 
HTML Start Up - Introduction to HTML
HTML Start Up - Introduction to HTMLHTML Start Up - Introduction to HTML
HTML Start Up - Introduction to HTMLGrayzon Gonzales, LPT
 
Adobe Photoshop and its role in society ( Introduction)
Adobe Photoshop and its role in society ( Introduction) Adobe Photoshop and its role in society ( Introduction)
Adobe Photoshop and its role in society ( Introduction) Grayzon Gonzales, LPT
 

More from Grayzon Gonzales, LPT (13)

Lesson 2.2 Online Safety And Security.pptx
Lesson 2.2 Online Safety And Security.pptxLesson 2.2 Online Safety And Security.pptx
Lesson 2.2 Online Safety And Security.pptx
 
Lesson 2.1 Rules of Netiquette.pptx
Lesson 2.1 Rules of Netiquette.pptxLesson 2.1 Rules of Netiquette.pptx
Lesson 2.1 Rules of Netiquette.pptx
 
Lesson 1 Introudctioin to ICT.pptx
Lesson 1 Introudctioin to ICT.pptxLesson 1 Introudctioin to ICT.pptx
Lesson 1 Introudctioin to ICT.pptx
 
ICT as a Platform for Change
ICT as a Platform for Change ICT as a Platform for Change
ICT as a Platform for Change
 
Computer hardware servicing practice occupational health and safety procedure
Computer hardware servicing   practice occupational health and safety procedure Computer hardware servicing   practice occupational health and safety procedure
Computer hardware servicing practice occupational health and safety procedure
 
Small Basic - Branching and Loop
Small Basic - Branching and LoopSmall Basic - Branching and Loop
Small Basic - Branching and Loop
 
HTML5 - create hyperlinks and anchors
HTML5 - create hyperlinks and anchorsHTML5 - create hyperlinks and anchors
HTML5 - create hyperlinks and anchors
 
HTML5 - Insert images and Apply page backgrounds
HTML5 - Insert images and Apply page backgroundsHTML5 - Insert images and Apply page backgrounds
HTML5 - Insert images and Apply page backgrounds
 
HTML5 - My First Webpage
HTML5 - My First Webpage HTML5 - My First Webpage
HTML5 - My First Webpage
 
HTML Tags
HTML Tags HTML Tags
HTML Tags
 
HTML Start Up - Introduction to HTML
HTML Start Up - Introduction to HTMLHTML Start Up - Introduction to HTML
HTML Start Up - Introduction to HTML
 
Adobe Photoshop - Brush tool
Adobe Photoshop - Brush toolAdobe Photoshop - Brush tool
Adobe Photoshop - Brush tool
 
Adobe Photoshop and its role in society ( Introduction)
Adobe Photoshop and its role in society ( Introduction) Adobe Photoshop and its role in society ( Introduction)
Adobe Photoshop and its role in society ( Introduction)
 

Recently uploaded

ER(Entity Relationship) Diagram for online shopping - TAE
ER(Entity Relationship) Diagram for online shopping - TAEER(Entity Relationship) Diagram for online shopping - TAE
ER(Entity Relationship) Diagram for online shopping - TAEHimani415946
 
The Use of AI in Indonesia Election 2024: A Case Study
The Use of AI in Indonesia Election 2024: A Case StudyThe Use of AI in Indonesia Election 2024: A Case Study
The Use of AI in Indonesia Election 2024: A Case StudyDamar Juniarto
 
Article writing on excessive use of internet.pptx
Article writing on excessive use of internet.pptxArticle writing on excessive use of internet.pptx
Article writing on excessive use of internet.pptxabhinandnam9997
 
一比一原版UTS毕业证悉尼科技大学毕业证成绩单如何办理
一比一原版UTS毕业证悉尼科技大学毕业证成绩单如何办理一比一原版UTS毕业证悉尼科技大学毕业证成绩单如何办理
一比一原版UTS毕业证悉尼科技大学毕业证成绩单如何办理aagad
 
audience research (emma) 1.pptxkkkkkkkkkkkkkkkkk
audience research (emma) 1.pptxkkkkkkkkkkkkkkkkkaudience research (emma) 1.pptxkkkkkkkkkkkkkkkkk
audience research (emma) 1.pptxkkkkkkkkkkkkkkkkklolsDocherty
 
How Do I Begin the Linksys Velop Setup Process?
How Do I Begin the Linksys Velop Setup Process?How Do I Begin the Linksys Velop Setup Process?
How Do I Begin the Linksys Velop Setup Process?Linksys Velop Login
 
Multi-cluster Kubernetes Networking- Patterns, Projects and Guidelines
Multi-cluster Kubernetes Networking- Patterns, Projects and GuidelinesMulti-cluster Kubernetes Networking- Patterns, Projects and Guidelines
Multi-cluster Kubernetes Networking- Patterns, Projects and GuidelinesSanjeev Rampal
 
Bug Bounty Blueprint : A Beginner's Guide
Bug Bounty Blueprint : A Beginner's GuideBug Bounty Blueprint : A Beginner's Guide
Bug Bounty Blueprint : A Beginner's GuideVarun Mithran
 
The+Prospects+of+E-Commerce+in+China.pptx
The+Prospects+of+E-Commerce+in+China.pptxThe+Prospects+of+E-Commerce+in+China.pptx
The+Prospects+of+E-Commerce+in+China.pptxlaozhuseo02
 
Case study on merger of Vodafone and Idea (VI).pptx
Case study on merger of Vodafone and Idea (VI).pptxCase study on merger of Vodafone and Idea (VI).pptx
Case study on merger of Vodafone and Idea (VI).pptxAnkitscribd
 
Pvtaan Social media marketing proposal.pdf
Pvtaan Social media marketing proposal.pdfPvtaan Social media marketing proposal.pdf
Pvtaan Social media marketing proposal.pdfPvtaan
 
The AI Powered Organization-Intro to AI-LAN.pdf
The AI Powered Organization-Intro to AI-LAN.pdfThe AI Powered Organization-Intro to AI-LAN.pdf
The AI Powered Organization-Intro to AI-LAN.pdfSiskaFitrianingrum
 

Recently uploaded (13)

ER(Entity Relationship) Diagram for online shopping - TAE
ER(Entity Relationship) Diagram for online shopping - TAEER(Entity Relationship) Diagram for online shopping - TAE
ER(Entity Relationship) Diagram for online shopping - TAE
 
The Use of AI in Indonesia Election 2024: A Case Study
The Use of AI in Indonesia Election 2024: A Case StudyThe Use of AI in Indonesia Election 2024: A Case Study
The Use of AI in Indonesia Election 2024: A Case Study
 
Article writing on excessive use of internet.pptx
Article writing on excessive use of internet.pptxArticle writing on excessive use of internet.pptx
Article writing on excessive use of internet.pptx
 
The Best AI Powered Software - Intellivid AI Studio
The Best AI Powered Software - Intellivid AI StudioThe Best AI Powered Software - Intellivid AI Studio
The Best AI Powered Software - Intellivid AI Studio
 
一比一原版UTS毕业证悉尼科技大学毕业证成绩单如何办理
一比一原版UTS毕业证悉尼科技大学毕业证成绩单如何办理一比一原版UTS毕业证悉尼科技大学毕业证成绩单如何办理
一比一原版UTS毕业证悉尼科技大学毕业证成绩单如何办理
 
audience research (emma) 1.pptxkkkkkkkkkkkkkkkkk
audience research (emma) 1.pptxkkkkkkkkkkkkkkkkkaudience research (emma) 1.pptxkkkkkkkkkkkkkkkkk
audience research (emma) 1.pptxkkkkkkkkkkkkkkkkk
 
How Do I Begin the Linksys Velop Setup Process?
How Do I Begin the Linksys Velop Setup Process?How Do I Begin the Linksys Velop Setup Process?
How Do I Begin the Linksys Velop Setup Process?
 
Multi-cluster Kubernetes Networking- Patterns, Projects and Guidelines
Multi-cluster Kubernetes Networking- Patterns, Projects and GuidelinesMulti-cluster Kubernetes Networking- Patterns, Projects and Guidelines
Multi-cluster Kubernetes Networking- Patterns, Projects and Guidelines
 
Bug Bounty Blueprint : A Beginner's Guide
Bug Bounty Blueprint : A Beginner's GuideBug Bounty Blueprint : A Beginner's Guide
Bug Bounty Blueprint : A Beginner's Guide
 
The+Prospects+of+E-Commerce+in+China.pptx
The+Prospects+of+E-Commerce+in+China.pptxThe+Prospects+of+E-Commerce+in+China.pptx
The+Prospects+of+E-Commerce+in+China.pptx
 
Case study on merger of Vodafone and Idea (VI).pptx
Case study on merger of Vodafone and Idea (VI).pptxCase study on merger of Vodafone and Idea (VI).pptx
Case study on merger of Vodafone and Idea (VI).pptx
 
Pvtaan Social media marketing proposal.pdf
Pvtaan Social media marketing proposal.pdfPvtaan Social media marketing proposal.pdf
Pvtaan Social media marketing proposal.pdf
 
The AI Powered Organization-Intro to AI-LAN.pdf
The AI Powered Organization-Intro to AI-LAN.pdfThe AI Powered Organization-Intro to AI-LAN.pdf
The AI Powered Organization-Intro to AI-LAN.pdf
 

HTML5- Create divisions in a web page

  • 1. Create divisions in a web page Information and CommunicationTechnology – 8
  • 2. Objectives •Understand <div> tags and the new HTML semantic tags in breaking a page into sections; •Learn to place the division in a specified location within your page; and •Create a division-based layout to your web page.
  • 3. GoodWeb Design Basics HTML provides you a lot of ways to layout your page better.This lesson will teach you how to use the <div> tag effectively. We will also learn the HTML5 new elements to make appropriate and meaningful divisions to your page.
  • 4.
  • 5. Good Web Design Basics The basic idea behind good web design is to partition your web page into various sections and columns to give it a professional appeal and to make it more user-friendly. • Creating a template that you can use on all your web pages to render a familiar look every time a visitor goes to a different part of your site. • Creating a header section that runs across the top of your page in order to designate a prominent place your website’s logo, slogan, graphic, etc. • Creating multiple columns that are clearly divided your webpage into various logical sections such as: • Menu Column – should contain a list of links to other pages on your website. • Main Content Column –holds that text you are currently reading.This column should render the main text and graphics which defines what your web page is about. • Creating a footer section to hold copy right information and important links.This help to create visual ending to your web page and provide other important sections or link.
  • 6. Advantages of Division-based Lay-out • The most popular way of structuring a web page is by creating tables.This method of partitioning a web page has become obsolete. • Web designers today are geared towards a more appealing wat of separating content into sections which is called the division- based layout. • A division-based layout defines the area of page with <div> tags. Each part of the page you want to format separately should b a division.
  • 7. Table vs DIVs • Most websites have put their content in multiple columns. • Multiple columns can be created by using <div> or <table> elements. • Even though it is possible to create nice layouts with HTML tables, tables were designed for presenting tabular data - NOT as a layout tool! • The div element is used for grouping HTML elements and for creating rows and columns with the help of CSS. Table div
  • 8.
  • 9. Advantages of the Division-based Layout • You can place layout styles externally, and then make the style changes to many pages at once simply by modifying the style sheet. • It reduces the number of lines of code needed to produce a page. What is <div> tag? • The <div> tag is used to establish separate divisions or areas of your page. • The <div> tag is used to group block-elements to format them with CSS.
  • 10. Masthead/header andTop Navigation Web Content body (can still be divided into sub section) Bottom Navigation and Copy Right Notice
  • 11. If you layout the web page using <div> tags, you can break thus page into general parts: the masthead/header or the top navigator bar, the content body text, the bottom navigation bar, and the copyright notices. Masthead is used as the title of a newspaper or periodical as it appears across the first page, front cover, or title page issue. On a website masthead represents the graphic image or text title on the top of the web page.
  • 12. The id attribute • The id attribute can be used with any tag element. When used along with the <div> tag, it will identify and define an area of your page. • Things to remember: • As a unique identifier, the id’s value should only be used once on your page. • Start the id value with a letter followed by any of these: letters, number digits (1- 9), dashes (-) and underscore ( _ ). Don’t use space or special characters. • The value is case-sensitive. <div id= “title”> is different from <div id= “Title”> Syntax: <div id =“masthead”> . . . . . . . </div> <div id =“top-navigation”> . . . . . . . </div> <div id =“web-contentbody”> . . . . . . . </div> <div id =“bottom-navigation”> . . . . . . . </div> <div id =“copyright-section”> . . . . . . . </div>
  • 13. Creating Division to your Page The output does not show a layout.You can clearly see how your page is divided into different sections.
  • 14. Page Layout with <div>Tags • Putting a style in the <div> tag will allow you to set the appearance or how your division of your web page behaves on the screen.You can put various style such as the following: • Border • Background • Margin • Width • Height
  • 15. Web Layouting with <div>Tag Styles The <div> tag is general-purpose tag. Though, without the id attribute of each <div> tag, it’s hard to tell what section of document each <div>.
  • 16. The HTML5 Approach • You have learned in Lesson 4 the new Semantic tag that HTML5 offers. It provides a set of tags that clearly defines blocks of content that make up • your webpage. • Header –This is your web titles, taglines, logo, etc. • Section –This is meant to identify substantial portions of content on the webpage. • Article –This identifies major segments of content within a web page. • Aside –This tag can be used in two different contexts. • Footer –This is for the copyright section; it can include navigational links, or contact information. • Nav – this is intended for navigational links.
  • 17. Set <aside> • The <aside> tag is a new element for HTML5.The context of this element is whether to use it inside or outside the <article> element. • You can use the <aside> tag inside the <article> element or • You can use it outside the <article> element. <aside> element being used as a pull-quote inside the article. Syntax: <article>. . . <aside> . . <article> Syntax: <body> <section> <aside>. . . </aside> <article>. . .</article> </section> </body> <aside> being used outside the article.This can be placed as another division to your page.
  • 18. Positioning a Division • If you insert an additional <aside> division to your web page layout, and place your division beside another either to the right or left, you can easily use the float style rule. Positioning Style - if you want to place a division on a specific spot of your page, you can use the position style rule. There areThree possible values for a position style rule: 1. Static - An element with position: static; is not positioned in any special way; it is always positioned according to the normal flow of the page. 2. Absolute value – position:absolute ;This value specifies a fixed position with the respect to its parent element or tag. Usually, the <body> tag as the parent element. 3. Relative value – position: relative,This value is compensated from the element’s natural position.Other elements on the page are not affected, even if the new position cause overlap. 4. Fixed value - position:fixed;This value specifies a fixed position within the browser window that doesn’t change even when the display is scrolled up or down.
  • 19.
  • 20.
  • 21. Position Style • You must use each of these values in combination with top, right, bottom, and /or left style rule that specifies the location to which the position style rules refers. Example: To position a section at exactly 100px from the top of the page and 200px from the left side, the syntax should be: <section style=“top:100px;left:200px;position:absolute”>
  • 22. Horizontal Lines • Horizontal Lines can be useful as a visual dividers between sections of text in a web page. • You can add a horizontal line after your header then add another horizontal line before your footer.This will clearly show your division in your web page. • You can simply add the horizontal line <hr> (horizontal rule) tag where you want the line to appear.