Some SpotLight in CSS. CSS element>element Selector div>p.

Slides:



Advertisements
Similar presentations
HTML and CSS. HTML Hyper Text Markup Language Tells browser how to display text and images.
Advertisements

CSS-Formatting Review Cascading Style Sheets addstyle to your HTML web pages.
CSS Cascading Style Sheets. Objectives Using Inline Styles Working with Selectors Using Embedded Styles Using an External Style Sheet Applying a Style.
Web Pages Week 10 This week: CSS Next week: CSS – Part 2.
Ideas to Layout Beginning web layout using Cascading Style Sheets (CSS). Basic ideas, practices, tools and resources for designing a tableless web site.
Cascading Style Sheets
Cascading Style Sheets: Basics I450 Technology Seminar Copyright 2003, Matt Hottell.
Introducing CSS CIS 133 mashup Javascript, jQuery and XML 1.
CSS. Intro to CSS Cascading Style Sheets – styles and enhances appearance of webpage.css extension.
FORMATTING IN CONTEXT. FOLLOW UPS ANCHOR POINTS MUST BE UNIQUE  If you have more than one, how does it know where to go?  They can be repeated across.
CHAPTER 8 ADVANCED CSS. LEARNING OBJECTIVES Assign formatting styles to a CSS class definition Use a tag’s class attribute to apply the styles defined.
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.
Links.  Styling Links  Links can be styled with any CSS property (e.g. color, font-family, background-color).  Special for links are that they can.
Cascading Style Sheets Basics. Why use Cascading Style Sheets? Allows you to set up a series of rules for all pages in a site. The series may be changed.
Cascading Style Sheets By: Valerie Kuna. What are Cascading Style Sheets? Cascading Style Sheets (CSS) are a standard for specifying the presentation.
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.
Today’s objectives  Element relations – tree structure  Pseudo classes  Pseudo elements.
© 2004, Robert K. Moniot Chapter 6 CSS : Cascading Style Sheets.
CSS BASICS. CSS Rules Components of a CSS Rule  Selector: Part of the rule that targets an element to be styled  Declaration: Two or more parts: a.
Using CSS (Cascading Style Sheets) Effie Nadiv Edited by permission from author by Amir Kirsh.
Cascading Style Sheets Based on Castro, HTML for the WWW, 6 th edition Ron Gerton, Fall 2007.
1 Pengantar Teknologi Internet W03: CSS Cascading Style Sheets.
CIS 1310 – HTML & CSS 6 Layout. CIS 1310 – HTML & CSS Learning Outcomes  Describe & Apply the CSS Box Model  Configure Float with CSS  Designate Positioning.
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.
1/18 ITApplications XML Module Session 5: Extensible Stylesheet Language (XSL)
CSS: Beyond the Code Karen Perone Rodman Public Library
WEB DESIGN – SEC 4-11 PART OR ALL OF THIS LESSON WAS ADAPTED FROM THE UNIVERSITY OF WASHINGTON’S “ WEB DESIGN & DEVELOPMENT I ” COURSE MATERIALS PSEUDO-CLASS.
Need to define two things: › The destination › Something to click on to get there  Tag is click here  Can be text, special character or image (next.
“Cascading Style Sheets” for styling WWW information DSC340 Mike Pangburn.
กระบวนวิชา 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.
ADVANCED CSS William Neely CEO, Piecewise.com. CSS FONTS AND TEXT CSS ‣ Line-height allows to indicate the amount of space between lines; allows for equal.
Chapter 8 Creating Style Sheets.
CSS normally control the html elements. Three Ways to Insert CSS There are three ways of inserting a style sheet: External style sheet Internal style.
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.
Cascading style sheets CSS
Web Workshop: CSS Objectives: - “What is CSS?” - Structure of CSS - How to use CSS in your webpage.
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.
Principles of Web Design 6 th Edition Chapter 4 – Cascading Style Sheets.
Smashing ~ Chapter 2.  Why are they so important? ◦ Without them we would have no way of assigning styles to elements. ◦ By using selectors we can accomplish.
Cascading Style Sheets by Pavlovic Nenad by. Presentation Contents  What is CSS?  Why CSS?  Types of Style Sheets  Style Sheets Syntax  Box Formatting.
CHAPTER 1 HTML & HTML5 I อ. ยืนยง กันทะเนตร คณะเทคโนโลยีสารสนเทศและการสื่อสาร มหาวิทยาลัยพะเยา 1.
ECA225 Applied Interactive Programming Cascading Style Sheets, pt 1 ECA 225 Applied Online Programming.
So far, we have looked at CSS selectors that correlate with HTML tags Now, we’ll see how you can define your own selectors using class and ID selectors.
>> More on CSS Selectors. Pre-requisite Open the file called sample.txt Copy the all the text from the file Open your browser and go to codepen.io Paste.
Developing Web Applications with HTML and CSS “Selectors and Properties”
ECA 228 Internet/Intranet Design I Cascading Style Sheets.
CSS Layout Cascading Style Sheets. Lesson Overview  In this lesson, we’ll cover:  Brief CSS review  Creating sections with the tag  Creating inline.
Chapter 1: Intro to HTML Section 1: HTML Structure Presentation Section 2: Layout of an HTML File Section 3: Working with Lists & Tables Section 4: HTML.
Introduction to CSS: Selectors
Cascading Style Sheets
Cascading Style Sheets (CSS) Internal Style Sheets Classes
Chapter 13 Colors & backgrounds.
( Cascading style sheet )
CSS Layouts: Grouping Elements
CSS: Cascading Style Sheets
>> Introduction to CSS
>> The “Box” Model
Cascading Style Sheets
Cascading Style Sheets (Layout)
Intro to CSS CS 1150 Fall 2016.
CSS Intro.
COMP 101 Review.
Website Design 3
Intro to CSS CS 1150 Spring 2017.
Software Engineering for Internet Applications
>> Dynamic CSS Selectors
Cascading Style sheet. What is CSS?  CSS stands for Cascading Style Sheets  Cascading: refers to the procedure that determines which style will apply.
The Internet 10/20/11 CSS Layout
Web Programming and Design
Focusing Your CSS Selectors
Presentation transcript:

Some SpotLight in CSS

CSS element>element Selector div>p

div>p { background-color:yellow; } I live in Duckburg My best friend is Mickey

The element>element selector is supported in all major browsers. Note: For element>element to work in IE, a must be declared

CSS element+element Selector How to style all elements that are placed immediately after a element.

.intro { background-color:black; color:#FFF; } div+p { background-color:yellow; } Welcome to My Homepage My name is Donald I live in Duckburg My best friend is Mickey I am a duck

The element+element selector is supported in all major browsers. Note: For element+element to work in IE, a must be declared.

CSS * Selector How to select all elements, and set their background color

* { background-color:yellow; } Welcome to My Homepage TA Group I live in Iran Persian TA

The * selector styles all elements. The * selector can also style all elements inside other elements:

div * { background-color:yellow; }.intro { text-align:right; } TA Persian TA I live in Tehran Tehran

CSS [attribute~=value] Selector The [attribute~=value] selector styles elements with the specified attribute containing the specified value. Note: The value has to be a whole word, either alone (title="flower") or separated by white- space (title="plant flower klematis").

[title~=flower] { border:5px solid yellow; } The image with a title attribute containing the value "flower" gets a yellow border. Note: For [ attribute ~= value ] to work in IE, a DOCTYPE must be declared.

CSS [attribute|=value] Selector The [attribute|=value] selector styles elements with the specified attribute starting with the specified value. Note: The value has to be a whole word, either alone, like lang="en", or followed by a hyphen( - ), like lang="en-us".

[lang|=en] { background:yellow; } [test|=ss] { background:#999; } Hello! Hi! Ello! Hi! Hei! BABBAk...

CSS element element Selector Separate selectors with a white-space, to style elements inside elements. The element element selector styles elements inside elements.

div p { background-color:yellow; } Title Test 1 test 2 test 3

CSS element,element Selector Separate selectors, using commas, to style more than one element with the same style. The element,element selector styles all elements with either one of the specified tagnames

div,p { background-color:yellow; } Welcome to My Homepage Test 1 Test 2 Test 3

CSS :lang Selector The :lang() selector styles all elements with the lang attribute set to a specified value. The :lang() selector is supported in all major browsers. Note: For :lang() to work in IE, a must be declared.

p:lang(it) { background:yellow; } div:lang(iran) { background:yellow; } test1 test2 test 3 test 4 Note: For :lang to work in IE, a DOCTYPE must be declared.

CSS :after Selector The :after selector inserts content after the selected element(s). Use the CSS content property to specify the content.

p:after { content:"- Babak Tavatav"; } Web Design HTML5 Note: For :before to work in IE, a DOCTYPE must be declared.

CSS :before Selector The :before selector inserts content in front of the selected element(s). Use the CSS content property to specify the content.

p:before { content:"Read this::-"; } ASP.net HTML5 Note: For :before to work in IE, a DOCTYPE must be declared.

CSS :first-child pseudo-element first-child pseudo-element styles the specified selector, only if it is the first child of its parent.

p:first-child { background-color:yellow; } Welcome to My Homepage This paragraph is not the first child of its parent Note: For :first-child to work in IE, a DOCTYPE must be declared.

CSS :first-letter pseudo-element first-letter pseudo-element adds a style to the first letter of the specified selector.

p:first-letter { background-color:yellow; } Welcome Babak Tavatav Web design HTMl & CSS

CSS :first-line pseudo-element The :first-line pseudo-element adds a style to the first line of the specified selector.

p:first-line { background-color:yellow; } WWF's Mission Statement this is a test this is a test this is a test this is a test this is a test this is a test this is a test this is a test this is a test this is a test this is a test this is a test this is a test this is a test this is a test this is a test this is a test this is a test this is a test this is a test this is a test this is a test this is a test this is a test this is a test this is a test this is a test this is a test this is a test this is a test this is a test this is a test this is a test this is a test this is a test this is a test this is a test this is a test this is a test this is a test this is a test this is a test this is a test this is a test

CSS :focus Selector The :focus selector styles the element that has focus.

input:focus { background-color:yellow; } Click inside the text fields to see a yellow background: First name: Last name:

CSS :hover Selector The :hover selector styles elements when you hover (mouse over) them.

a:hover { background-color:yellow; } Mouse over the links to see a yellow background: Avand SabadeKala

CSS :visited Selector The :visited selector styles links to visited pages. Note: The :link selector does not style links to pages you have not visit. Tip: Use the :link selector to style links to not visited pages. Tip: Use the :hover selector to style links when you mouse over them. Note: :hover MUST come after :link and :visited (if they are specified) in the CSS definition in order to be effective! Tip: Use the :active selector to style links when you click on them. Note: :active MUST come after :hover (if specified) in the CSS definition in order to be effective!

a:visited { background-color:yellow; } SabadeKala Avand WROX Note: The :link selector does not style links to pages you have already visited.

The End