Different Box elements All our examples to date have been shown in terms of the box for H1 elements Many other elements also have a box, including H2 elements.

Slides:



Advertisements
Similar presentations
Table, List, Blocks, Inline Style
Advertisements

CSS. CSS stands for Cascading Style Sheets Styles define how to display HTML elements Styles were added to HTML 4.0 to solve a problem External Style.
1 Cascading Style Sheets Continued Different kinds of selectors in a style sheet –Simple- Pseudo-Class –Contextual- Pseudo-Element –Class Image Styles.
CSS Layout Crash Course An Advance CSS Tutorial. Inline vs. Block Many HTML elements have a default display setting of Block. Block elements take up the.
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.
CHAPTER 7 STYLING CONTENT WITH 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.
Very quick intro HTML and CSS. Sample html A Web Title.
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.
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,
กระบวนวิชา 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.
AD Intermediate Computer Graphics | spring 2008 | Daria Tsoupikova | School of Art and Design | UIC CSS Cascading Style Sheets.
Chapter 7 Using Advanced Cascading Style Sheets HTML5 & CSS 7 th Edition.
Cascading Style Sheets Controlling the Display Of Web Content.
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.
Style sheets can also affect the BODY. style4.css BODY {BACKGROUND-COLOR : white} H1 {COLOR : red; FONT-SIZE : 50; FONT-FAMILY : arial} H2 {COLOR : green}
MORE Cascading Style Sheets (The Positioning Model)
Style sheets can also affect the body. style4.css body {background-color : white} h1 {color : red; font-size : 50; font-family : arial} h2 {color : green}
4.01 Cascading Style Sheets
Working with Cascading Style Sheets. 2 Objectives Introducing Cascading Style Sheets Using Inline Styles Using Embedded Styles Using an External Style.
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.
Working with Cascading Style Sheets. Introducing Cascading Style Sheets Style sheets are files or forms that describe the layout and appearance of a document.
Cascading Style Sheets (CSS) Instructor: Mr. Ahmed Al Astal ITGD4104 Department Requirement for senior student University of Palestine Faculty of IT.
XP Tutorial 7New Perspectives on Creating Web Pages with HTML, XHTML, and XML 1 Working with Cascading Style Sheets Creating a Style for Online Scrapbooks.
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.
The Characteristics of CSS
1 Cascading Style Sheets (CSS) Part 2. 2 The Sources of Style Sheets.
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.
CSS Netcentric. What is CSS O CSS stands for Cascading Style Sheets O Styles define how to display HTML elements O Styles were added to HTML 4.0 to solve.
 This presentation introduces the following: › 3 types of CSS › CSS syntax › CSS comments › CSS and color › The box model.
WRT235: Writing in Electronic Environments CSS Classes, IDs, divs.
Neal Stublen Course Road Map  Create web page layouts using CSS  Manage CSS  Test website validity  Create navigation menus using.
CO1552 – Web Application Development Cascading Style Sheets.
CSS Basic (cascading style sheets)
Cascade Style Sheet Introduction. What is CSS?  CSS stands for Cascading Style Sheets  Styles define how to display HTML elements  Styles were added.
CS134 Web Design & Development Cascading Style Sheets (CSS) Mehmud Abliz.
Lecture 2 - HTML and CSS Review SFDV3011 – Advanced Web Development 1.
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.
ECA225 Applied Interactive Programming Cascading Style Sheets, pt 1 ECA 225 Applied Online Programming.
Course created by Sarah Phillips BBCD Melbourne BAPDCOM Version 1 – April 2013.
CSS Layout Cascading Style Sheets. Lesson Overview  In this lesson, you will learn:  float & clear  display & visibility.
CNIT 132 – Week 4 Cascading Style Sheets. Introducing Cascading Style Sheets Style sheets are files or forms that describe the layout and appearance of.
XHTML & CSS 2 By Trevor Adams. Last week XHTML eXtensible HyperText Mark-up Language The beginning – HTML Web Standards Concept and syntax Elements (tags)
How to… Cascading Style Sheets. How to Insert a Style Sheet When a browser reads a style sheet, it will format the document according to it. There are.
CSS FOUNDATIONS IN-DEPTH The nitty-gritty of css...
CSS IS A LANGUAGE DESIGNED TO TARGET HTML ELEMENTS AND NODES BY TYPE, CLASS, ID AND VALUE, AND CHANGE THEIR VALUES CSS – change how your HTML looks and.
Department of Computer Science, Florida State University CGS 3066: Web Programming and Design Spring
HTML and Dreamweaver November 11th. Agenda Box Model Displaying and positioning elements – Padding – Margin – Float – Display – Position HTML Demo.
BEGINNER WEB DESIGN. INTRODUCTION Vocabulary Design Tools of the Trade HTML CSS.
Group 9: Through examples, explain how to build a css navigation bar. Presented by: Daniel Ku, Matt Iannacci & Iphia Henry.
Understanding CSS Cascading Style Sheets control the presentation of content in HTML pages Style Sheets separate formatting from the content –Styles defined.
ECA 228 Internet/Intranet Design I Cascading Style Sheets.
© Dr. Graham Rollings Dr. Graham Rollings, 09 June 2016 HTML & CSS A very High-level Introduction.
XP Tutorial 7New Perspectives on HTML and XHTML, Comprehensive 1 Working with Cascading Style Sheets Creating a Style for Online Scrapbooks Tutorial 7.
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…
CASCADING STYLE SHEET CSS. CSS stands for Cascading Style Sheets Styles define how to display HTML elements Styles were added to HTML 4.0 to solve a problem.
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.
CSS.
Working with Cascading Style Sheets
4.01 Cascading Style Sheets
IS 360 Declaring CSS Styles
CASCADING STYLE SHEET CSS.
IS333: MULTI-TIER APPLICATION DEVELOPMENT
Website Design 3
MORE Cascading Style Sheets (The Positioning Model)
4.01 Cascading Style Sheets
Presentation transcript:

