Mgr. Martin Vesel M 114

Similar documents
CSS Cascading Style Sheets

CSC309 Programming on the Web week 3: css, rwd


Client-Side Web Technologies. CSS Part I

Appendix D CSS Properties and Values

Session 3.1 Objectives Review the history and concepts of CSS Explore inline styles, embedded styles, and external style sheets Understand style

COSC 2206 Internet Tools. CSS Cascading Style Sheets

CSS Cascading Style Sheets

CSS Styles Quick Reference Guide

Parashar Technologies HTML Lecture Notes-4

Networks and Web for Health Informatics (HINF 6220) Tutorial 8 : CSS. 8 Oct 2015

Adding CSS to your HTML

Introduction to Web Design CSS Reference

Introduction to Web Design CSS Reference

HTML/XML. HTML Continued Introduction to CSS

IMY 110 Theme 6 Cascading Style Sheets

8/19/2018. Web Development & Design Foundations with HTML5. Learning Objectives (1 of 2) Learning Objectives (2 of 2)

Cascading Style Sheets

CSS: Cascading Style Sheets

CSS.

CSS. Lecture 16 COMPSCI 111/111G SS 2018

3.1 Introduction. 3.2 Levels of Style Sheets. - The CSS1 specification was developed in There are three levels of style sheets

- The CSS1 specification was developed in CSS2 was released in CSS2.1 reflects browser implementations

CSS مفاهیم ساختار و اصول استفاده و به کارگیری

CSS: The Basics CISC 282 September 20, 2014

Chapter 4 CSS basics

Introduction to Multimedia. MMP100 Spring 2016 thiserichagan.com/mmp100

CMPT 165 INTRODUCTION TO THE INTERNET AND THE WORLD WIDE WEB

Review Question 1. Which tag is used to create a link to another page? 1. <p> 2. <li> 3. <a> 4. <em>

BIM222 Internet Programming

CSS Lecture 16 COMPSCI 111/111G SS 2018

Cascading Style Sheets (CSS)

CSS: Cascading Style Sheets

HTML & CSS. SWE 432, Fall 2017 Design and Implementation of Software for the Web

Creating A Website - Part 1: Web Design principles, HTML & CSS. CSS Color Values. Hexadecimal Colors. RGB Color

CSS3 Basics. From & CSS Visual Dictionary Learning Curve Books, LLC

CSS Selectors. element selectors. .class selectors. #id selectors

Cascade Stylesheets (CSS)

Introduction to Web Tech and Programming

CSS. Selectors & Measurments. Copyright DevelopIntelligence LLC

Session 4. Style Sheets (CSS) Reading & References. A reference containing tables of CSS properties

CSS Futures. Web Development

COMP519 Web Programming Lecture 7: Cascading Style Sheets: Part 3 Handouts

Index. alt, 38, 57 class, 86, 88, 101, 107 href, 24, 51, 57 id, 86 88, 98 overview, 37. src, 37, 57. backend, WordPress, 146, 148

INTRODUCTION TO CSS. Topics MODULE 5

ID1354 Internet Applications

Building Page Layouts

Assignments (4) Assessment as per Schedule (2)

CSS: Layout Part 2. clear. CSS for layout and formatting: clear

Creating and Building Websites

HTML Summary. All of the following are containers. Structure. Italics Bold. Line Break. Horizontal Rule. Non-break (hard) space.

INTERNATIONAL UNIVERSITY OF JAPAN Public Management and Policy Analysis Program Graduate School of International Relations

Website Development with HTML5, CSS and Bootstrap

The Benefits of CSS. Less work: Change look of the whole site with one edit

UNIVERSITI TEKNOLOGI MALAYSIA TEST 1 SEMESTER II 2012/2013

<style type="text/css"> <!-- body {font-family: Verdana, Arial, sans-serif} ***set font family for entire Web page***

Web Engineering CSS. By Assistant Prof Malik M Ali

Cascading Style Sheet. Styles as Tag Attributes. Syntax. <h1>: what font type/size is used? STYLE = SELECTOR {RULES} Attributes such as bgcolor

Web Design and Development Tutorial 03

Reading 2.2 Cascading Style Sheets

CASCADING STYLESHEETS

2005 WebGUI Users Conference

8a. Cascading Style Sheet

- The CSS1 specification was developed in CSSs provide the means to control and change presentation of HTML documents

