IDs versus Classes Naming Your Tags for Maximum Functionality.

Slides:



Advertisements
Similar presentations
HTML Basics Customizing your site using the basics of HTML.
Advertisements

Chapter 3 – Web Design Tables & Page Layout
HTML and CSS. HTML Hyper Text Markup Language Tells browser how to display text and images.
CSS Cascading Style Sheets. Objectives Using Inline Styles Working with Selectors Using Embedded Styles Using an External Style Sheet Applying a Style.
Cascading Style Sheets
Chapter 2 HTML Basics Key Concepts
CSS CSS Precise Aesthetic Control. Cascading Style Sheets Though they can be put in HTML header, usually a separate page that the HTML links to Contains.
Chapter 3 – Designing your web pages Dr. Stephanos Mavromoustakos.
Recognizing the Benefits of Using CSS 1. The Evolution of CSS CSS was developed to standardize display information CSS was slow to be supported by browsers.
1 Dreamweaver CS5 intermediate class by Cookie Setton Build a CSS website WITHOUT TABLES Just when you thought you were starting to understand HTML coding,
กระบวนวิชา 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.
Tutorial 4: Creating page layout with css
Chapter 6 Web Typography
Beginning Web Site Creation: Dreamweaver CS4. XHTMLCSS  Describes the structure  Content  Collection of styles  Formatting body { background-color:
Unit 2, cont. September 14 HTML,Validating your pages, Publishing your site.
4.01 Cascading Style Sheets
Purpose Tags are the key to marking up content on your HTML page. It’s the tags that mark up sections of the page and are defined (aesthetically) on the.
Using color and fonts in HTML and XHTML Please use speaker notes for additional information!
Tags through Forms. This element is required for all HTML pages It must be at the top of every page of every website We’ll see later on why it is important.
CSS (Cascading Style Sheets): How the web is styled Create Rules that specify how the content of an HTML Element should appear. CSS controls how your web.
TUTORIAL 8: Enhancing a Web Site with Advanced CSS
HTML Tags. Objectives Know the commonly used HTML tags Create a simple webpage using the HTML tags that will be discussed.
HTML. Goals How to use the Komodo editor HTML coding and testing – List and Images – Tables and Links – At least 2 pages and navigation –
HTML & CSS A brief introduction. OUTLINE 1.What is HTML? 2.What is CSS? 3.How are they used together? 4.Troubleshooting/Common problems 5.More resources.
Working with Cascading Style Sheets. Introducing Cascading Style Sheets Style sheets are files or forms that describe the layout and appearance of a document.
Chapter 11 Cascading Style Sheets: Part I The Web Warrior Guide to Web Design Technologies.
Cascading style sheets (CSS)
ITP 104.  While you can do things like this:  Better to use styles instead:
Chapter 6 Web Typography. 2 Principles of Web Design Chapter 5 Objectives Understand principles for type design on a Web site Use the element Understand.
HTML (HyperText Markup Language)
 HTML stands for Hyper Text Mark-up Language. The coding language used to create documents for the World Wide Web  HTML is composed of tags. HTML tags.
Chapter 2 HTML Basics Key Concepts Copyright © 2013 Terry Ann Morris, Ed.D 1.
HTML. Basic HTML HTML document – HTML headings – to HTML paragraphs – HTML links – HTML images –
 This presentation introduces the following: › 3 types of CSS › CSS syntax › CSS comments › CSS and color › The box model.
 A style sheet is a single page of formatting instructions that can control the appearance of many HTML pages at once.  If style sheets accomplished.
WRT235: Writing in Electronic Environments CSS Classes, IDs, divs.
Cascading Style Sheets Orientation Learning Web Design: Chapter 11.
CSS CSS is short for C ascading S tyle S heets. It is a new web page layout method that has been added to HTML to give web developers more control over.
Unit 2, cont. September 12 More HTML. Attributes Some tags are modifiable with attributes This changes the way a tag behaves Modifying a tag requires.
 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.
CSS Cascading Style Sheets. CSS Advantages Greater typography and page layout control Style is separate from structure Styles can be stored in a separate.
Tutorial #6 – Creating Fixed Width Layouts. Tutorial #5 Review – Box Model Every html element is surround by a box Content, Padding, Border, Margin Can.
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.
CSS Tutorial 1 Introduction Syntax How to use style specifications. Styles.
CSS October 19. Review of CSS CSS was designed to separate the content of HTML pages from their appearance We are primarily dealing with external style.
IT Introduction to Website Development Welcome!
DIV, Span, CSS.
Course created by Sarah Phillips BBCD Melbourne BAPDCOM Version 1 – April 2013.
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.
INTRODUCTORY Tutorial 5 Using CSS for Layout and Printing.
Web Design (12) CSS Introduction. Cascading Style Sheets - Defined CSS is the W3C standard for defining the presentation of documents written in HTML.
HTML Basics. HTML Coding HTML Hypertext markup language The code used to create web pages.
Introduction to CSS Layout
Understanding ID and Class in CSS Web Design – Sec 4-9 Part or all of this lesson was adapted from the University of Washington’s “Web Design & Development.
Coding with HTML {. THE BASICS { What is HTML and how can you use it to make websites?
BEGINNER WEB DESIGN. INTRODUCTION Vocabulary Design Tools of the Trade HTML CSS.
NASRULLAHIBA.  It is time to take your web designing skills to the next level with Cascading Style Sheets (CSS). They are a way to control the look and.
Group 9: Through examples, explain how to build a css navigation bar. Presented by: Daniel Ku, Matt Iannacci & Iphia Henry.
CSS Layout Cascading Style Sheets. Lesson Overview  In this lesson, we’ll cover:  Brief CSS review  Creating sections with the tag  Creating inline.
Chapter 4 and 5. Objectives Introduce markup: elements and attributes How browsers interpret HTML documents Basic structure of HTML document What do style.
CSS Introductions. Objectives To take control of the appearance of a Web site by creating style sheets. To use a style sheet to give all the pages of.
Mimi Opkins.  One of the major benefits of using CSS is that you’re not forced to lay your sites out in tables.  The layout possibilities of CSS give.
Cascading Style Sheets for layout
4.01 Cascading Style Sheets
CSS Layouts: Grouping Elements
Webpage layout using CSS
Cascading Style Sheets for layout
Cascading Style Sheets (Layout)
Creating a Baseline Grid
4.01 Cascading Style Sheets
Presentation transcript:

IDs versus Classes Naming Your Tags for Maximum Functionality

Common Quiz Problems- Change Header Info Title for Browser Tab

Common Quiz Problems- Not properly closing img tag  / is needed at the end  There needs to be a single space between the “ and the /

Common Quiz Problems- unneeded or to make space that is already there Basic Html Page blah blah blah  Remember, block level elements (like,,, come with auto margin above and below– all the space you need

Common Quiz Problems- unneeded or to make space that is already there tortor posuere. Course Site me here  Links are inline (no space above and below) but the above the link pushes it down  has no space; therefore, the is needed around the address to provide white space between the course link and the link

Usability Notes  Alt tags should be as specific as possible   Not so good   Better. Think of what the person needs to read/hear if pic doesn’t load or if they are visually impaired

Usability Notes   Heading tags provide visual hierarchy to page  The most important heading tag on your page  Google recommends only one use of the H1 per page  H1 should be largest, boldest, most emphasized heading on page  Should contain key words for SEO (search engine optimization)  Though there is some debate as to how important this is  Should not be wrapped in an image 

Those Tags Again  Tags do a pretty good job of allowing us to mark up text that will then provide us the chance to style it with CSS.  However IDs and Classes allow us even more possibilities for layout and design.  Some designers think of IDs and Classes as HOOKS.  They are ways of sinking hooks into our tags that allow CSS to get a hold of them more precisely.

An Element Can Only Behave One Way ... Unless we use IDs and Classes!  An will behave a certain way with no CSS styling (browser default)  We can go to the CSS and make the H1s be a different font, size, bolding, etc.  But we’re left with the problem that ALL h1s will then do that and sometimes we want one (or some) to be H1s but behave slightly differently

An Element Can Only Behave One Way  And it’s not just H1s– ANY element can technically have an ID or Class applied to it One type of Link Another type of Link  Again, without IDs and Classes, links could only look one way.

IDs  Short for identifier.  An ID is a unique identifier for an element  They are most often used to mark page divisions ( )  Examples:  Content goes here 

They’re Attributes and Written the Same Way  IDs are written into the HTML with the tag/element name, an equal sign, and the ID name in quotation marks   One paragraph that might be stylized differently from the rest of the paragraphs on the page.   An unordered list that will be turned into a navigation bar with CSS  NOTE: BOTH ID AND CLASS NAMES CAN BE MADE UP. BUT YOU USUALLY WANT TO NAME BY FUNCTION

Rules  IDs  Each element can have only one ID  Each page can only have one element with that ID  Once you use an ID on a page, you can not use it on that page again. It can be used again on a different page in the same site.  You Can’t Do This:  (has more than one ID)   You’ve got a div and an unordered list with the same ID.  This will not validate and probably not give the effect you want.

IDs and CSS  IDs are targeted (or hooked into) on the CSS page with a hash mark (#) in front of the id name HTML Content CSS #container { width: 800px; height: auto; background-color: black; } The CSS creates a container for the page that is 800 pixels wide, has a height that automatically expands as large as is needed, and has a background color of black.

Classes  Classes are much more flexible.  They are not unique.  Classes let you take a style that might be used often in your document and apply it liberally all around.  Classes also let you style an element differently from how its styled by default without the class applied.

Target Multiple Elements with Same Class   CSS .fancyscript { font: blackadder; }  Now any element you assign a “fancyscript” class will appear in the blackadder font.  Note: in CSS, classes are identified with a period (.) in front of the class name.

Two (or more) different kinds of an element  I often have different link styles for my navigation versus inside the body text. Classes work wonders here. Home Spider- Man a.link { font-family: arial, sans-serif; font-size: 12px; } a.bodylink { font-family: arial, sans-serif; font-size: 15px; color: green; } HTML CSS

Stacking Classes  I rarely do it, but unlike IDS, you can technically stack multiple classes on an element  Now this image, and just this image, will display as a block with a decorative border. Images not given these classes will behave per usual.

A Useful Metaphor  Think of an ID as a student’s unique Student ID Number  This student ID# allows me to address one unique singular student. I can send an to just him or her.  Think of a Class as a way to address every single person who is a member of that class  I can address everyone in the Digital Document Design at once. I can send out a course .

Summary  Often you’ll just use a tag’s name by itself  This is a paragraph.  For a unique, occasional stylistic change you might add a class name  This is paragraph with special stylized emphasis  Sometimes you’ll want a style that you can apply to multiple elements, multiple times with a class   You’ve set up the possibility for paragraphs and unordered lists to both have a special emphasis styling

Summary  ID names and classes are written in the HTML by first writing the tag name immediately followed by id or class, an equals sign, and the id or class name in quotations   IDs are most often used on division sections of site layout: heading, navigation, left column, right column, footer, etc.

Summary  In the CSS, IDs are targeted with a hashmark and the id name  #container {  Classes are either identified by themselves with a period .fancyscript {  Or identified with the accompanying element if it needs to be targeted too (i.e. other elements have that class but you don’t want them to take on the specific property)  blockquote.fancyscript {  You want the tag to take on additional properties that the other fancyscript class members will not have