Fun with Formatting: DIV tags and Cascading Style Sheets Dr. donna Bair-Mundy.

Slides:



Advertisements
Similar presentations
Cascading Style Sheets
Advertisements

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. Next Level Cascading Style Sheets (CSS) - control the look and feel of your HTML documents in an organized and efficient manner.
Cascading Style Sheets
Cascading Style Sheets
CSS The basics { }. CSS Cascading Style Sheets - language used to – describe html appearance & formatting Style Sheet - file that describes – how html.
/k/k 1212 Cascading Style Sheets Part one Marko Boon
Cascading Style Sheets: Basics I450 Technology Seminar Copyright 2003, Matt Hottell.
Layout using CSS. Using multiple classes In the head:.important{font-style:italic;}.title{color:red;} In the body: Here's a type of paragraph that is.
Today CSS HTML A project.
HTML Overview - Cascading Style Sheets (CSS). Before We Begin Make a copy of one of your HTML file you have previously created Make a copy of one of your.
Introducing CSS CIS 133 mashup Javascript, jQuery and XML 1.
Advanced Web Design Using Dreamweaver Robby Seitz 121 Powers Hall
CSS cont. October 5, Unit 4. Padding We can add borders around the elements of our pages To increase the space between the content and the border, use.
1 Web Developer & Design Foundations with XHTML Chapter 9 Key Concepts.
End User Computing An Introduction to CSS Sujana Jyothi Research Lab1, Callan Building, Department of Computer Science
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,
Web Pages and Style Sheets Bert Wachsmuth. HTML versus XHTML XHTML is a stricter version of HTML: HTML + stricter rules = XHTML. XHTML Rule violations:
Cascade Style Sheet Demo. Cascading Style Sheets Cascading Style Sheets (CSS) is a simple mechanism for adding style (e.g., fonts, colors, spacing) to.
กระบวนวิชา 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.
Web Design with Cascading Style Sheet Lan Vu. Overview Introduction to CSS Designing CSS Using Visual Studio to create CSS Using template for web design.
Chapter 7 Using Advanced Cascading Style Sheets HTML5 & CSS 7 th Edition.
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.
CS 142 Lecture Notes: CSSSlide 1 body { font-family: Tahoma, Arial, sans-serif; color: black; background: white; margin: 8px; } SelectorDeclaration Block.
CSS Basics LIS Webteam April 8, Why CSS? What’s wrong with HTML? Structure vs Style Early web design used hacks to style webpages with HTML – like.
The.htm/.html Mystery When saving the template files in Internet Explorer, they will be named.htm by default. To be consistent with how the code was written.
4.01 Cascading Style Sheets
 Missing (or duplicate) semicolons can make the browser completely ignore the style rule.  You may add extra spaces between the properties/values to.
Chapter 4 Cascading Style Sheets Basics Key Concepts Copyright © 2013 Terry Ann Morris, Ed.D 1.
Web Technologies COMP6115 Session 2: Planning, Designing, Constructing and Testing Static Web Sites Dr. Paul Walcott Department of Computer Science, Mathematics.
HTML & CSS.
Creating a Web portal: Part II HyperText Markup Language (HTML) Bair-Mundy.
Learning HTML. HTML Attributes HTML elements can have attributes Attributes provide additional information about an element Class – specifies a class.
Web Design I Spring 2009 Kevin Cole Gallaudet University
More Basic HTML. Add spacing (single & double space) Save Refresh Add horizontal rule Add comments Add styles Add headings Add features Add alignments.
I NTRO TO CSS IAT100 Spring I NTRO TO CSS Covered in this lesson: Overview What is CSS? Why to use CSS? CSS for Skinning your Website Structure.
 This presentation introduces the following: › 3 types of CSS › CSS syntax › CSS comments › CSS and color › The box model.
