…also known as the Parent-Child Relationship Paul Johnson CIT230 November 7, 2014 Inheritance in CSS.

Slides:



Advertisements
Similar presentations
Cascading Style Sheets CSS. Learning outcome CSS – Introduction – Motivation – Advantages – Implementation – Classes & Ids – and – General Model – Validation.
Advertisements

Inheritance. Inheritance Inheritance: the way genes are passed down. If a father doesn’t have a leg does that mean his children will be born with out.
CSS The basics { }. CSS Cascading Style Sheets - language used to – describe html appearance & formatting Style Sheet - file that describes – how html.
Cascading Style Sheets (CSS) “Styles” for short. Pg. 418.
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.
It’s All About Style The Basics of Style Sheets Presented by Barry Diehl.
Project 8 Creating Style Sheets.
CSS. CSS, or Cascading Styles Sheets, is a way to style HTML. Whereas the HTML is the content, the style sheet is the presentation of that document.
Cascading Style Sheets CSS. What is it? Another file format ! its not like html Describes the looks of “selectors” in a.css file (example.css) in the.
Recognizing the Benefits of Using CSS 1. The Evolution of CSS CSS was developed to standardize display information CSS was slow to be supported by browsers.
XHTML & CSS 2 By Trevor Adams. Last week XHTML eXtensible HyperText Mark-up Language The beginning – HTML Web Standards Concept and syntax Elements (tags)
Advanced Object Oriented Concepts Tonga Institute of Higher Education.
7Db It’s your inheritance
Big Punnett-ing  Catalyst:  Six fingers (S) is dominant over five fingers (s). What is the phenotype of a person who is heterozygous?  How did I decide.
HCI 201 Week 6 Client Side Image Maps Introduction to CSS.
Outline IS400: Development of Business Applications on the Internet Fall 2004 Instructor: Dr. Boris Jukic CSS: Cascading Style Sheets.
Database Models. Flat File The most basic way to organize data is as a flat file. You can think of this as a single table with a large number of records.
JMD2144 – Lesson 5 Web Design & New Media. ‘Div’ide and conquer One of the most versatile structure tags available is the.. tag Short for ision, it allows.
What is the difference between race and ethnicity?
Cascading Style Sheets (CSS) Instructor: Mr. Ahmed Al Astal ITGD4104 Department Requirement for senior student University of Palestine Faculty of IT.
Week 4.  Three ways to apply CSS: Inline CSS Internal style sheets ( header style information) External style sheets.
MORE Cascading Style Sheets (The Positioning Model)
INTERNAL CSS Casey Ames Different types of CSS There are three different types of CSS: ◦ External CSS ◦ Internal CSS ◦ Inline CSS In this presentation.
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.
Heredity.. An Introduction Unit 5: Seventh Grade hill.com/sites/ x/student_view0/brainpop_movies.html #
Part 1: CSS - Why? - How it works - Writing rules - Examples.
Heredity As seen in the fantasy species “Plutonian Cats”
CSS. HTML: Looking Back HTML dictates order, structure, and function Does very little to specify layout or visual rendering.
More CSS.
CSS October 19. Review of CSS CSS was designed to separate the content of HTML pages from their appearance We are primarily dealing with external style.
Chapter 6 Introducing Cascading Style Sheets Principles of Web Design, 4 th Edition.
Trait evolution Up until now, we focused on microevolution – the forces that change allele and genotype frequencies in a population This portion of the.
Multiple Alleles Practice Problems.
ECA225 Applied Interactive Programming Cascading Style Sheets, pt 1 ECA 225 Applied Online Programming.
EQ: What controls the inheritance of traits in organisms?
Genetics. Genetics is the study of the inheritance of Characteristics Which of the following do you think are characteristics? Hair colour Eye Colour.
Inheritance Chapter 7. Inheritance: the way genes are passed down. If a father doesn’t have a leg does that mean his children will be born with out a.
Genetics Life Science Mr. P. Remember This can be one of the most difficult topics we cover because it is almost all new to you.
CSS – 1h. Without stylesheets proprietary HTML extensions making text into images proliferate use of "spacer" GIF images deprecated HTML elements and/or.
Dominance and Multiple Allele Notes
Does he look more like his mother or father? In what facial feature?
CSS Cascading Style Sheets A very brief introduction CSS, Cascading Style Sheets1.
Do We Need Some Review??. Draw a punnett square for a di-hybrid cross between RrYy and RRyy.
XHTML & CSS 2 By Trevor Adams. Last week XHTML eXtensible HyperText Mark-up Language The beginning – HTML Web Standards Concept and syntax Elements (tags)
IN THIS LESSON, WE WILL BECOME FAMILIAR WITH HTML AND BEGIN CREATING A WEB PAGE IN YOUR COMPUTER HTML – the foundation.
- WE’LL LOOK AT THE POSITION PROPERTY AND HOW CSS RESOLVES CONFLICTS BETWEEN STYLING INSTRUCTIONS The position property; CSS specificity hierarchy.
THE NORMAL DOCUMENT FLOW from Quick Tip: Utilizing Normal Document Flow by Alex Rodrigues on Web tuts.
IN THIS LESSON, WE WILL BECOME FAMILIAR WITH HTML AND BEGIN CREATING A WEB PAGE IN YOUR COMPUTER HTML – the foundation.
ECA 228 Internet/Intranet Design I Cascading Style Sheets.
EXTERNAL STYLESHEETS AND MORE HTML STYLING HTML and CSS part 2.
Chapter 6 Introducing Cascading Style Sheets Principles of Web Design, Third Edition.
Mr. Rogers Steve Bill Nye Lawyer Mechanic Janitor.
IS 360 Understanding CSS Selectors. Slide 2 Types of Selectors There are different types of selectors Each has a different level of “specificity” An element.
More CSS.
GENETICS.
CSS: Cascading Style Sheets
IS 360 Declaring CSS Styles
>> CSS Rules Selection
Display Property.
More CSS.
IS 360 Understanding CSS Selectors
Document Object Model (DOM): Objects and Collections
CSS Styles Introduction.
Chapter 6 Introducing Cascading Style Sheets
Inheritance CSS.
Meaning Matters Semantic Markup.
CS332A Advanced HTML Programming
Heredity: Or Why Kids Look Like Their Parents
Presentation transcript:

