NAVIGATION USING HTML TO SET UP THE BASIC STRUCTURE OF A NAV BAR.

Slides:



Advertisements
Similar presentations
Cascading Style Sheets
Advertisements

Copyright © Terry Felke-Morris WEB DEVELOPMENT & DESIGN FOUNDATIONS WITH HTML5 Chapter 6 Key Concepts 1 Copyright © Terry Felke-Morris.
Copyright © Terry Felke-Morris WEB DEVELOPMENT & DESIGN FOUNDATIONS WITH HTML5 Chapter 6 Key Concepts 1 Copyright © Terry Felke-Morris.
Very quick intro HTML and CSS. Sample html A Web Title.
FORMATTING IN CONTEXT. FOLLOW UPS ANCHOR POINTS MUST BE UNIQUE  If you have more than one, how does it know where to go?  They can be repeated across.
Principles of Web Design 5 th Edition Chapter Nine Site Navigation.
SM5312 week 11: CSS Menus & Navigation Bars1 An Introduction to Cascading Style Sheets CSS Menus and Navigation Bars Nick Foxall.
Advance CSS (Menu and Layout) Miftahul Huda. CSS Navigation MENU It's truly remarkable what can be achieved through CSS, especially with navigation menus.
1 Pengantar Teknologi Internet W03: CSS Cascading Style Sheets.
CIS 1310 – HTML & CSS 6 Layout. CIS 1310 – HTML & CSS Learning Outcomes  Describe & Apply the CSS Box Model  Configure Float with CSS  Designate Positioning.
Navigation Bars Level 2 Extended Certificate Unit B12 Doing Business Online.
กระบวนวิชา CSS. What is CSS? CSS stands for Cascading Style Sheets Styles define how to display HTML elements Styles were added to HTML 4.0 to.
Unit 20 - Client Side Customisation of Web Pages
CSS, cont. October 12, Unit 4. Creating a Sidebar We know how to create a sidebar –Use the float property div#sidebar{ float: left; } Item1 Item2 Item3.
Chapter 9. Links  When styling a link, you must tell CSS both what you want to style, and when you want the style to happen  Web browsers keep track.
Using HTML Tables.
1 The Structure of a Web Table beginning of the table structure first row of three in the table end of the table structure table cells You do not need.
Page Layout & Mobile Web Using columns, grid systems, etc… to layout sites for desktops and mobile.
Cascading Style Sheets CS3505. What are CSS? Method for adding style attributes consistently to HML tags Cascading because styles are applied in order.
CSS Dvijesh Bhatt.
ITP 104.  While you can do things like this:  Better to use styles instead:
Cascading Style Sheet (CSS)
WDV 101 Intro to Website Development
Copyright © Terry Felke-Morris WEB DEVELOPMENT & DESIGN FOUNDATIONS WITH HTML5 7 TH EDITION Chapter 6 Key Concepts 1 Copyright © Terry Felke-Morris.
Doman’s Sections Information in this presentation includes text and images from
Tutorial #4 Formatting Text and Links. Tutorial #3 Review - CSS CSS format Selector { property1: value1; /* Comments */ } Embedded, In-Line, and External.
 Word doc for you to download › Link at the beginning of class › 10 Questions › Answers to be added inline  Post to Sakai when completed › No resubmits.
Designing a Web Page with Tables. A text table: contains only text, evenly spaced on the Web page in rows and columns uses only standard word processing.
 Remember that HTML is just text  Need to point to pictures  Use the img tag  alt: › screen reader › REQUIRED for this class and to validate.
