CS134 Web Design & Development

Slides:



Advertisements
Similar presentations
HIGH LEVEL OVERVIEW: CSS CSS SYNTAX CONSISTS OF A SET OF RULES THAT HAVE 3 PARTS: A SELECTOR, A PROPERTY, AND A VALUE. IT’S NOT NECESSARY TO REMEMBER THIS.
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.
CSS The basics { }. CSS Cascading Style Sheets - language used to – describe html appearance & formatting Style Sheet - file that describes – how html.
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.
Adding styles. Three alternatives HIT151 Web 'n' Net Web Page Basics /*stylesheet*/ h1,h2,h3 { font-family: verdana, arial, 'sans serif'; } p,table,li.
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.
Today’s objectives  Element relations – tree structure  Pseudo classes  Pseudo elements.
© 2004, Robert K. Moniot Chapter 6 CSS : Cascading Style Sheets.
Advance CSS (Menu and Layout) Miftahul Huda. CSS Navigation MENU It's truly remarkable what can be achieved through CSS, especially with navigation menus.
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.
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.
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)
Web Pages and Style Sheets Bert Wachsmuth. HTML versus XHTML XHTML is a stricter version of HTML: HTML + stricter rules = XHTML. XHTML Rule violations:
“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.
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.
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.
4.01 Cascading Style Sheets
CM143 Week 4 Introducing CSS. Cascading Style Sheets A definition for the style in which an element of the webpage will be displayed Border width, colour,
Technologies for web publishing Ing. Václav Freylich Lecture 5.
CSS Style Rules Guang Tong, Zhan L;lo’p[ Css Style Rule Guang Tong Zhan Three ways to insert CSS 1 External style sheet 2 Internal style sheet 3 Inline.
Week 4.  Three ways to apply CSS: Inline CSS Internal style sheets ( header style information) External style sheets.
Today’s objectives  Review  CSS | Rules | Declarations  HTML Structure document  Class asignment.
 This presentation introduces the following: › 3 types of CSS › CSS syntax › CSS comments › CSS and color › The box model.
CS134 Web Design & Development Cascading Style Sheets (CSS) Mehmud Abliz.
Cascading Style Sheets CSS.  Standard defined by the W3C  CSS1 (released 1996) 50 properties  CSS2 (released 1998) 150 properties (positioning)  CSS3.
Web Design (12) CSS Introduction. Cascading Style Sheets - Defined CSS is the W3C standard for defining the presentation of documents written in HTML.
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.
WebD Introduction to CSS By Manik Rastogi.
Introduction to CSS: Selectors
CSS.
Cascading Style Sheets (CSS) Internal Style Sheets Classes
CSS Cascading Style Sheets
The Box Model in CSS Web Design – Sec 4-8
4.01 Cascading Style Sheets
>> Introduction to CSS
Cascading Style Sheets
IS 360 Declaring CSS Styles
Madam Hazwani binti Rahmat
Web Design & Development
Cascading Style Sheets
Introduction to Web programming
Intro to CSS CS 1150 Fall 2016.
CASCADING STYLE SHEET CSS.
IS333: MULTI-TIER APPLICATION DEVELOPMENT
Website Design 3
Cascading Style Sheets - Building a stylesheet
Intro to CSS CS 1150 Spring 2017.
Software Engineering for Internet Applications
>> Dynamic CSS Selectors
CS134 Web Design & Development
Web Programming– UFCFB Lecture 11
What are Cascading Stylesheets (CSS)?
The Internet 10/6/11 Cascading Style Sheets
Cascading Style Sheets
Cascading Style Sheets™ (CSS)
Web Development & Design Foundations with H T M L 5
CSS Styles Introduction.
Web Design and Development
Cascading Style Sheets - Building a stylesheet
4.01 Cascading Style Sheets
Presentation transcript:

CS134 Web Design & Development Understanding URL & Learn How to Use Different CSS Selector Type Mehmud Abliz

We need to specify the URL. Understanding URL When we have html code like following: <img src=“SOME URL“ /> <a href=“SOME URL"> </a> Or CSS code like: background: url(../img/pdf.png) no-repeat; list-style: url(./img/bullet2.png) inside; We need to specify the URL. How do we know the URL of an object (a file, or a link)?

Assume we have following folders and files Understanding URL Assume we have following folders and files

Understanding URL If we want to insert "image1.jpg“ in the "assign2.html" file, then the html code will be: <img src="../images/image1.jpg" />

Understanding URL Practice: download the "c8_e1.zip“ file from the following address: http://www.cs.pitt.edu/~mehmud/cs134-2084/files/c8_e1.zip 1) Insert "image2.jpg" in "about.html" file; 2) Insert "image3.jpg" in "index.html" and also in "assign1.html"; 3) Make a link to "about.html", "assign1.html", "assign2.html" files in the "index.html" file.

Using Different CSS Selectors Type Selector redefines the look of a specific tag A type selector matches every instance of the element type in the document tree E.g. body {background-color: #000000;} Class Selector can apply to any tag E.g. .indent{margin-right:5%;margin-left: 5%;} In HTML, <p class=“indent”> ID Selector E.g. #myId {color: #38608A;} In HTML, <h1 id="myId">some text..</h1> pseudo-classes are used in CSS selectors to allow information external to the HTML source (e.g. the fact that an anchor has been visited or not) to classify elements.

Using Different CSS Selectors Grouping When several selectors share the same declarations, they may be grouped into a comma-separated list. e.g. h1, h2, h3 {font-family: Georgia;} Universal selector The universal selector, written "*", matches the name of any element type. e.g. * {border: 2px;}

Using Different CSS Selectors Descendant selector Sometimes, you want selectors to match an element that is the descendant of another element in the document tree (e.g., "Match those EM elements that are contained by an H1 element"). Descendant selectors express such a relationship in a pattern. A descendant selector is made up of two or more selectors separated by whitespace. e.g. h1 em {color: blue;}

Using Different CSS Selectors When to use which? Use “type selector” when you want to apply certain style for all occurrences of a certain tag Use “ID selector” if you want to apply the style for only one occurrence of a certain tag Use “class selector” if you want to apply the style for many (but not all) occurrences of a certain tag; OR if you want to apply the style for more than one type of tags

Using Different CSS Selectors When to use which? (cont.) Use “Grouping” When several selectors share the same declarations Use “Universal selector” if you want all the tags in your web documents have some common style (for example, all tags don’t have any margin) Use “Descendant selectors” if you want selectors to match an element that is the descendant of another element

Using Different CSS Selectors Practice Save the HTML file at the following address to your local hard drive: http://www.cs.pitt.edu/~mehmud/cs134-2084/exercise/orion.html Add following CSS rules into orion.html as internal stylesheet: *, h1, h2, h6, h1, h2, h6 , p, .yellowBG, #topcontent, ul li a, #selectedli I explain how you should add them