Doncho Minkov Telerik School Academy schoolacademy.telerik.com Technical Trainer

Slides:



Advertisements
Similar presentations
LIS650 lecture 4 Thomas Krichel today CSS Properties –Box properties-- List properties –Table properties-- Classification properties –(Audio.
Advertisements

Client-Side Internet and Web Programming
With CSS, a color is most often specified by: a HEX value - like "#ff0000" an RGB value - like "rgb(255,0,0)" a color name - like "red“ Example h1.
Cascading Style Sheets Color and Background Controls Border and Margin Controls (Boxes)
9-May-15 More CSS. 2 A different emphasis CSS is the same for XML as it is for HTML and XHTML, but-- XML contains no display information If you want your.
Today’s objectives Site performance Padding, Margins, Borders
Week 9 Using the Box Properties. 9-2 The CSS Visual Formatting Model Describes how the element content boxes should be displayed by the browser –Based.
CSS provides a way to stray away from the traditional methods of using tables to lay out pages. Success with this technique depends on understanding of.
Tutorial 4: Creating page layout with css
Tutorial 5 Working with the Box Model. XP Objectives Understand the box model Create padding, margins, and borders Wrap text around an image Float a block-level.
CSS: Class 1 Background Images, Controlling Position of Background Images, Add Padding to Page Elements, Add Borders to Elements on a Page.
Slide 1 of 62 CSS Pseudo-classes The syntax of pseudo- classes: selector:pseudo-class { property:value; } A pseudo-class is used to define a special state.
CIS 1310 – HTML & CSS 4 Visual Elements and Graphics.
Cascading Style Sheets Part 3 Fall, 2007 Modified by Linda Kenney Nov. 12, 2007.
An Introduction to Cascading Style Sheets CSS Layout, and the CSS Box Model Nick Foxall SM5312 week 9: CSS Layout.
14-Jul-15 CSS Applications to XML. 2 A different emphasis CSS is the same for XML as it is for HTML, but-- HTML already does a pretty good job of layout.
Slide 1 of 83 Table Borders To specify table borders in CSS, use the border property. The example below specifies a black border for table, th, and td.
CSS Box Model. What is the CSS Box Model? The “Box Model” is a tool we use to lay out our web pages in a number of individual "boxes" or "containers".
CSS Dvijesh Bhatt.
Dreamweaver -- CSS. Dreamweaver -- MX New icons are added in MX Most of the features commonly used in web design, and are same as FrontPage. New feature.
CSS Typography, Fonts, Spacing, Borders, Backgrounds, Opacity
Cascading Style Sheets, pt 2 ECA 225 Applied Online Programming.
The Missing Manual MARGINS, PADDING, & BORDERS—CHAPTER 7.
CSS The Definitive Guide Chapter 8.  Allows one to define borders for  paragraphs  headings  divs  anchors  images  and more.
CIS 1315 – Web Development for Educators CIS 1315 HTML Tutorials 3 & 4: Working With CSS.
CSS Border.
Today’s objectives  Assignment 1  Padding, Margins, Borders  Fluid Layout page  Building accessible Table  Element size with padding and border 
CHAPTER 3 CSS & CSS3 อ. ยืนยง กันทะเนตร คณะเทคโนโลยีสารสนเทศและการสื่อสาร มหาวิทยาลัยพะเยา 1.
LITTLE BOXES Controlling size of boxes Box model for borders, margin and padding Displaying and hiding boxes.
Tutorial #6 – Creating Fixed Width Layouts. Tutorial #5 Review – Box Model Every html element is surround by a box Content, Padding, Border, Margin Can.
Doncho Minkov Telerik Web Design Course html5course.telerik.com Technical Trainer
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.
Chcslonline.org Text –wrapping around Images. chcslonline.org To wrap text around an image, lets set up a style in our style sheet. open a new notepad.
INTRODUCTORY Tutorial 4 Exploring Graphic Elements and Images.
Part 4 Introduction to CSS. CSS Table Table Borders table, td, th { border:1px solid black; } Firstname Lastname Bader Ali Paul Manuel The example below.
Cascading Style Sheets Chapters 5-6 Color and Background Controls Border and Margin Controls.
Cascading Style Sheets Part 3 Spring, 2008 Modified by Linda Kenney April 21, 2008.
CSS Layout Arrangement and Positioning of the HTML Elements Svetlin Nakov Technical Trainer Software University
Svetlin Nakov Telerik Corporation
Web Foundations THURSDAY, OCTOBER 3, 2013 LECTURE 6: CSS CONTINUED.
>> The “Box” Model. Pre-requisite Create a new project in Netbeans called Week5 Create a new html file and name it box.html Create a new css file and.
 Cascading Style Sheets (CSS) ◦ Used to specify the presentation of elements separately from the structure of the document.  Inline style ◦ declare.
CSS Class 2 -Add margins to elements on a page. -Set width and height of elements. - CSS shorthand properties for box model. -Style links. -Style tables.
1 CS428 Web Engineering Lecture 08 Border, Margin, Padding … (CSS - III)
CSS Layout Cascading Style Sheets. Lesson Overview  In this lesson, you will learn:  CSS Box Model  CSS properties for border  CSS properties for.
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.
CSS Layout Arrangement and Positioning of the HTML Elements SoftUni Team Technical Trainers Software University
Tutorial 4 Creating Page Layouts with CSS
CSS - Quiz #3 Lecture Code:
HTML and Dreamweaver November 11th. Agenda Box Model Displaying and positioning elements – Padding – Margin – Float – Display – Position HTML Demo.
CIS234A Lecture 6 Instructor Greg D’Andrea. Span and Div The span and div elements are a generic means by which we can add structure to documents. The.
CSS Box Model. What is the Box Model? Each XHTML element appearing on our page takes up a "box" or "container" of space. Each box size is affected not.
Tutorial #5 Working with the Box Model. Tutorial #4 Review - CSS Create a homework page Final Project Discussion Exam on Blackboard Styling Lists (List-style-type,
PERSPECTIVES: TUTORIAL 4 CREATING PAGE LAYOUTS WITH CSS.
CS 120: Introduction to Web Programming Lecture 10: Extra Features and Website Design Part 1 Tarik Booker CS 120 California State University, Los Angeles.
Unit 3 - Review. Topics 1. Tag, Attribute, Value 2. CSS Rule Syntax + link 3. Categories of Selectors 4. Inline vs Block Tags 5. CSS Layout 6. CSS Box.
CSS. What does it stand for? ___________________.
CSS. What does it stand for? Cascading Style Sheet.
>> CSS Layouts. Recall Properties of Box – Border (style, width, color) – Padding – Margin – Display – Background – Dimension Welcome Padding Area Border.
CSS.
Cascading Style Sheets Boxes
CSS Layouts: Grouping Elements
>> The “Box” Model
Objectives Create a reset style sheet Explore page layout designs
Cascading Style Sheets
CSS Borders and Margins.
More CSS Page layout Boriana Koleva Room: C54
CSS Boxes CS 1150 Fall 2016.
CS3220 Web and Internet Programming More CSS
Presentation transcript:

Doncho Minkov Telerik School Academy schoolacademy.telerik.com Technical Trainer

 Borders  Overflow  Margins and Paddings  The Box Model  Width and Height  Other CSS Properties 2

3

 border-width : thin, medium, thick or numerical value (e.g. 10px )  border-color : color alias or RGB value  border-style : none, hidden, dotted, dashed, solid, double, groove, ridge, inset, outset  Each property can be defined separately for left, top, bottom and right  border-top-style, border-left-color, … 4

 border : shorthand rule for setting border properties at once: is equal to writing:  Specify different borders for the sides via shorthand rules: border-top, border-left, border-right, border-bottom  When to avoid border:0 5 border: 1px solid red border-width:1px;border-color:red;border-style:solid;

Live Demo border-rules.html

 Defines an image to be used instead of the normal border of an element  Split up into a couple of properties  Example:  The border-image property has 3 parts:  More detailed description:  border-image/ border-image/ border-image/ 7 border-image: url(border-image.png) 25% repeat;

Live Demo

9

 Rounded corners are actually a part of CSS 3  Supported in all major browsers  Firefox, IE 9, Chrome, Opera and Safari  Done by the border-radius property  Three ways to define corner radius: border-radius: [ | ][ | ]? border-radius: 15px; border-radius: 15px 20px; border-radius: 15px 15px 15px 10px;

Live Demo

 overflow : defines the behavior of element when content needs more space than you have specified by the size properties or for other reasons. Values:  visible (default) – content spills out of the element  auto - show scrollbars if needed  scroll – always show scrollbars  hidden – any content that cannot fit is clipped 13

Live Demo overflow-rule.html

15

 margin and padding define the spacing around the element  Numerical value, e.g. 10px or -5px  Can be defined for each of the four sides separately - margin-top, padding-left, …  margin is the spacing outside of the border  padding is the spacing between the border and the content  What are collapsing margins? 16

 margin: 5px ;  Sets all four sides to have margin of 5 px;  margin: 10px 20px;  top and bottom to 10px, left and right to 20px ;  margin: 5px 3px 8px;  top 5px, left/right 3px, bottom 8px  margin: 1px 3px 5px 7px;  top, right, bottom, left (clockwise from top)  Same for padding 17

18 Margin Border Padding Content

Live Demo margins-paddings-rules.html

 Determine whether you want an element to render it's borders and padding within its specified width, or outside of it.  Possible values:  box-sizing: content-box (default) box width: 288 pixels + 10 pixels padding and 1 pixel border on each side = 300 pixels  box-sizing: border-box box width: 300 pixels, including padding and borders 20

 Example: Box with total width of 300 px (including paddings and borders) 21 width: 300px; border: 1px solid black; padding: 5px; /* Firefox */ -moz-box-sizing: border-box; /* WebKit */ -webkit-box-sizing: border-box; /* Opera 9.5+, Google Chrome */ box-sizing: border-box;

 The flexible box model determines the way boxes are distributed inside other boxes and the way they share the available space.  New values for "display" property:  flexbox  inline-flexbox  This box model is still under development  Still not supported in major browsers 22

 flex-direction  Specifies how flexbox items are placed  flex-order  May be used to change the ordering of the elements. Elements are sorted by this value.  flex-pack  Defines the flexibility of packing spaces  flex-align  Changes the way free space is allocated 23

 The flex-direction property specifies how flexbox items are placed in the flexbox.  Possible values:  lr – Displays elements from left to right  rl – Displays elements from right to left  tb – Displays elements from top to bottom  bt – Displays elements from bottom to top  inline and inline-reverse  block and block-reverse 24

Live Demo flexible-box-model.html & box-sizing.html

 width – defines numerical value for the width of element, e.g. 200px  height – defines numerical value for the height of element, e.g. 100px  By default the height of an element is defined by its content  Inline elements do not apply height, unless you change their display style 27

Live Demo size-rules.html

For Ordered and Unordered Lists

 List properties are used to define the look and feel of the list items  Mainly to change the list item marker  Normal styles:  List-style-type  Values for : circle, square,…  Values for : upper-roman, lower-alpha  Values for both: none ul { list-style-type:none; } list-style-type:none; }

Live Demo 31

 We can set a image for the bullets of a list  With the property list-style-image  Does not work equally good for all browsers  IE puts less space between the bullet and the content  Shorthand property ul { list-style-image: url('images/blue-dot.jpg'); list-style-image: url('images/blue-dot.jpg');} ul { list-style: bullet url('images/blue-dot.jpg'); list-style: bullet url('images/blue-dot.jpg');}

 We can place a background in the left-most  It looks like a image-bullet ul{ list-style-type: none; list-style-type: none; padding: 0px; padding: 0px; margin: 0px; margin: 0px;}li{ background-image: url("images/blue-dot.png"); background-image: url("images/blue-dot.png"); background-repeat: no-repeat; background-repeat: no-repeat; background-position: 0px 5px; background-position: 0px 5px; padding-left: 14px; padding-left: 14px;}

Live Demo

In 5 minutes

 What is inside a navigation?  Some buttons that are arranged from right to left  Or top to bottom  We need to make it extensible  Create a list  Adding new nav item is easy  No worries when disabling the styles

37 ul.menu{ list-style-type: none; list-style-type: none; padding: 0px; padding: 0px; margin: 0px; margin: 0px;}li.menu-item{ float: left; float: left; margin: 10px; margin: 10px;} Menu-example

Live Demo

39

 cursor : specifies the look of the mouse cursor when placed over the element  Values: crosshair, help, pointer, progress, move, hair, col-resize, row- resize, text, wait, copy, drop, and others  white-space – controls the line breaking of text. Value is one of:  nowrap – keeps the text on one line  normal (default) – browser decides whether to brake the lines if needed 40

Questions? schoolacademy.telerik.com

42 1. Add a border to all the exercises from the previous presentation (CSS Overview)

43 2. Implement the following video player  Use tables for the layout  List tags for the playlist items and the controls

3. Create a web page that looks like the Windows calculator in Programmer view  It should look exactly the same  Implement hover effects for the buttons  The calculator should not have any functionality 44

45 4. Implement the following with using tables for the layout and CSS for the styles