Page Layout. 4.1 Styling Page Sections 4.2 Introduction to Layout 4.3 Floating Elements 4.4 Sizing and Positioning

Deccansoft Software Services

CSS. Shan-Hung Wu CS, NTHU

Cascading Style Sheet Quick Reference

Web Development & Design Foundations with HTML5

CMPT 165: More CSS Basics

Web Development & Design Foundations with HTML5

INFS 2150 Introduction to Web Development

INFS 2150 Introduction to Web Development

escuela técnica superior de ingeniería informática

Study Guide 2 - HTML and CSS - Chap. 6,8,10,11,12 Name - Alexia Bernardo

Tutorial 3: Working with Cascading Style Sheets

TAG STYLE SELECTORS. div Think of this as a box that contains things, such as text or images. It can also just be a

LBS Polytechnic. Hey! Make With The Style Sheet Already, Bub!

DAY 4. Coding External Style Sheets

> > > > Cascading Style Sheets basics

CS 350 Internet Applications I Name: Exam II (CSS) October 29, 2013

Web Programming and Design. MPT Senior Cycle Tutor: Tamara Week 2

AN INTRODUCTION TO WEB PROGRAMMING. Dr. Hossein Hakimzadeh Department of Computer and Information Sciences Indiana University South Bend, IN

GIMP WEB 2.0 MENUS WEB 2.0 MENUS: HORIZONTAL NAVIGATION BAR CREATING AN HTML LIST

Unit 10 - Client Side Customisation of Web Pages. Week 5 Lesson 1 CSS - Selectors

READSPEAKER ENTERPRISE HIGHLIGHTING 2.5

Web Development & Design Foundations with HTML5, 8 th Edition Instructor Materials Chapter 3 Test Bank

CSS. MPRI : Web Data Management. Antoine Amarilli Friday, December 7th 1/43

CSS Cascading Style Sheets

CSS. CSS is the style language for web pages. CSS stylesheets example

Cascading Style Sheets Level 2

/* ========================================================================== PROJECT STYLES

CSCB20 Week 7. Introduction to Database and Web Application Programming. Anna Bretscher Winter 2017

CSC309 Winter Lecture 2. Larry Zhang

Chapter 3 Style Sheets: CSS

Web Information System Design No.4 Put Style to Web Documents. Tatsuya Hagino

<body bgcolor=" " fgcolor=" " link=" " vlink=" " alink=" "> These body attributes have now been deprecated, and should not be used in XHTML.

Unit 20 - Client Side Customisation of Web Pages. Week 2 Lesson 4 The Box Model

Unit 20 - Client Side Customisation of Web Pages. Week 2 Lesson 4 The Box Model

This tutorial will help both students as well as professionals who want to make their websites or personal blogs more attractive.

Transcription:

Mgr. Martin Vesel martin.vesel@gmail.com M 114

Where 2 go W3C, CSS špecifikácia http://www.w3.org/standards/techs/css#w3c_all http://www.w3.org/tr/2011/rec-css2-20110607/ http://www.w3.org/tr/2012/rec-css3-mediaqueries-20120619/ Návody, referencie http://w3schools.com/cssref/css3_browsersupport.asp http://w3schools.com/css3/css3_intro.asp http://w3schools.com/css/default.asp http://www.csszengarden.com/ http://www.acidtests.org/ CSS validátor http://jigsaw.w3.org/css-validator/ WEGA 2013, Mgr. Martin Vesel, martin.vesel@gmail.com, M 114 2 / 25

Tourguide CSS - syntax, selectory, pseudo triedy/elementy, jednotky CSS Box model Float, position, z-index Formátovanie textu (farba, odsadenie, typ písma, rez...) Formátovanie blokov (tieňovanie, rám, zoblenie rohov) CSS media queries Animácia, prechody a transformácie WEGA 2013, Mgr. Martin Vesel, martin.vesel@gmail.com, M 114 3 / 25

Čo je CSS Značkovací jazyk Cascading Style Sheets Načo CSS? Formátovanie dokumentov Oddelenie formátovania od obsahu Zjednodušenie a sprehľadnenie HTML kódu WEGA 2013, Mgr. Martin Vesel, martin.vesel@gmail.com, M 114 4 / 25

Syntax Selector { } property1: value1; property2: value2;... p {text-align: left; font-size: 20px;} /* komentar */ WEGA 2013, Mgr. Martin Vesel, martin.vesel@gmail.com, M 114 5 / 25

