Advanced CSS. Display  Hiding an element can be done in two ways  display:none  Element is hidden and will no longer take up space on the page  Can.

Slides:



Advertisements
Similar presentations
CSS Cascading Style Sheets. Objectives Using Inline Styles Working with Selectors Using Embedded Styles Using an External Style Sheet Applying a Style.
Advertisements

1 Cascading Style Sheets Continued Different kinds of selectors in a style sheet –Simple- Pseudo-Class –Contextual- Pseudo-Element –Class Image Styles.
CSS Internet Engineering Spring 2014 Bahador Bakhshi CE & IT Department, Amirkabir University of Technology.
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.
Chapter 7 Page Layout Basics Key Concepts Copyright © 2013 Terry Ann Morris, Ed.D 1.
Part 5 Introduction to CSS. CSS Display - Block and Inline Elements A block element is an element that takes up the full width available, and has a line.
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.
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.
กระบวนวิชา 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.
XP 1 Working with Cascading Style Sheets Creating a Style for Online Scrapbooks Tutorial 7.
MORE Cascading Style Sheets (The Positioning Model)
Working with Cascading Style Sheets. 2 Objectives Introducing Cascading Style Sheets Using Inline Styles Using Embedded Styles Using an External Style.
Tutorial #8 – Creating Data Tables. Tutorial #6 Review – Layouts Two Column Fixed Width, Three Column Fixed Width Class VS. ID Container Universal Selector.
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.
1Computer Sciences Department. And use
New Perspectives on XML, 2nd Edition Tutorial 5 1 TUTORIAL 5 WORKING WITH CASCADING STYLE SHEETS.
XP New Perspectives on XML Tutorial 5 1 TUTORIAL 5 CSS Tutorial – Carey ISBN
CSS Introduction Cascading Style Sheets Provides a great deal of control over the presentation of the document HTML indicates both semantics of a document.
CSS Positioning Creating Special Effects with CSS CS202 Working with Cascading Style Sheets (Chapter 4) CS202 1.
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.
Copyright © Terry Felke-Morris WEB DEVELOPMENT & DESIGN FOUNDATIONS WITH HTML5 7 TH EDITION Chapter 6 Key Concepts 1 Copyright © Terry Felke-Morris.
Doman’s Sections Information in this presentation includes text and images from
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.
MySQL and PHP Review CSS. Cascading Style Sheet (CSS) Style sheets are files or forms that describe the layout and appearance of a document. Cascading.
Designing a Web Page with Tables. A text table: contains only text, evenly spaced on the Web page in rows and columns uses only standard word processing.
ALBERT WAVERING BOBBY SENG. Week 3: CSS  Quiz  Announcements/questions/etc  Homework.
XP Tutorial 7New Perspectives on HTML and XHTML, Comprehensive 1 Working with Cascading Style Sheets Tutorial 7.
Tutorial #6 – Creating Fixed Width Layouts. Tutorial #5 Review – Box Model Every html element is surround by a box Content, Padding, Border, Margin Can.
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.
More CSS.
CSS Tutorial 1 Introduction Syntax How to use style specifications. Styles.
Use CSS to Implement a Reusable Design Selecting a Dreamweaver CSS Starter Layout is the easiest way to create a page with a CSS layout You can access.
Week 8 – Part 2 Page Layout Basics Key Concepts 1.
>> 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.
XP Review 2 New Perspectives on JavaScript, Comprehensive1 Introducing Cascading Style Sheets Formatting Web Pages with CSS.
Web Development & Design Foundations with HTML5 7th Edition
Copyright © Terry Felke-Morris WEB DEVELOPMENT & DESIGN FOUNDATIONS WITH HTML5 Chapter 6 Key Concepts 1 Copyright © Terry Felke-Morris.
INTRODUCTORY Tutorial 5 Using CSS for Layout and Printing.
CNIT 132 – Week 4 Cascading Style Sheets. Introducing Cascading Style Sheets Style sheets are files or forms that describe the layout and appearance of.
Web Foundations MONDAY, OCTOBER 7, 2013 LECTURE 7: CSS LINK COLORS, INTERMEDIATE CSS.
Copyright © Osmosys O S M O S Y SO S M O S Y S D e p l o y i n g E x p e r i e n c e & E x p e r t i s e™ CSS Training.
CONTROLLING Page layout
Developing Web Applications with HTML and CSS “Selectors and Properties”
Tutorial 4 Creating Page Layouts with CSS
- WE’LL LOOK AT THE POSITION PROPERTY AND HOW CSS RESOLVES CONFLICTS BETWEEN STYLING INSTRUCTIONS The position property; CSS specificity hierarchy.
NASRULLAHIBA.  It is time to take your web designing skills to the next level with Cascading Style Sheets (CSS). They are a way to control the look and.
XP Tutorial 7New Perspectives on HTML and XHTML, Comprehensive 1 Working with Cascading Style Sheets Creating a Style for Online Scrapbooks Tutorial 7.
Laying out Elements with CSS
Working with Cascading Style Sheets
Webpage layout using CSS
Advanced CSS BIS1523 – Lecture 20.
Cascading Style Sheets
Web Systems & Technologies
Cascading Style Sheets
Web Development & Design Foundations with HTML5 7th Edition
Chapter 7 Page Layout Basics Key Concepts
Web Development & Design Foundations with HTML5 8th Edition
Web Development & Design Foundations with HTML5
IS333: MULTI-TIER APPLICATION DEVELOPMENT
Basics of Web Design Chapter 7 Page Layout Basics Key Concepts
6 Layout.
MORE Cascading Style Sheets (The Positioning Model)
>> Dynamic CSS Selectors
Web Development & Design Foundations with H T M L 5
Web Development & Design Foundations with HTML5
Web Development & Design Foundations with HTML5
The Internet 10/20/11 CSS Layout
Positioning Boxes Using CSS
Presentation transcript:

Advanced CSS

Display  Hiding an element can be done in two ways  display:none  Element is hidden and will no longer take up space on the page  Can be thought of as being removed from the DOM  visibility:hidden  Element is hidden but still takes up the same space  Other elements on the page will behave as though the hidden element is still there  It is just not visible on the page

Positioning  CSS positioning allows you to position elements on a page  Elements can be positioned using top, left, bottom and right but only if their position property is set first  Four different positioning methods  Static positioningposition: static;  Fixed positioningposition:fixed;  Relative positioningposition:relative;  Absolute positioningposition:absolute;

CSS Positioning  Static positioning  This is the default positioning  A static positioned element is always positioned according to the normal flow of the page  Top, left, right and bottom properties have no effect  Fixed positioning  Element is positioned relative to the browser window  It will not move even if the window is scrolled  Elements are removed from the normal flow of the page  All other elements behave as if the fixed element does not exist

CSS Positioning  Relative Positioning  A relative positioned element is positioned relative to its normal position  The content of the relatively positioned element can be moved and overlap other elements  The reserved space for the element is preserved in the normal flow of the document  Absolute Positioning  Absolutely positioned element are positioned relative to the first parent that has a position other than static  They are removed from the normal flow of the document

CSS Positioning  Excellent Tutorial for CSS Positioning  training/css/positioning/ training/css/positioning/

CSS Floating  Elements are floated horizontally, left or right  A floated element will move as far to the left or right as its containing element will allow  Elements after the floating element will flow around it  Elements before the floating element will not be affected  Several floating elements after each other will float next to each other

CSS Floating  clear property is used to clear floats  Syntax: #news { float: right; clear: both; } 

Pseudo class selectors  Used to add special effects to some selectors  Some pseudo selectors are newer features of CSS3  Syntax selector:pseudo-class {property:value;} Selector.class:pseudo-class {property:value;}

Anchor Selectors  a:link {color:#FF0000;} /* unvisited link */ a:visited {color:#00FF00;} /* visited link */ a:hover {color:#FF00FF;} /* mouse over link */ a:active {color:#0000FF;} /* selected link */

:first-child selector  :first-child pseudo class matches an element that is the first child of another element e.g. #content p:first-child { font-weight: italic; } This matches the first p tag that is a child of the enclosing tag with id=content

:before and :after  Insert content before or after the specified selector  Eg p:after { content:"- Remember this"; } Inserts the content after every element p:before { content:“A wise man once said: "; } Inserts the content before every element

CSS Pseduo selectors  Extensive list of CSS Pseudo Selectors

Attribute Selectors  In addition to using class and id selectors for specifying css styles, you can use the attributes of elements  HTML  CSS [alt=Demo], img[alt=Demo] { border: 1px solid #0f0; }  This will apply a green border to any tag that has an alt value of “Demo”

Other Examples of attribute selectors  [name~=value]  ~= is used to mean if the attribute contains a specified value even if the words are separated by spaces  Expression  [title~=hello] { color: blue}  Matches   [name*=value]  *= selects elements that have attributes with a value containing the specified substring  Expression  [class*=large] { font-size: 30px;}  Match 

Other Examples of attribute selectors  [name$=value]  Selects elements that have attributes ending exactly with a given string  Expression  [class$=font] { color: red;}  Match  Warning  [name!=value]  Selects elements that do not have the specified attribute or do have the specified attribute but not with a certain value  Expression  [class!=font] { color: red;}  Match  Warning

Other Examples of attribute selectors  [name^=value]  Selects elements that have attributes beginning exactly with a given string  Expression  [class^=pretty] { border-color: blue;}  Match   [name|=value]  Selects elements that have the specified attribute with a value equal to a given string or starting with a string followed by a hypen ( -)  Expression  [class|=space] {margin: 5px;}  Match  Warning

What is CSS3?  Next evolution of CSS  Allows developers to build cleaner pages, create better visual effects and all with pages loading faster than before  Still a work in progress but the latest browsers have already implemented a large majority of the specification  Specification is broken down in to a module based approach – it is so large that breaking it up into modules makes adoption by browsers easier  Selectors module  Colors and Backgrounds  Positioning  Visual Effects etc

Examples of new features of CSS3  More powerful selectors  Text Effects and Layouts  changes to hyphenation, whitespace and justification of text in documents  Multi-Column layout  Allows designers to display content in multiple columns with definitions such as column-gap, column-count and column-width  Multiple backgrounds on a page  Shading and curved borders and much more

CSS3  CSS Roadmap  New options allow styles to be used instead of traditional graphics for professional looking websites   curved borders curved borders  box shadows box shadows  multiple backgrounds multiple backgrounds  colors and opacity colors and opacity  image opacity image opacity  text effects text effects

References  CSS Reference   CSS Selector Reference   CSS Web Safe Fonts   CSS Colors and Web Safe Colors   Color Scheme Designer 