Lesson 03 // Cascading Style Sheets. CSS Stands for Cascading Style Sheets. We’ll be using a combination of Html and CSS to create websites. CSS is a.
IT Introduction to Website Development Welcome!
CSS Class 2 -Add margins to elements on a page. -Set width and height of elements. - CSS shorthand properties for box model. -Style links. -Style tables.
Week 8 – Part 2 Page Layout Basics Key Concepts 1.
Principles of Web Design 6 th Edition Chapter 9 – Site Navigation.
Cascading Style Sheets (CSS). A style sheet is a document which describes the presentation semantics of a document written in a mark-up language such.
Web Development & Design Foundations with HTML5 7th Edition
Copyright © Terry Felke-Morris WEB DEVELOPMENT & DESIGN FOUNDATIONS WITH HTML5 Chapter 6 Key Concepts 1 Copyright © Terry Felke-Morris.
Internet Technology Dr Jing LU Updated Dr Violet Snell / Dr Kalin Penev 1 Internet Technology (week 6)  Recap: Validating HTML  Page Layout.
INT222 - Internet Fundamentals Shi, Yue (Sunny) Office: T2095 SENECA COLLEGE.
CSS – 8 Step Walk Through! Using HTML. You will use 8 steps to transform this page to…
CONTROLLING Page layout
1 Preparation for site Create a folder in MyDocuments: beavercheese. Create a subfolder, images Classes, career, DW beginner Download.
Cascading Style Sheet (CSS) SAMPLE IT133 Pengembangan Web.
Group 9: Through examples, explain how to build a css navigation bar. Presented by: Daniel Ku, Matt Iannacci & Iphia Henry.
Stylizing a Navigational Menu Web Design Section 6-3 Part or all of this lesson was adapted from the University of Washington’s “Web Design & Development.
 Add one element at a time  If it doesn’t do what you want, › Delete it › DON’T just keep piling on more items.
HTML & CSS Contents: the different ways we can use to apply CSS to The HTML documents CSS Colors and Background CSS Fonts CSS Text CSS box model: padding,
Blended HTML and CSS Fundamentals 3 rd EDITION Tutorial 4 Formatting Text and Links.
WebD Introduction to CSS By Manik Rastogi.
>> Navigation and Layouts in CSS
Semester - Review.
Unit 3 - Review.
Cascading Style Sheets (Layout)
>> CSS Layouts.
Web Development & Design Foundations with HTML5 7th Edition
Chapter 7 Page Layout Basics Key Concepts
Web Development & Design Foundations with HTML5 8th Edition
Web Development & Design Foundations with HTML5
Cascading Style Sheets
IS333: MULTI-TIER APPLICATION DEVELOPMENT
Basics of Web Design Chapter 7 Page Layout Basics Key Concepts
Fixed Positioning.
Web Development & Design Foundations with H T M L 5
Web Development & Design Foundations with HTML5
Floating and Positioning
Web Development & Design Foundations with HTML5
Laying out Elements with CSS
Multipage Sites.
Presentation transcript:

NAVIGATION USING HTML TO SET UP THE BASIC STRUCTURE OF A NAV BAR

OPEN INDEX.HTML Lets review the code and view the page within the browser. Notice that this is a standard navigation, anchor tags are used to create the hyperlinks. A navigation bar needs standard HTML as a base. Just a tip, if you have not created the page, or do not know what the page name will be called, just simply place in “”. Ex: Rules

LETS EXPLORE THE NAV SECTION. By opening the style.css, you can noticed that the width right now is set to 960px, and height is set to 50px, with a background color added. Keep that in the back of your mind when designing a nav section. Since this website is a fixed size, we need to assure that we fit in that area.

ANCHOR TAGS Anchor tags are considered inline elements. They do not add any space above or below the content, as does with tags. If you look at the list of anchor tags, it essentially is a list! You really want to group the anchor tags together. So, you should wrap those anchor tags within a list. Semantically it makes sense. It would be possible to build it with paragraph tags, but a list makes better sense. With an addition of a list, it will provide other additional elements for CSS hooks and styling. Lists are widely used, eventually, a listless navigation area will be the norm, but as we speak it is the way to go! With this setup, you can add a nested list, and create interesting navigational area.

LETS ADD A LIST Home About Products Contact Rules