CSS selectors Selector Príklad Popis * * Vyberie všetky html elementy v dokuente element p Vyberie všetky elementy p v dokumente.class.horne_menu Vyberie všetky elementy s triedou horne_menu #id #obsah Vyberie element s id = obsah element.class p.perex Vyberie všetky elementy p s triedou perex http://w3schools.com/cssref/css_selectors.asp WEGA 2013, Mgr. Martin Vesel, martin.vesel@gmail.com, M 114 6 / 25

CSS selectors Selector Príklad Popis element, element div, p Vyberie všetky elementy <div> a <p> v dokuente element element div p Vyberie všetky elementy <p> vo vnútri elementu <div> element > element div > p Vyberie všetky <p> elementy ktorých rodič je <div> element + element element ~ element div + p div ~ p Vyberie všetky <p> elementy, ktoré nasledujú bezprostredne za <div> elementom Vyberie všetky <p> elementy, ktorým predchádza <div> element WEGA 2013, Mgr. Martin Vesel, martin.vesel@gmail.com, M 114 7 / 25

CSS selectors Selector Príklad Popis [attribute] [attribute=value] [attribute~=vulue] [attribute^=value] [attribute$=value] [attribute*=value] a[target] a[target=_blank] p[title~=css] a[href^=http] a[href$=.pdf] p[title*=new] Vyberie všetky elementy <a>, ktoré majú definovaný atribút target Vyberie všetky elementy <a>, ktorých atribút target má hodnotu _blank Vyberie všetky elementy <p>, ktorých atribút title obsahuje slovo css Vyberie všetky elementy <a>, ktorých hodnota atribútu href začína http Vyberie všetky elementy <a>, ktorých hodnota atribútu href končí.pdf Vyberie všetky elementy <p>, ktorých hodnota atribútu title obsahuje podreťazec new WEGA 2013, Mgr. Martin Vesel, martin.vesel@gmail.com, M 114 8 / 25

CSS selectors - pseudo-classes Selector Príklad Popis :hover a:hover Vyberie elementy <a> nad ktorým je kurzor :focus input:focus Vyberie element <input> ktorý má focus :first-child div:first-child Vyberie prvé dieťa elementu <div> :first-letter p:first-letter Vyberie prvé písmeno obsahu elementu <p> :first-line p:first-line Vyberie prvý riadok obsahu elementu <p> :nth-child(n) tr:nth-child(odd even 2n + 1) Vyberie n-té dieťa elementu (nepárne, párne,...) WEGA 2013, Mgr. Martin Vesel, martin.vesel@gmail.com, M 114 9 / 25

CSS pseudo-classes Selector Príklad Popis :before p:before Vloží obsah pred každý element <p> :after p:after Vloží obsah za každý element <p> :not(selector) :not(p) Vyberie všetky elementy okrem elementov ktoré zodpovedajú selectoru (<p>) a mnohé ďalšie... http://w3schools.com/cssref/css_selectors.asp WEGA 2013, Mgr. Martin Vesel, martin.vesel@gmail.com, M 114 10 / 25

Jednotky Jednotka Popis % percento in cm mm em ex pt pc px palec centimeter milimeter 1 em sa rovná aktuálnej veľkosti písma 1 ex sa rovná veľkosti x (zvyčajne polovica aktuálnej veľkosti písma) bod (1/72 in) 1 pica = 12 pt obrazový bod WEGA 2013, Mgr. Martin Vesel, martin.vesel@gmail.com, M 114 11 / 25

CSS Box model WEGA 2013, Mgr. Martin Vesel, martin.vesel@gmail.com, M 114 12 / 25

Obtekanie float: left right clear: left right both obtekaný element sa správa akoby bol vyňatý z dokumentu a nezapočítava sa do rozmerov svojho rodiča WEGA 2013, Mgr. Martin Vesel, martin.vesel@gmail.com, M 114 13 / 25

Umiestnenie - position vlastnosť position: static predvolené umiestnenie elementu v dokumente fixed pevne dané umiestnenie v rámci okna prehliadača absolute absolútne definované umiestnenie v dokumente relative relatívne umiestnenie vzhľadom na predvolené left, right, top, bottom umiestnenie od okraja dokumentu z-index vrstva dokumentu (zetová os) WEGA 2013, Mgr. Martin Vesel, martin.vesel@gmail.com, M 114 14 / 25