WRT235: Writing in Electronic Environments Basic CSS.
CS134 Web Design & Development Cascading Style Sheets (CSS) Mehmud Abliz.
ECA225 Applied Interactive Programming Cascading Style Sheets, pt 1 ECA 225 Applied Online Programming.
Quick Questions 1. What does HTML stand for? 2. What are the three main languages of the Web? 3. What is the purpose of the tags? 4. Why do we indent different.
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.
Adding a Stylesheet. Create a New File Log into uhunix.hawaii.edu At the % prompt type: cd public_html Make a copy of your test file: cp test_file.html.
Spiderman ©Marvel Comics Creating Web Pages (part 1)
BEGINNER WEB DESIGN. INTRODUCTION Vocabulary Design Tools of the Trade HTML CSS.
ECA 228 Internet/Intranet Design I Cascading Style Sheets.
1 Cascading Style Sheet (CSS). 2 Cascading Style Sheets (CSS)  a style defines the appearance of a document element. o E.g., font size, font color etc…
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.
Chapter 3 Designing Your Web Pages. Objectives What is CSS and Why it is needed How CSS looks and how to write it The different ways to add CSS code to.
CSS (Cascading Style Sheets). CSS CSS – Cascading Style Sheets – Cascade because of the way CSS rules can stack on top of each other. Allows you to add.
Cascading Style Sheets (CSS) Internal Style Sheets Classes
CSS Box Model.
CSS Box Model.
4.01 Cascading Style Sheets
Creating an e-Portfolio Assignment: Part II
Creating Your Own Webpage
CSS Rule Selector Declaration Block Value Attribute Name body {
>> Introduction to CSS
Madam Hazwani binti Rahmat
Cascading Style Sheets
Cascading Style Sheets (Layout)
Styles and the Box Model
CSS Box Model.
CS134 Web Design & Development
Training & Development
CSS Styles Introduction.
Web Design & Development
Principles of Web Design 5th Edition
4.01 Cascading Style Sheets
Presentation transcript:

Fun with Formatting: DIV tags and Cascading Style Sheets Dr. donna Bair-Mundy

The Tag Defines a division or section in an HTML document Visually, allows us to make containers that can be formatted

Without any tags Fun with Div Tags and CSS Aloha! Let’s play with div tags. These tags create divisions within a web page that can be formatted using style elements.

Basic page

The tag Fun with Div Tags and CSS Aloha! Let’s play with div tags. These tags create divisions within a web page that can be formatted using style elements.

Basic page with Div tags

The tag Fun with Div Tags and CSS Aloha! Let’s play with div tags. These tags create divisions within a web page that can be formatted using style elements.

Div tags with style element

The tag Fun with Div Tags and CSS Aloha! Let’s play with div tags. These tags create divisions within a web page that can be formatted using style elements.

Div tags with style element

Creating nested boxes with div tags Box 1 Box 2 Box 3

Colored boxes

Many Boxes with Same Formatting

div.tip { border : solid 2px purple ; background-color : #FFDDFF ; margin : 1em ; padding : 0.5em ; } Format Many Boxes with One Style Sheet Sometimes you want to add many boxes with the same formatting. You can use div tags to do this. However, putting style elements in each one of the boxes to be formatted can be time-consuming. Tip: Using a style sheet helps. Adding a style sheet means you only have to do the formatting once. And to change the formatting on all the boxes you make only one change. This can save you much time. It can also make your web files smaller and easier to manage. Tip: Using a different background color helps call attention to text.

Adding class to our div tags... Tip: Using a style sheet helps.... Tip: Using a different background color helps call attention to text.

Marked-up manuscript Chapter One A Mysterious Visitor It was a dark and stormy night. As was my custom on a Friday night, I was curled up in my favorite armchair reading Cataloging & Classification. All of a sudden, I heard a loud “Tap, tap, tap” on the window. Wondering what type of person would be out and about on such a stormy night, I went over, pulled aside the curtain, and peered out into the darkness. B A ¶ fleur graphic b.f. ital. ¶

Between the Head Tags... div.tip { border : solid 2px purple ; background-color : #FFDDFF ; margin : 1em ; padding : 0.5em ; }...

but first...

Without a style sheet

Basic HTML document with paragraphs Cascading Style Sheets Introduction Cascading Style Sheets (CSS) are used to format the way things appear on a Web page. When using Cascading Style Sheets HTML is used to provide structure and the style sheet is used to control how the elements look on the page. The Term The term "Style sheet" refers to a list of rules for formatting various elements. The word "Cascading" refers to the fact that you can have multiple style sheets which follow rules of precedence.

With a style sheet

Basic HTML document with paragraphs h2 { color : blue ; } Cascading Style Sheets Introduction Cascading Style Sheets (CSS) are used to format the way things appear on a Web page. When using Cascading Style Sheets HTML is used to provide structure and the style sheet is used to control how the elements look on the page. The Term The term "Style sheet" refers to a list of rules for formatting various elements. The word "Cascading" refers to the fact that you can have multiple style sheets which follow rules of precedence.

Adding a style sheet donna’s Web portal cascading style sheet

Style-sheet rule SelectorDeclaration block h2 { color : blue ; } Property Value

Adding a style sheet donna’s Web portal h2 { color : blue ; }

Add background color to our header Basic HTML document with paragraphs h2 { color : blue ; background-color : pink ; } Cascading Style Sheets Introduction Cascading Style Sheets (CSS) are used to format the way things appear on a Web page. When using Cascading Style Sheets HTML is used to provide structure and the style sheet is used to control how the elements look on the page. The Term The term "Style sheet" refers to a list of rules for formatting various elements. The word "Cascading" refers to the fact that you can have multiple style sheets which follow rules of precedence.

Adding background color using our style sheet

Adding a style sheet donna’s Web portal body { background : #FFC0FF ; } h1 { color : green ; } h2 { color : blue ; }

Color coding in hexadecimal numbers #FFC0FF Red Green Blue RG B

Binary numbers Base Ten Base Two

Hexadecimal numbers F F Base Ten Base A B C D E F ABCDEF Counting… 16 1 Decimal number Hexadecimal number 0

Coding black in hexadecimal numbers #

Coding red in hexadecimal numbers #FF FF

Coding green in hexadecimal numbers #00FF00 00 FF

Coding blue in hexadecimal numbers #0000FF 00 FF

Coding white in hexadecimal numbers #FFFFFF 00 FF

Coding turquoise in hexadecimal numbers #00FFFF 00 FF

Coding fuchsia in hexadecimal numbers #FF00FF 00 FF

Coding lilac in hexadecimal numbers #FFC0FF 00 FF C0 12 x 16 = 192

Source for named colors

Hexadecimal codes for colors Web search on: hexadecimal codes web page

Formatting with the div tag

The tag Basic HTML document with paragraphs h2 { color : blue ; } Cascading Style Sheets Introduction Cascading Style Sheets (CSS) are used to format the way things appear on a Web page. When using Cascading Style Sheets HTML is used to provide structure and the style sheet is used to control how the elements look on the page. The Term The term "Style sheet" refers to a list of rules for formatting various elements. The word "Cascading" refers to the fact that you can have multiple style sheets which follow rules of precedence. div { background-color : #FFDDFF}

Formatting with the div tag

Many Boxes with Same Formatting

Between the Body Tags... Tip: Using a style sheet helps.... Tip: Using a different background color helps call attention to text.

Between the Head Tags......

Add formatting for our tip box div.tip { border : solid 2px purple ; background-color : #FFDDFF ; margin : 1em ; padding : 0.5em ; } div.tip

Add formatting for our tip box (2) div.tip { border : solid 2px purple ; background-color : #FFDDFF ; margin : 1em ; padding : 0.5em ; } { } enclose formatting statement

Add formatting for our tip box (2) div.tip { border : solid 2px purple ; background-color : #FFDDFF ; margin : 1em ; padding : 0.5em ; } border : solid 2px purple ;

Add formatting for our tip box (2) div.tip { border : solid 2px purple ; background-color : #FFDDFF ; margin : 1em ; padding : 0.5em ; } background-color : #FFDDFF ;

Add formatting for our tip box (2) div.tip { border : solid 2px purple ; background-color : #FFDDFF ; margin : 1em ; padding : 0.5em ; } margin : 1em ;

Margin attribute Previous text. Following text. Tip: Adding a margin around text emphasizes it. The margin is the white space surrounding the box.

Add formatting for our tip box (2) div.tip { border : solid 2px purple ; background-color : #FFDDFF ; margin : 1em ; padding : 0.5em ; } padding : 0.5em ;

Margin attribute Previous text. Following text. Tip: Adding a margin around text emphasizes it. The padding is the space surrounding the text within the box.

The Result

You’ve already seen this...

Use div tags create a page like this You will chose your own colors (do not duplicate mine).