VIEW THE PAGE IN THE BROWSER It really does not look like a navigation bar. The list has the links going vertically, and we want it to go horizontally. Why? A list is a block element, it will force space above and below the list items. We need to remove the space that has been added, and make it «float» side by side. And need to remove the bullets. This is all done with CSS.

OPEN THE STYLE.CSS First, you need to remove the spacing that is added by adding the tag. You will also use list-style-type to remove the bullets. nav ul { margin:0; padding:0; list-style-type:none; } I encourage you to review the page every time you make adjustment to the style, to see the affect it has on the page.

HOW DO WE GET THE LIST ITEMS SIDE BY SIDE? First, you need to change the list item markers to an inline element. nav ul li { display: inline; } This will convert the block element to inline, and remove the space above and below the. This is where you have to have a good idea of inline vs block elements. Also note, there is no need to use float, if changing this to inline.

NOW IT IS TIME TO FOCUS IN ON THE We have now set up the list correctly, and remove all spacing. Now you need to change your attention to the anchor tag. This is where most of the formatting will be done! Right now, the links are side by side. Lets add some spacing, and need to make the text larger to be easier to read. We will force space between the links with adding margins to the left and right of the anchor tags.

NOW IT IS TIME TO FOCUS IN ON THE nav ul li a { margin-left: 15px; margin-right:15px; font-size: 18px; text-transform: uppercase; font-weight: bold; }

NOW IT IS TIME TO FOCUS IN ON THE By default, anchor tags will add an underline. Lets remove this underline with the text-decoration style rule. Add this to the existing style nav ul li a{} text-decoration: none; The color of the links are not matching with the color scheme, what could you do?

DID YOU THINK ABOUT THE PSEUDO CLASSES nav a:link { color: #FBF7F7; } nav a:visited { color: #818181; } nav a:hover { color: #FBF7F7; } nav a:active { color: #818181; } For this to work, you need to make sure that it is in the correct order. Link, visited, hover, active.

HOW CAN WE FORCE THE LINKS DOWN? By default the links are added to the top of the nav section. I need to force some space so the navigation is within the middle of the nav area. Remember the height of the nav section? It is 50px. Since I want the entire group to move down, I should apply a style to the tag, since it basically is the main grouping of the list of items. To do you will want to add some padding to the top to the nav ul style rule padding-top:15px; Place this right after padding:0;

LETS SWITCH GEARS, LETS CREATE A VERTICAL NAVIGATIONAL BAR Open vertical.html Review the HTML coding. Notice how the section is added within the main area of your page. Open vertical.css, and review the nav style. This page is set to have 3 columns. is the first column. To get the columns to fit side by side, a float:left is added. If you add the width of nav, #col2, and #col3, it should equal to 960px exact. This is the size set for the main div tag, which houses the 3 columns.

LETS ADD THE LIST! Home About Products Contact Rules

LETS REMOVE THE SPACING, JUST LIKE WE DID WITH THE HORIZONTAL BAR. nav ul { margin:0; padding:0; list-style-type:none; } We do not need to add the display:inline. We do want the items to appear on top of each other.

MOST OF THE TIME YOU WANT TO ADD BORDERS AND SPACING TO THE ANCHOR TAG. Anchor tags are inline elements. You cannot add a border to the anchor tags, or add spacing with the use of padding. You need to convert the tag to a block element by adding display:block nav ul li a { display:block; font-size: 18px; text-transform: uppercase; font-weight: bold; text-decoration: none; }

We just set the size of the font, and style. Also, the display:block was added to be able to add padding, margins, and borders to the anchor tag. To help separate the links, lets add some spacing, and borders to the style that was just created. You will also center align the text. padding-top: 15px; padding-bottom:15px; border-top:1px solid; border-bottom:1px solid; text-align:center;

Lets format the links with the pseudo classes nav a:link { color: #FBF7F7; } nav a:visited { color: #818181; } nav a:hover { color: #FBF7F7; } nav a:active { color: #818181; }