XHTML and CSS Links, Images, Tables and Forms Bharti Patel 1 phones off (please)

Slides:



Advertisements
Similar presentations
1 Cascading Style Sheets Continued Different kinds of selectors in a style sheet –Simple- Pseudo-Class –Contextual- Pseudo-Element –Class Image Styles.
Advertisements

Today CSS HTML A project.
CSS. Intro to CSS Cascading Style Sheets – styles and enhances appearance of webpage.css extension.
HTML – A Brief introduction Title of page This is my first homepage. This text is bold  The first tag in your HTML document is. This tag tells your browser.
Copyright © Terry Felke-Morris WEB DEVELOPMENT & DESIGN FOUNDATIONS WITH HTML5 Chapter 4 Key Concepts 1 Copyright © Terry Felke-Morris.
Principles of Web Design 5 th Edition Chapter Nine Site Navigation.
9-May-15 More CSS. 2 A different emphasis CSS is the same for XML as it is for HTML and XHTML, but-- XML contains no display information If you want your.
Week 9 Using the Box Properties. 9-2 The CSS Visual Formatting Model Describes how the element content boxes should be displayed by the browser –Based.
Tutorial 4: Creating page layout with css
CSS: Class 1 Background Images, Controlling Position of Background Images, Add Padding to Page Elements, Add Borders to Elements on a Page.
Working with Cascading Style Sheets
 2003 Prentice Hall, Inc. All rights reserved. Chapter 6 - Cascading Style Sheets™ (CSS) Outline 6.1 Introduction 6.2 Inline Styles 6.3 Embedded Style.
Intermediate Level Course. Text Format The text styles, bold, italics, underlining, superscript and subscript, can be easily added to selected text. Text.
4.01 Cascading Style Sheets
HTML Tables and Forms Creating Web Pages with HTML CIS 133 Web Programming Concepts 1.
_______________________________________________________________________________________________________________ E-Commerce: Fundamentals and Applications1.
CSS Dvijesh Bhatt.
Dreamweaver -- CSS. Dreamweaver -- MX New icons are added in MX Most of the features commonly used in web design, and are same as FrontPage. New feature.
SCHOOL OF LIBRARY, ARCHIVE AND INFORMATION STUDIES Andy Dawson LIS1510 Library and Archives Automation Issues Further features of HTML – Stylesheets and.
CSS Introduction Cascading Style Sheets Provides a great deal of control over the presentation of the document HTML indicates both semantics of a document.
Amber Annett David Bell October 13 th, What will happen What is this business about personal web pages? Designated location of your own web page.
CSS The Definitive Guide Chapter 8.  Allows one to define borders for  paragraphs  headings  divs  anchors  images  and more.
Robinson_CIS_285_2005 HTML FORMS CIS 285 Winter_2005 Instructor: Mary Robinson.
CSW131 Steven Battilana 1 CSW 131 – Supplement 1 (X)HTML / CSS Not Covered or in Book Prepared by Prof. B. for use with Teach Yourself Visually Web Design.
 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.
Images Inserting an image on a web page. chcslonline.org2 ITEMS REQUIRED Go to the course download page on the course website and download the 3 images.
Doman’s Sections Information in this presentation includes text and images from
Lists, Images, Tables and Links. Lists Unordered List The first item The second item The third item The fourth item Ordered List 1.The first item 2.The.
Website Development & Management Working with Style Rules Instructor: John Seydel, Ph.D. CIT Fall
CIS 1315 – Web Development for Educators CIS 1315 HTML Tutorials 3 & 4: Working With CSS.
Web Development & Design Foundations with XHTML Chapter 4 Key Concepts.
CSS Border.
Introduction to Programming the WWW I CMSC Summer 2004 Lecture 7.
Project 2 Web Page Design Creating and Editing a Web Page Pages
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.
More CSS.
Chcslonline.org Text –wrapping around Images. chcslonline.org To wrap text around an image, lets set up a style in our style sheet. open a new notepad.
Part 4 Introduction to CSS. CSS Table Table Borders table, td, th { border:1px solid black; } Firstname Lastname Bader Ali Paul Manuel The example below.
ECA225 Applied Interactive Programming Cascading Style Sheets, pt 1 ECA 225 Applied Online Programming.
Web Foundations THURSDAY, OCTOBER 3, 2013 LECTURE 6: CSS CONTINUED.
>> The “Box” Model. Pre-requisite Create a new project in Netbeans called Week5 Create a new html file and name it box.html Create a new css file and.
 2004 Prentice Hall, Inc. All rights reserved. Chapter 6 - Cascading Style Sheets™ (CSS) Outline 6.1 Introduction 6.2 Inline Styles 6.3 Embedded Style.
 Cascading Style Sheets (CSS) ◦ Used to specify the presentation of elements separately from the structure of the document.  Inline style ◦ declare.