…also known as the Parent-Child Relationship Paul Johnson CIT230 November 7, 2014 Inheritance in CSS

Understanding the Concept A mother and father have blonde hair and blue eyes. When they have a child, he will likely also have blonde hair and blue eyes. …until that child decides to do his own thing and dye his hair purple.

The Concept Adapted In HTML, we have a similar structure. One element can be placed inside of another. When that occurs, the element placed inside the other becomes the child. The element containing the child is then, obviously, the parent element.  P ARENT  C HILD OF A RTICLE  C HILD OF A RTICLE & P ARENT OF S PAN  C HILD OF P In HTML, as in life, parents can have multiple children. And we know that, when a child grows to adulthood, it can become a parent and have children of its own. Likewise, in HTML, a child element can also be a parent element.

Styles Inherited Let’s say that we style the color of the text for the article element to be navy. The child elements of article will inherit that text color of navy. However, if you have styled the text color for the span element to be purple, that color will override the inherited navy color.  P ARENT  C HILD OF A RTICLE  C HILD OF A RTICLE & P ARENT OF S PAN  C HILD OF P

Application This gets a little more complicated as you work with semantic elements that are placed one inside another, inside another, inside another. When you catch yourself mumbling, “I changed just one little thing in my stylesheet, and now everything has changed!,” a recollection of this ‘parent-child’ principle will likely help you.

What if it doesn’t inherit? Some properties are not inherited with some elements. Other times you may wish to inherit a styling in a different circumstance (such as a span within a specific element). If you want a child to inherit a feature, you can use the inherit keyword in your style.

Example from W3Schools We want to set the text-color for elements to blue, except those inside elements with class="extra" (we want them to inherit the color from the parent element).span { color: blue; }.extra span { color: inherit; }

Review Any HTML element that is contained within another element, is a child element. Any HTML element that contains another element is a parent element. Child elements inherit styles from their parent …unless that child element it is styled differently. You can force inheritance when desired.

Sources