WDV 101 Intro to Website Development

Slides:



Advertisements
Similar presentations
CSS Cascading Style Sheets. Objectives Using Inline Styles Working with Selectors Using Embedded Styles Using an External Style Sheet Applying a Style.
Advertisements

Cascading Style Sheets
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.
Cascading Style Sheets. CSS stands for Cascading Style Sheets and is a simple styling language which allows attaching style to HTML elements. CSS is a.
CSS BASICS. CSS Rules Components of a CSS Rule  Selector: Part of the rule that targets an element to be styled  Declaration: Two or more parts: a.
Building a Website: Cascading Style Sheets (CSS) Fall 2013.
Tutorial 4 Formatting Text. XP New Perspectives on Blended HTML, XHTML, and CSS2 Objectives Create a spread heading Indent text Change the line spacing.
CSE CASCADING STYLE SHEETS CSS Faculty of Computer Science and Engineering.
Cascading Style Sheets Scripting with Style. CSS versus HTML  Ways to format in HTML –HTML Tag extensions –Converting Text to images –Page Layout with.
SM5312 week 6: basic CSS syntax1 An Introduction to Cascading Style Sheets Basic CSS Syntax Nick Foxall.
Using Cascading Style Sheets CSS Structure. Goals Understand how contextual, class and ID selectors work Understand how contextual, class and ID selectors.
© 2007 D. J. Foreman CSS-1 Cascading Style Sheets Styles.
CSS: Cascading Style Sheets. 2 History HTML tags were originally designed to define the content of a document. The layout of the document was supposed.
Principles of Web Design 6 th Edition Chapter 4 – Cascading Style Sheets.
Cascading Style Sheets Example
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.
Cascading Style Sheets CSS.  Standard defined by the W3C  CSS1 (released 1996) 50 properties  CSS2 (released 1998) 150 properties (positioning)  CSS3.
Cascading Style Sheet (CSS)
1Computer Sciences Department. And use
Tutorial #3 Cascading Style Sheets. Review: Last Class Image sizing Pathnames Project Default Path Relative Path Absolute Path Blackboard Homework Submission.
WORKING WITH CASCADING
New Perspectives on XML, 2nd Edition Tutorial 5 1 TUTORIAL 5 WORKING WITH CASCADING STYLE SHEETS.
XP New Perspectives on XML Tutorial 5 1 TUTORIAL 5 CSS Tutorial – Carey ISBN
Cascading Style Sheets. Defines the presentation of one or more web pages Similar to a template Can control the appearance of an entire web site giving.
Cascading Style Sheets Part 1 Presentation by Audrey Altman Exercises from CSS: The Missing Manual.
Copyright © Terry Felke-Morris WEB DEVELOPMENT & DESIGN FOUNDATIONS WITH HTML5 7 TH EDITION Chapter 6 Key Concepts 1 Copyright © Terry Felke-Morris.
INTRODUCTION TO HTML5 Styling Text. Change the Font Size  You can use the font-size property to change the font size for a document’s text.  Instead.
Doman’s Sections Information in this presentation includes text and images from
CSS: Cascading Style Sheets. 2 What are Style Sheets A style sheet is a mechanism that allows to specify how HTML (/XHTML/XML) pages should look The style.
Today’s objectives  Review  CSS | Rules | Declarations  HTML Structure document  Class asignment.
HTML, Third Edition--Illustrated Introductory 1 HTML, Third Edition Illustrated Introductory Unit E Formatting with Cascading Style Sheets.
XP Dreamweaver 8.0 Tutorial 3 1 Adding Text and Formatting Text with CSS Styles.
 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.