Display inline element sa vykreslí ako inline (napr. span) block element sa vykreslí ako blokový inline-block vnútro elementu sa chová ako blokový element, celý element ako inline none element sa nezobrazí table element sa zobrazí ako tabulka... mnohé ďalšie WEGA 2013, Mgr. Martin Vesel, martin.vesel@gmail.com, M 114 15 / 25

Formátovanie textu font-family typ písma, Arial, Times New Roman, Serif font-style normal italic font-size veľkosť písma font-weight normal, bold skrátený zápis cez vlastnosť font color farba textu (hex, rgba(), rgb()...) line-height veľkosť riadku (1.5 em) text-align left right center justify text-transform uppercase lowercase capitalize text-indent odsadenie textu text-shadow tieň, h-shadow v-shadow blur color text-overflow pretekanie textu, clip ellipsis string... mnohé ďalšie WEGA 2013, Mgr. Martin Vesel, martin.vesel@gmail.com, M 114 16 / 25

Vlastný font @font-face{ } font-family: myfirstfont; src: url('sansation_light.ttf'), url('sansation_light.eot'); /* IE9 */ <link href='http://fonts.googleapis.com/css?family=ubuntu' rel='stylesheet' type='text/css'> WEGA 2013, Mgr. Martin Vesel, martin.vesel@gmail.com, M 114 17 / 25

Formátovanie blokov width, height, min-width, min-height, max-width, max-height margin, padding -top, -right, -bottom, -left top / bottom left / right top left / right bottom overflow, overflow-x, overflow-y - pretekanie box-sizing ako sa má počítať šírka / výška content-box border-box border orámovanie elementu border-radius zaoblenie rohov box-shadow tieň, podobne ako text-shadow, inset / outset WEGA 2013, Mgr. Martin Vesel, martin.vesel@gmail.com, M 114 18 / 25

Pozadie background background-attachment scroll, fixed, local background-position umiestnenie background-repeat repeat, repeat-x, repeat-y, no-repeat background-size rozmery, cover, contain background-origin border-box, padding-box, content-box background-clip border-box, padding-box, content-box WEGA 2013, Mgr. Martin Vesel, martin.vesel@gmail.com, M 114 19 / 25

Tabuľky, zoznamy border-collapse bunky medzi majú medzi sebou iba 1 rámik border-spacing html cellspacing empty-cells zobrazovať rámik na prázdnych bunkách? list-style list-style-image obrázok odrážky list-style-position inset, outset list-style-type typ odrážky (čísla, krúžok...) WEGA 2013, Mgr. Martin Vesel, martin.vesel@gmail.com, M 114 20 / 25

Media queries responzívny dizajn media types: all, screen, print, tv... @media screen and (min-width: 400px) and (max-width: 700px) { } @media screen and (device-aspect-ratio: 2560/1440) { } http://www.w3.org/tr/css3-mediaqueries/ WEGA 2013, Mgr. Martin Vesel, martin.vesel@gmail.com, M 114 21 / 25

Animácia @keyframes mymove { from {top:0px;} to {top:200px;} } @-webkit-keyframes mymove /* Safari and Chrome */ { } from {top:0px;} to {top:200px;} animation-name ktorú animáciu na elemente použiť animation-duration dĺžka animácie animation-delay oneskorenie spustenia animácie WEGA 2013, Mgr. Martin Vesel, martin.vesel@gmail.com, M 114 22 / 25

Animácia transition transition-property none, all, property transition-duration trvanie prechodu transition-delay oneskorenie spustenia prechodu transform tansformačné funkcie (rotate, translate...) transform-origin zmena počiatku transformácie WEGA 2013, Mgr. Martin Vesel, martin.vesel@gmail.com, M 114 23 / 25

Bonusová úloha Vytvorte 3 úrovňové vysúvacie menu bez použitia Javascriptu, iba pomocou css (1b) Aplikujte na menu css animáciu (0.5 boda) HTML a CSS kód musí byť validný Menu musí fungovať vo všetkých prehliadačoch a IE > 8 Na menu použite odrážkové zoznamy Dbajte na sémantiku dokumentu WEGA 2013, Mgr. Martin Vesel, martin.vesel@gmail.com, M 114 24 / 25

Konzultácie Ak ste niečomu nerozumeli, neváhajte napísať, od toho sme tu :) Konzultácie si prosím vopred dohodnite mailom na martin.vesel@gmail.com Miestonsť M 114 WEGA 2013, Mgr. Martin Vesel, martin.vesel@gmail.com, M 114 25 / 25