Principles of Web Design 6 th Edition Chapter 9 – Site Navigation.
1 CS428 Web Engineering Lecture 08 Border, Margin, Padding … (CSS - III)
INT222 - Internet Fundamentals Shi, Yue (Sunny) Office: T2095 SENECA COLLEGE.
Copyright © 2006, Jumail, FSKSM, UTM Slide 1 Cascading Style Sheets (CSS)
CSS Layout Cascading Style Sheets. Lesson Overview  In this lesson, you will learn:  CSS Box Model  CSS properties for border  CSS properties for.
Copyright © Osmosys O S M O S Y SO S M O S Y S D e p l o y i n g E x p e r i e n c e & E x p e r t i s e™ CSS Training.
Introduction to HTML. _______________________________________________________________________________________________________________ 2 Outline Key issues.
Images. Intro What is it? Getting your image Inserting Moving Resizing Cropping.
CSS: Cascading Style Sheets Part II. Style Syntax.
CIS234A Lecture 6 Instructor Greg D’Andrea. Span and Div The span and div elements are a generic means by which we can add structure to documents. The.
CSS Table Styling. Up to this point, as we haven't applied any CSS styling to our tables, our example tables have not been too pleasing to the eye. CSS.
CSS Box Model. What is the Box Model? Each XHTML element appearing on our page takes up a "box" or "container" of space. Each box size is affected not.
CIS 228 The Internet 10/18/11 Grouping XHTML. CSS Selectors Rule: selector-group { property-declaration* } Selector-group: selector *, Selector: simple-selector.
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,
HTML5 and CSS3 Illustrated Unit F: Inserting and Working with Images.
CS 120: Introduction to Web Programming Lecture 10: Extra Features and Website Design Part 1 Tarik Booker CS 120 California State University, Los Angeles.
Welcome To Website Design, Hosting And Management Prepared By Webdev Solution ip ,223,96.
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,
Unit 3 - Review. Topics 1. Tag, Attribute, Value 2. CSS Rule Syntax + link 3. Categories of Selectors 4. Inline vs Block Tags 5. CSS Layout 6. CSS Box.
Semester - Review.
IS333: MULTI-TIER APPLICATION DEVELOPMENT
Web Development & Design Foundations with HTML5 7th Edition
Marking Up with XHTML Tags describe how a web page should look
List Properties Box Properties Pseudoclass
The Internet 10/27/11 XHTML Forms
Presentation transcript:

XHTML and CSS Links, Images, Tables and Forms Bharti Patel 1 phones off (please)

hyperlinks We can create links from one page to another page on same site ◦ using a Relative address URL another page on another site ◦ using an Absolute address URL a named point within a page ◦ Same page (relative with a name) ◦ Another page (probably on same site) (relative)

hyperlinks To another page on same site e.g. from startrek.html to no_fuses.html Relative address URL as both are in same place No Fuses this is the page that will be displayed when the link is clicked

hyperlinks To another page on another site e.g. from startrek.html to an external site Use an Absolute address URL to give full directions this is an absolute url this is the page that will be displayed when the link is clicked Official BBC website

hyperlinks states Hyperlinks may in one of 4 states a link that has not been visited a visited link a link being hovered over an active link blue and purple are the default colours

styling hyperlinks If you change the colours on your page the default colours may not work well Changing link styles requires pseudo-classes – note the colon (:) a:link a:visited a:hover a:active Use this ordering the order is important Note 1: a:hover MUST come after a:link and a:visited in the CSS definition in order to be effective!! Note 2: a:active MUST come after a:hover in the CSS definition in order to be effective!!

hyperlink style examples Change colors a:link {color: #ff0000; background-color:transparent} a:visited {color: #0000ff; background-color:transparent} a:hover {color: #ffcc00; background-color:transparent} Change font-size a:link {color: #ff0000; background-color:transparent} a:visited {color: #0000ff; background-color:transparent} a:hover {font-size: 150%}

Adding Images Issues ◦ Colour depth (number of colours) ◦ File size – compressed ◦ Loss of detail due to compression ◦ Download speed – file size Applications ◦ As content ◦ As background ◦ Enhancing styles ◦ effects

Adding Images Image formats GIF – Graphical Interchange Format JPG (JEPEG) – Joint Photographic Expert group PNG – Portable Network Graphics BMP – BitMaP -do not use – files are too large TIFF – Tagged Image File Format

Using Images as page content - element as a background as a replacement for a list bullet as a heading (to replace text) as a hyperlink

<img src = "../images/my-pic.jpg " alt = " my picture” width = " 50px " height = " 50px " /> 11 as page content Image element - 4 key attributes For specifying size of image so that page is loaded more quickly, or for scaling For offering alternate text that is displayed if the image is not available Always use all 4 attributes alt is needed for validation

5 th attribute <img src = "../images/my-pic.jpg " alt = " my picture” width = " 50px" height = " 50px " title = "a pic of mine” /> For offering tool-tip text help when the image is hovered over Always use all 4 attributes the 5 th is useful (on any element) 12

Positioning images left, right and centre Give an image element a class attribute with value such as left, right or centre Define a style.left {float:left}.right {float:right}.centre {margin-left: auto; margin-right:auto;} 13

as a background  Not always a good idea  text may be hard to read #heading{ } background-image: url('../images/wall.jpg'); /* the image will repeat both across and down the screen */ } 14

as a hyperlink wrap the around the image img element. <img src = "../images/alaska.png" alt = "alaska" width = "30px"; height = "30px";/> 15

Tables Used for presenting tabular data. 16

Basic table structure 17

Let us Get Started John 3.45 So Long Annie 3.45 Stay Together John/Annie

additional features (1) column headings caption (title at top) So Long by Timepiece Title Writer Length 19

additional features (2) add a simple stylesheet #album { width:400px; height:200px; float:left; font-family: "Comic Sans MS“;} table { color:red; background-color:#CCC;} caption { font-size:18pt;} th { text-align: left;} 20

what is a form? A form is used on a web page to send information to a web site : questionnaire feedback details to purchase an item on-line test prompt line of text select option radio buttons checkboxes text area submit reset 21

form outline the form element has a method attribute and an action attribute method get means data is shown in the address bar maximum size = 255 characters post means data is sent in a separate package no maximum size – more secure action the value of this is the URL of the file that will process the data # means use this page the form element must have an internal div element to make it valid XHTML 22

line of text a line of text requires an empty element with a type attribute set to " text “ name attribute with value frmName which stores the text you enter the size attribute fixes the number of characters (30) that can be typed in My name: the prompt is simply the text My name: placed here in a span element with class attribute to allow it to be styled 23

radio buttons radio buttons allow choice of ONE of a number of options <input type ="radio" name ="frmStudyType" value ="FT" checked="checked" />Full-Time <input type ="radio" name ="frmStudyType" value ="PT" />Part-Time a group of radio buttons requires the element with type attribute set to “ radio “ the checked attribute allows one button to be pre-selected the name attribute value frmStudyType must be the same for each button in the group the value attribute fixes the value passed 24

check boxes checkboxes allow choice of more than 1 of a number of options <input type ="checkbox" name ="frmInterests" value ="Music" checked="checked”/>Music <input type ="checkbox" name ="frmInterests" value ="Sport" />Sport a group of checkboxes requires the element with type attribute set to "checkbox" the checked attribute allows one button to be pre-selected the name attribute value frmInterests must be the same for each box in the group the value attribute fixes the value passed <input type ="checkbox" name ="frmInterests" value ="Other" />Other 25

select option (combo box) Male Female the pair enables a choice of ONE (or more) of a number of options via a drop down menu the outer select element has a name attribute the inner option element has the value to be passed contains the text displayed the attribute multiple = "multiple" allows more than one value to be selected often used with size="x" 26

submit and reset Submit Details <button type="reset" name="reset" value="reset"> Reset these are more or less self evident each button has three attributes. The type attribute must have the value shown the values of the name and value attributes can be anything 27

text area <textarea name="text" rows="5" cols="35"> enter comments here this is more or less self evident cols = width of the text area rows = height 28

making the form do something the action attribute value replace the # by the following to see the values you sent in your form " the web server my area the processing file this file simply reads your parameters and their values and displays them in a table Year 2 Computer Science students do this sort of processing 29

padding margin (space between elements) the BOX model border padding The element itself 30

using the box All of div,p,h,span,img are box elements We can change the style of the box: padding border margin See the w3schools site for css properties effects with the box model 31

border properties To affect all 4 borders border-color h1 { border-color: red } border-style none, dotted, dashed, solid, double, groove, ridge, inset, outset, inherit img { border-style: dashed } border-width p { border-width: 10px } border /* set any properties */ #info { border: red 10px dashed } 32

border properties (top, right, bottom, left) To affect one border border-top-color h1 { border-top-color: red } border-top-style none, dotted, dashed, solid, double, groove, ridge, inset, outset, inherit img { border-top-style: dashed } border-top-width p { border-top-width: 10px } border-top #info { border-top: red 10px dashed } 33

margin properties To affect all 4 margins margin h1 { margin: 5px } h1 { margin: 5px 10px 15px 20px } /* top right bottom left */ To affect one margin margin-top (or right bottom left) h1 { margin-top: 5px } h1 { margin-left: 15px } 34

padding properties To affect all 4 sides of padding padding h1 { padding: 5px } h1 { padding: 5px 10px 15px 20px } To affect one padding padding-top (or right bottom left} h1 { padding-top: 5px } h1 { padding-left: 15px } 35

bullet-proofing idea: text size To make text appear in proportion Do not use absolute sizes - pt or px Use: body {font-size: small} /*12px*/ h1 {font-size: 150%} /*18px*/ h2 {font-size: 140%} /*15px*/.notes {font-size: 90%} /*10px*/ etc. 36