CIS 1315 – Web Development for Educators CIS 1315 HTML Tutorials 3 & 4: Working With CSS.
Tutorial #4 Formatting Text and Links. Tutorial #3 Review - CSS CSS format Selector { property1: value1; /* Comments */ } Embedded, In-Line, and External.
Introduction to Programming the WWW I CMSC Summer 2004 Lecture 7.
Tutorial 5 Formatting with CSS. Objectives Session 5.1 – Evaluate why CSS styles are used – Determine where to write styles – Create an element selector.
Tutorial #3 Cascading Style Sheets. Tutorial #2 Review - Anchors Links to Site DMACC Internal Links Go to Top Mail To me Local.
MySQL and PHP Review CSS. Cascading Style Sheet (CSS) Style sheets are files or forms that describe the layout and appearance of a document. Cascading.
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.
Cascading Style Sheets Robin Burke ECT 270. Outline Midterm The Layout Debate CSS properties Fonts Alignment Color CSS selection selectors pseudo-classes.
ECA225 Applied Interactive Programming Cascading Style Sheets, pt 1 ECA 225 Applied Online Programming.
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.
Cascading Style Sheets CSS.  Standard defined by the W3C  CSS1 (released 1996) 50 properties  CSS2 (released 1998) 150 properties (positioning)  CSS3.
Tutorial 3 Adding and Formatting Text with CSS Styles.
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.
XP Review 2 New Perspectives on JavaScript, Comprehensive1 Introducing Cascading Style Sheets Formatting Web Pages with CSS.
1 Web Development CSS (Cascading Style Sheet). 2 1.Setting rules for multiple elements To decrease the amount of typing for setting rules for multiple.
CS 174: Web Programming September 9 Class Meeting Department of Computer Science San Jose State University Fall 2015 Instructor: Ron Mak
5 th ed: Chapter 4 4 th ed: Chapter 5 SY306 Web and Databases for Cyber Operations Slide Set #4: CSS.
Department of Computer Science, Florida State University CGS 3066: Web Programming and Design Spring
IS1825 Multimedia Development for Internet Applications Lecture 12: IDs, Classes and Internal CSS Rob Gleasure
CSS: Cascading Style Sheets Part II. Style Syntax.
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.
Tutorial #5 Working with the Box Model. Tutorial #4 Review - CSS Create a homework page Final Project Discussion Exam on Blackboard Styling Lists (List-style-type,
Tutorial 3 Designing a Web Page with CSS
ECA 228 Internet/Intranet Design I Cascading Style Sheets.
Chapter 11 & 12 CSS Style Sheets: Intro. Why CSS? Separate presentation from content – more accessible Less work – can change appearance of whole site.
Blended HTML and CSS Fundamentals 3 rd EDITION Tutorial 3 Introducing Cascading Style Sheets.
Internet & World Wide Web How to Program, 5/e Copyright © Pearson, Inc All Rights Reserved.
Blended HTML and CSS Fundamentals 3 rd EDITION Tutorial 4 Formatting Text and Links.
NAVIGATION USING HTML TO SET UP THE BASIC STRUCTURE OF A NAV BAR.
Cascading Style Sheets Robin Burke ECT 270. Outline CSS properties Fonts Alignment Color CSS selection selectors.
1 Cascading Style Sheets
CONFIGURING COLOR AND TEXT WITH CSS Chapter 3. Cascading Style Sheets (CSS) Used to configure text, color, and page layout. Launched in 1996 Developed.
WebD Introduction to CSS By Manik Rastogi.
IS333: MULTI-TIER APPLICATION DEVELOPMENT
Presentation transcript:

WDV 101 Intro to Website Development Tutorial #4 Formatting Text and Links

Tutorial #3 Review - CSS CSS format Selector { property1: value1; /* Comments */ } Embedded, In-Line, and External CSS Styles - color, background-color, font-family, font-size, text-transform, letter-spacing, word-spacing, text-indent, line-height, text-align, font-style, font-weight CSS Validation (http://jigsaw.w3.org/css-validator/)

Homework Page Create an index.html page for your homework Upload to your server account Have an H1 tag at the top with “Homework of your name” Each Tutorial section should be separated with an H2 Each homework should be linked in an unordered list Eventually you will have a main page that links to homework, final, etc.

Homework Page Example setup on http://www.dmaccwebdev.org/WDV%20101%20Fall%2013/MattHall/homework/

Final Project The final project has 300 points available, plus some extra credit. Failure to complete a final project will result in a grade of 0 for the project and a failing grade in the course. Requirements: Purpose and Organization: (70 points) Required Technical Features: (200 points) Project Presentation: (30 points) Extra Credit Features: (20 points maximum) http://www.dmaccwebdev.org/WDV%20101%20Fall%2013/finalProject.docx

Vertical-Align Property Used to position images and other elements with text Most common positions Top Middle Bottom All positions listed on Page 192 img { vertical-align: middle; }