Different Box elements All our examples to date have been shown in terms of the box for H1 elements Many other elements also have a box, including H2 elements

Cs 3314 got here on 20 october 2005

Box elements contd. A BODY also has a box

Box elements contd. The box for a BODY element has the full range of box attributes that we have seen including, for example, the PADDING attribute, which specifies the empty space between the border of the box and its content

Foreground (content) of a box We have discussed the BACKGROUND of a box quite extensively The foreground of the box is its content The most typical content is text Content has the attribute COLOR In the following example, notice that the boxes within the BODY inherit its value for the COLOR attribute

Overriding inherited values In the following, notice how the H2 element overrides the inherited COLOR from its parent, the BODY element

Box elements contd. Notice that even a P (paragraph) element has it box and that it inherits attributes, such as the COLOR of its content from its ancestral BODY

The DISPLAY of an element Every element has a DISPLAY attribute Depending on the type of element the default value of its DISPLAY attribute is one of inline block list-item However, we can also set it to none which prevents the element from being rendered at all!

DISPLAY contd. In the following example notice that the style sheet stops H1 elements being rendered at all, even though one is present in the document

DISPLAY contd. The DISPLAY attribute is inherited by children elements from their ancestor In the following notice how setting the DISPLAY attribute of the BODY to none stops any of the document being rendered

In-BODY styles

It was explained earlier that the word “Cascading” refers to the prioritization given to the three levels of style sheet: –linked –in-head –in-body with in-body styles being allowed to over-ride in-head styles which can over-ride linked styles

It was also stated that we should rarely need to use in-body styles However, we will consider them now, because there ARE times when they are needed

General format of in-body style- sheets We can insert a stylesheet in the opening tag for any logical element for which it is possible to define a style The format is For example:

In the next slide, an in-body stylesheet for a specific H2 over-rides the general style specified for H2 in the in-head stylesheet

There is, however, another way of achieving the same thing: –we can give a unique identifier to specific elements in our document –and specify a style for this specific element in a global stylesheet such as an in-head stylesheet or a linked style-sheet

In the document on the next slide, we give the identifier balkanWars to the H2 which introduces the Balkan Wars In the in-head stylesheet we specify a style for the element with the identifier balkanWars We could have done the same thing in a linked style-sheet

We can do the same thing for whole groups of elements, instead of just for individuals In the next slide, we give one style for all H2s but we then over-ride it with a different style for H2s which introduce African wars

Of course, we use use both id and class in the same stylesheet In the next slide, we give a general style for all H2 But we over-ride it with a style for H2s of class=african But we then over-ride part of that with a different BACKGROUND-COLOR for the H2 with id=biafra

Cs 3314 got here on 24 oct 2005

Letting Elements Float We can let elements float Consider the way that the headers float in the next slide

This achieved by using the FLOAT attribute in the styles specified for the headers This attribute takes three values: left, right, and none none is the default value In the previous slide, the headers wee allowed to float on the left, as we can see from the document specification on the next slide

In the next slide, we specify that the H1s will float on the left and the H2s on the right

We can use the FLOAT attribute on any element For example, the next document uses FLOAT =right for an IMG

Other CSS Properties We have considered a wide range of CSS properties There are still others Please refer to the CSS web-site that is mentioned in the list of useful web-sites given in the web-site for this course I may expect you to know how to use them in future tests/exercises