Using color and fonts in HTML and XHTML Please use speaker notes for additional information!

Slides:



Advertisements
Similar presentations
HTML popo.
Advertisements

Internet Services and Web Authoring (CSET 226) Lecture # 5 HyperText Markup Language (HTML) 1.
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: Basics I450 Technology Seminar Copyright 2003, Matt Hottell.
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.
Creating Pages in XHTML
INTRODUCTION TO HYPERTEXT MARKUP LANGUAGE 1. Outline  Introduction  Markup Languages  Editing HTML  Common Tags  Headers  Text Styling  Linking.
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.
End User Computing An Introduction to CSS Sujana Jyothi Research Lab1, Callan Building, Department of Computer Science
กระบวนวิชา 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.
Stylin’ with CSS. 2 Topics What is CSS? Why CSS? CSS Examples.
Cascading Style Sheets Please use speaker notes to get complete information! Cascading Style Sheets.
Introduction to Cascading Style Sheets (CSS) Module 2: HTML Basics LESSON 4.
Cascading Style Sheets SP.772 May 6, CSS Useful for creating one unified look for an entire web site. Helps to seperate style from content. Can.
Lecture 5. CSS 2 What style will be used when there is more than one style specified for an HTML element? Generally speaking we can say that all the styles.
Lecture Cascading Style Sheets (CSS) Internal Style Sheets Classes.
Web Workshop: CSS Objectives: - “What is CSS?” - Structure of CSS - How to use CSS in your webpage.
Workshop: CSS-Part I Cascading Style Sheets add style to your HTML web pages.
More HTML Chapter 4. 2 Nesting Tags How do you write the following in HTML? The wrong way: This is really, REALLY fun ! Tags must be correctly nested.
Stylin’ with CSS. 2 Topics What is CSS? Why CSS? CSS Examples.
FINAL EXAM REVIEW WEB TECH. JUST CLICK… THE CORRECT ANSWER WILL APPEAR WHEN YOU CLICK. GOOD LUCK!
Explanation of Web 6, Web 7 and Web 9 at my site Please be sure to bring up the speaker notes for the explanation Intro - Web 6, Web 7 and Web 9.
TECH2018 Multimedia and the Internet More about CSS and Page Layouts.
Cascaded Style Sheets Implementing web pages using only html/xhtml is tedious and awkward With CSS, you can design a component to be used in a web page.
The Characteristics of CSS
Tutorial #3 Cascading Style Sheets. Review: Last Class Image sizing Pathnames Project Default Path Relative Path Absolute Path Blackboard Homework Submission.
CSS in XHTML continued Please use speaker notes for additional information!
IDs versus Classes Naming Your Tags for Maximum Functionality.
More Basic HTML. Add spacing (single & double space) Save Refresh Add horizontal rule Add comments Add styles Add headings Add features Add alignments.
1 What is CSS?  CSS stands for Cascading Style Sheets  Styles define how to display HTML elements  Styles are normally stored in Style Sheets  Styles.
Chapter 6 An Introduction to HTML Pages Tag Nesting You can put two tags together to combine the effects Bold and underlined But make sure.
ITP 104.  Basic HTML using and form  Using Filezilla  public_html ▪ 755 permission  Have a directory name itp104 ▪ 755 permission  classpage.html.
15.2 More Basic HTML. More Basic HTML Add spacing (single & double space) Save Refresh Add horizontal rule Add comments Add styles Add headings Add features.
 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.
CIS67 Foundations for Creating Web Pages Professor Al Fichera Rev. September 14, 2010—All HTML code brought to XHTML standards. Reference for CIS127 and.
Using Cascading Style Sheet As you create more web pages, you may wish to impose a consistent look for all of your web pages or for group of related pages.
CSS My favourite ICT lesson By Federico Boschi Cascading Style Sheets.
Getting Started with HTML Please use speaker notes for additional information!
Just A Few More Fun Objectives 1 Having Some Fun With Java Script 2 Using Style Sheets.
CO1552 – Web Application Development Cascading Style Sheets.
Tutorial #3 Cascading Style Sheets. Tutorial #2 Review - Anchors Links to Site DMACC Internal Links Go to Top Mail To me Local.
ALBERT WAVERING BOBBY SENG. Week 2: HTML + CSS  Quiz  Announcements/questions/etc  Some functional HTML elements.
HTML - Examples Be sure to check speaker notes for additional information!
Essentials of HTML Class 4 Instructor: Jeanne Hart
Stylin’ with CSS Monday October 8 th and Tuesday October 9 th.
More CSS.
Tables with XHTML Please use speaker notes for additional information!
Colors & Fonts Building a Website Lesson 7. Font Font The tag specifies the font face, font size, and color of text. The tag can have any or all of these.
CSS with XHTML Please use speaker notes for additional information!
XHTML Formatting font with a style declaration. Formatting Font HTML uses the font tag to change size and family of font But… the font tag is being deprecated.
12/20/20151 Color Fall, 2010 Modified by Linda Kenney 10/26/10.
Fine Tuning Basic HTML CGS3066. Some HTML Tags and Their Defaults default = What will happen in the absence of instructions to the contrary from you.
CSS Cascading Style Sheets *referenced from
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.
Revision Webpage design HTML.   FACE  Attributes  Marquee  Define the following terms.
Blended HTML and CSS Fundamentals 3 rd EDITION Tutorial 3 Introducing Cascading Style Sheets.
CSS DHS Web Design. Location Between the & Start with – End with –
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.
CONFIGURING COLOR AND TEXT WITH CSS Chapter 3. Cascading Style Sheets (CSS) Used to configure text, color, and page layout. Launched in 1996 Developed.
More CSS.
LESSON 2 Module 2: XHTML Basics More Basic XHTML.
15.2 More Basic HTML & CSS.
More CSS.
Stylin’ with CSS.
LESSON 2 Module 2: XHTML Basics More Basic XHTML.
Explanation of Web 6, Web 7 and Web 9 at my site
More Basic HTML 2 assignments: 1—complete the worksheet
Stylin’ with CSS.
Presentation transcript:

Using color and fonts in HTML and XHTML Please use speaker notes for additional information!

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" " Using color and font This code will be centered This is not centered This is another way to center - the command has been depricated You can use left to align as well although left is the default. You can also right align using the align clause. This Web Page has a non white background because the background color was set to FFFFC2. Note that #FFFFFF is pure white and # is pure black. I randomly put in 000BBB for the text and got a blue coloring. For the list of different codes and colors, go to my Web site and look for a listing under colors. NOTE: The # in front of the color code is not required in HTML. This gives me a large font This gives me red text Note that for standard colors, I can assign the color red to the font. For more subtle shades, I need to use the code for that color. Read about how colors are treated by browsers and true colors. In this example I used 00dd00 which gave me a shade of green.

This code will be centered This is not centered This is another way to center - the command has been depricated You can use left to align as well although left is the default. You can also right align using the align clause. This Web Page has a non white background because the background color was set to FFFFC2. Note that #FFFFFF is pure white and # is pure black. I randomly put in 000BBB for the text and got a blue coloring. For the list of different codes and colors, go to my Web site and look for a listing under colors. NOTE: The # in front of the color code is not required in HTML.

This gives me a large font This gives me red text Note that for standard colors, I can assign the color red to the font. For more subtle shades, I need to use the code for that color. Read about how colors are treated by browsers and true colors. In this example I used 00dd00 which gave me a shade of green.

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" " Using color and font body { background: "ffffc2"; color: "0000bb"; } This code will be centered This is not centered Now I am centering again You can use left to align as well although left is the default. You can also right align using the align clause. This Web Page has a non white background because the background color was set to FFFFC2. Note that #FFFFFF is pure white and # is pure black. I randomly put in 000BBB for the text and got a blue coloring. For the list of different codes and colors, go to my Web site and look for a listing under colors. NOTE: The # in front of the color code is not required in HTML. This gives me a large font This gives me red text Note that for standard colors, I can assign the color red to the font. For more subtle shades, I need to use the code for that color. Read about how colors are treated by browsers and true colors. In this example I used 00dd00 which gave me a shade of green. The style is inside the head and it is of a type text/css which means it is text written following the rules of css. This is style that will apply to the body. Hence the use of the word body. All of the style related to the body is enclosed in { }. In later examples, I eliminate the quotes around the specific color and it works in more browsers. The specific elements are background and color which specifies the default color for text.

This code will be centered This is not centered Now I am centering again You can use left to align as well although left is the default. You can also right align using the align clause. This code is applied to the specific tag. The style uses the code of CSS where text-align aligns text. Note that after writing style =, the whole style is enclosed in double quotes. After the text-align, you must place a colon. Then the alignment shown here is placed in single quotes. The single quotes are used because we are already using double quotes to enclose the entire text-align property. Again, see the next example for an alternative that does not use the quotes around center and is supported by more browsers. The style is enclosed within the tag (note that the > does not occur until the style is complete). The style property information is enclosed in double quotes and the elements are enclosed in single quotes in this example. What I have found is that eliminating these quotes is the better option with most browsers. See next example.

This gives me a large font This gives me red text Note that for standard colors, I can assign the color red to the font. For more subtle shades, I need to use the code for that color. Read about how colors are treated by browsers and true colors. In this example I used 00dd00 which gave me a shade of green. I have broken this code into divisions. This div will have a font-size of 22pt. Again note the use of single quotes around the actual size and double quotes around the entire style. In this case the font-size property is being used. In this example I am using the font-size property and the color property to set both the font and the color within the division. Notice again that the entire style is enclosed in single quotes while the particular size of 14pt and the particular color of red - the values - are enclosed in single quotes. Looking ahead, you will see that I eliminate the single quotes around the red, 14pt etc and find that it is supported in more browsers.

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" " Using color and font body { background: #ffffc2; color: #0000bb; } This code will be centered This is not centered Now I am centering again You can use left to align as well although left is the default. You can also right align using the align clause. This Web Page has a non white background because the background color was set to FFFFC2. Note that #FFFFFF is pure white and # is pure black. I randomly put in 000BBB for the text and got a blue coloring. For the list of different codes and colors, go to my Web site and look for a listing under colors. NOTE: The # in front of the color code is not required in HTML. This gives me a large font This gives me red text Note that for standard colors, I can assign the color red to the font. For more subtle shades, I need to use the code for that color. Read about how colors are treated by browsers and true colors. In this example I used 00dd00 which gave me a shade of green. The code that does not put quotes around the specific color or the specific size seems to be supported in more browsers.

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" " Using color and font body { background: #ffffc2; color: #0000bb; } This code will be centered This is not centered Now I am centering again You can use left to align as well although left is the default. You can also right align using the align clause. This Web Page has a non white background because the background color was set to FFFFC2. Note that #FFFFFF is pure white and # is pure black. I randomly put in 000BBB for the text and got a blue coloring. For the list of different codes and colors, go to my Web site and look for a listing under colors. NOTE: The # in front of the color code is not required in HTML. This gives me a large font This gives me red text Note that for standard colors, I can assign the color red to the font. For more subtle shades, I need to use the code for that color. Read about how colors are treated by browsers and true colors. In this example I used 00dd00 which gave me a shade of green.

All h1 headers will be centered and red. All h2 headers will be right aligned and will use the default color specified in body. All paragraphs will be 18pt and green. All divisions will be 16pt and brown. <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" " Using color and font body { background: #ffffc2; color: #0000bb; } h1 { text-align: center; color: red; } h2 { text-align: right; } p { font-size: 18pt; color: #00dd00; } div { font-size: 16pt; color: brown; }

This code will be centered This is not centered You can use left to align as well although left is the default. You can also right align using the align clause. This is a division. This Web Page has a non white background because the background color was set to FFFFC2. Note that #FFFFFF is pure white and # is pure black. I randomly put in 000BBB for the text and got a blue coloring. For the list of different codes and colors, go to my Web site and look for a listing under colors. NOTE: The # in front of the color code is not required in HTML. This is a paragraph. This gives me brown text because it is a div. Back to a paragraph. Note that for standard colors, I can assign the color red to the font. For more subtle shades, I need to use the code for that color. Read about how colors are treated by browsers and true colors. In this example I used 00dd00 which gave me a shade of green.

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" " And... DEFAULT SETTINGS with BODY In HTML, default setting can be including in the BODY statement and can include background color done with BGCOLOR and text color done with TEXT. You can also change the color of links - LINK changes the color of the link, VLINK changes the color of the visited links - ALINK changes the color of the active link. We will see more on these when we have looked at links. COLOR Let's talk about color - there is 6 digit hexadecimal code that is used to express color. Remember hex is the numbering system that goes from 0 to F. The first two digits stand for red, the next two green and the last two blue. of red, yellow, and blue. THIS IS RED THIS IS GREEN THIS IS BLUE THIS IS WHITE THIS IS BLACK Mixing and matching these results in different colors. For example if I lower the amount of red, but still use no green or blue, I get this: THIS IS REDish If I lower the amount of blue, but still use no red or green, I get this: THIS IS BLUEish Play with the combinations and see what you get! Other things you can do with FONT include SIZE and FACE (which means font type). FONT 2, 99AA00, HELV FONT 3, 99AA00, TIMES FONT 4, 99AA00, BOOK ANTIQUA

body { background: ffffee; } p { font-family: "Book Antiqua"; } div { font-size: 14pt; color: brown; font-family: sans-serif; font-weight: bold; }

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" " And... body { background: ffffee; } p { font-family: "Book Antiqua"; } div { font-size: 14pt; color: brown; font-family: sans-serif; font-weight: bold; } The font-family defines the type of font to use. You can list more than one choice so that if your first choice is not supported by the browser being used, the second choice will be used. The choices are separated by a comma. The font-weight can be used to make the text bold.

DEFAULT SETTINGS with BODY In HTML, default setting can be including in the BODY statement and can include background color done with BGCOLOR and text color done with TEXT. You can also change the color of links - LINK changes the color of the link, VLINK changes the color of the visited links - ALINK changes the color of the active link. We will see more on these when we have looked at links. COLOR Let's talk about color - there is 6 digit hexadecimal code that is used to express color. Remember hex is the numbering system that goes from 0 to F. The first two digits stand for red, the next two green and the last two blue. of red, yellow, and blue. Mixing and matching these results in different colors. For example if I lower the amount of red, but still use no green or blue, I get this: THIS IS REDish If I lower the amount of blue, but still use no red or green, I get this: THIS IS BLUEish Play with the combinations and see what you get! The red and the blue were visible because the inline style applied to the line (using division). Again note that the entire style is in double quotes so the individual color code uses single quotes. div { font-size: 14pt; color: brown; font-family: sans-serif; } This is part of the code that appears in the head on the previous slide. Even though the red and blue are in a, this code (which calls for brown) gets overridden by the inline style which take precedence.

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" " Horizontal line Now lets look at Horizontal lines It is interesting - like the BR for break, the horizontal line does not have a closing /HR. Therefore we use the same code we used for br with the / included with the hr. If I don't want the line to go all the way across the page, I can do a width on my horizontal line. And if I want it to be wider I can change the thickness by using the SIZE clause. To make the size a solid line, I also need the noshade clause. Notice that the line is centered. However to be safe in a variety of browsers, it is probably better to use ALIGN=CENTER. If I want the line to start at the LEFT, I need to align it to the left. If I want the line to always go across 25% of the screen without worrying about the number of characters, I can use percent to set the width.

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" " Horizontal line hr { height: 8pt; background-color: black; width: 25%; align: center; } Now lets look at Horizontal lines It is interesting - like the BR for break, the horizontal line does not have a closing /HR. Therefore we use the same code we used for br with the / included with the hr. This shows a horizontal line with a height, width and alignment.

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" " Horizontal line hr { height: 8pt; background-color: black; width: 25%; align: center; } Now lets look at Horizontal lines It is interesting - like the BR for break, the horizontal line does not have a closing /HR. Therefore we use the same code we used for br with the / included with the hr. This shows a horizontal line with a height, width and alignment.