Styling Lists Lists can be styled with multiple properties ul{ List-style-type List-style-position List-style-image ul{ list-style-property: value; }

List-Style-Type Property UL Used to change the default circle of unordered lists Four values can be used Disc – A filled circle (Default) Circle – A hollow circle Square – A filled square None – No bullet is shown ul { list-style-type: square; }

List-Style-Type Property OL Used to change the default number of ordered lists Decimal Leading 0 or not Roman Numeral Upper or Lowercase Alpha (A, B, C, etc) None Page 194 has the properties

List-Style-Image Gives options for custom bullets Uses images ul{ list-style-image: url(imagename); }

List-Style-Position Used to change the position of the marker or bullet Defaults to outside. Text indents Other options is inside. Text

Lab Get the starter file Tutorial4_start.html from the Class Info/Labs/ folder View Source, Copy, and paste into a new file (Save as tutorial4.html) Format text around the image to be in the middle (vertical-align: middle;) Change the Unordered List bullets to a hallow circle (list-style-type: circle); Change the ordered list to Uppercase Roman Numerals (list-style-type: lower-roman;)

Grouping Selectors Selectors can be grouped together in a comma separated list. This will apply the styling all of the selectors in the list. Example: h1, h2, h4{ color: red; } The three elements above will be styled with the color red.

Descendant Selectors A selector nested within another selector Treated as a combined element for formatting Space separated selectors (commas would group) p strong { background-color: lightblue; } The above would only modify the text within a paragraph tag that has a strong tag nested in it

Descendant Selectors h3 { color: purple; } h3 em{ color: orange; <h3>Decedant Selectors </h3> <h3> <em>EM Decendant S</em>electors </h3>

The nav Element Used to contain a block of navigation links (navigation menu) No functional purpose, just identifies a block of navigation links Prior to HTML5 this would be done with <div></div> tags instead of nav tags. More on div tags later. <nav> <ul> <li>Home</li> <li>About me</li> </ul> </nav>

The nav Element Using Nav tag and CSS can easily style a consistent menu. Use Descendant Selector with nav and li for formatting the list. Use nav a to format the links Using display property with inline as the value will stack the list horizontal. The value of block will stack it up (this is default)

The nav Element nav{ background-color: lightgreen; display: block; } nav li{ background-color: blue; display: inline; padding-right: 2em; nav a { color: white; font-weight: bold;

Lab Modify your file. Add a green background color and white text color for h1, h2, and h4 tags using the Group Selector Modify the h3 tag to have a text color of purple Create a Descendant Selector for h3 and em to have a color of orange. Create a Navigation section in the HTML around the top links (Already Done in starter file) Use CSS to style the Navigation. Nav background should be lightgreen, lists background as Blue, link color as white. The list in the nav should display inline.

Inheritance In CSS child elements inherit styles from parent elements For example if you have the following HTML: <nav> <ul> <li> … If the nav tag has a CSS style of red for color, both ul and li will inherit that color.

Inheritance nav { color: red; } /*  CSS */ <nav> <ul> <li>1</li> <li>2</li> <li>3</li> </ul> </nav> Notice the coloring of the list items are in red even though the CSS does not specify then li with color red. The red color is inherited from the style of it's parent (in the case the style of the nav element).

Class In CSS a class is defined with a period in front .class { property: value; } In HTML use the class attribute <element class=“classname”>

Class Independent – Can be applied to any tag Dependent – Specific tag specified. Can only be used with the element. Element.dependentclass{ property: value; }

Class Defining a class Can only contain Alpha or numeric characters Must be one word (no spaces) Should describe the purpose of the class Class name can NOT start with a number

Class .center{ text-align: center; } li.attention { background-color: red font-weight: bold; color: white;

ID In CSS a ID is defined with a # in front #id { property: value; } In HTML use the ID attribute <element id=“idname”> i.e. <div id=“wrapper”> content </div> css #wrapper{color:pink;} Turns all text rapped in the div tags pink. Like the nav, aside and content in document.

ID Defining an id Can only contain Alpha or numeric characters Must be one word (no spaces) Should describe the purpose of the container id name can NOT start with a number The id selector is used to specify a style for a single, unique element. Nominally a div tag. Only used once per web page Independent – Can be applied to any group of tags http://css-tricks.com/the-difference-between-id-and-class/

ID The "hash value" in the URL has a vey important role. A URL like: http://yourdomain.com#comments The browser will attempt to locate the element with an ID of "comments" If found will automatically scroll the page to show that element

CSS --- Class vs Id attributes CLASS  period .title{ color: firebrick; font-size: 2.5em; } ID  hash or pound sign #title{

Span Element HTML inline element used to mark inline content .title{ color: firebrick; font-size: 2.5em; } <span class="title"> Inheritance and Classes </span>

Div Element <div> </div> stands for division. HTML block element used for defining a section of your document ( generic containers) . Can be formated with CSS. In HTML5 tags such as <header> <nav> <section> <main> <aside> <footer> have diminished the need for the div tag. Class and Id attributes are used with the div tag

Pseudo-Class Selectors pseudo-class exists in CSS but not directly defined in HTML For hyperlinks a:link – Style for links that have not been clicked a:visited – Style after the link has been clicked a:hover – Style when mouse is over the link a:active – Style when most button is pressed on the link In CSS MUST be defined in that order! Do not put spaces between the colon

Pseudo-Class Selectors a:link, a:visisted { color: white; font-weight: bold; } a:hover{ color: black; background-color: white; font-size: 1.3em; a:active{ color:orange;

Margins Measurement for corresponding edge of the document Margin-top Margin-right Margin-bottom Margin-left

Lab Add a dependent class for color blue and apply to the h3 with Age in it. Add an independent class called center with text-align set to center. Apply this to Title and Hometown Add a pseudo-class for hover to have a black color on a white background Set the pseudo-class for active to color orange. Add a 2em margin on the right of the nav list item

Lab - Extra Create a dependent class for unordered list Create your own bullet or take bullet.png from images on lab/images in class_info Apply your class with list image to the 1,2,3 list. Look something like: