CSS to Know And this is just the beginning. What to What?  Tags = regular HTML  Ids = #id, only one hashtag per page  Class =.class, many as you want.

Slides:



Advertisements
Similar presentations
1 Cascading Style Sheets Continued Different kinds of selectors in a style sheet –Simple- Pseudo-Class –Contextual- Pseudo-Element –Class Image Styles.
Advertisements

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.
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)
Tutorial 4: Creating page layout with css
CSS Color & Text Cascading Style Sheets. Advantages of CSS Typography and page layout can be better controlled Style is separate from structure Documents.
CS4370/6370 Web Development Cascading Style Sheets (CSS)
Basics of Web Design Chapter 6 More CSS Basics Key Concepts 1.
Text Properties, Line Box, CSS. Text Properties Properties related to the display of text. Text-align : left, right, center I like FSU!
Web Design & Development Cascading Style Sheets (CSS)
TUTORIAL 4: CREATING PAGE LAYOUT WITH CSS Session 4.3.
1 Cascading Style Sheets C S S. 2 What is CSS? A simple mechanism for controlling the style of a Web document without compromising its structure. It allows.
Style sheets can also affect the BODY. style4.css BODY {BACKGROUND-COLOR : white} H1 {COLOR : red; FONT-SIZE : 50; FONT-FAMILY : arial} H2 {COLOR : green}
MORE Cascading Style Sheets (The Positioning Model)
Style sheets can also affect the body. style4.css body {background-color : white} h1 {color : red; font-size : 50; font-family : arial} h2 {color : green}
Lecture CSS: Cascading Style Sheets. What are Styles? Cascading Style Sheets (CSS) is a style sheet language used to describe the presentation semantics.
1 CS428 Web Engineering Lecture 10 Images, Tables, Forms, Border-Radius (CSS – V)
Cascading Style Sheets Example
CSS Dvijesh Bhatt.
LING 408/508: Programming for Linguists
Chapter 7 Web Typography Principles of Web Design, 4 th Edition.
1Computer Sciences Department. And use
Cascading Style Sheets CSS. CSS - Structure Declaration block Property: identifies what to change Value: how to change it Selector – example h1{ font-size:
WORKING WITH CASCADING
New Perspectives on XML, 2nd Edition Tutorial 5 1 TUTORIAL 5 WORKING WITH CASCADING STYLE SHEETS.
1 To Create an Internal Style Sheet 1. At the top of your HTML document, between the and tags type. 2. Type the name of the tag whose properties you wish.
XP New Perspectives on XML Tutorial 5 1 TUTORIAL 5 CSS Tutorial – Carey ISBN
11/6/13 MORE CSS!. TODAY’S AGENDA Review: float for positioning objects Review: CSS and color Introductions to: o CSS and images o CSS backgrounds o CSS.
CHAPTER 3 CSS & CSS3 อ. ยืนยง กันทะเนตร คณะเทคโนโลยีสารสนเทศและการสื่อสาร มหาวิทยาลัยพะเยา 1.
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.
COMP213 – Web Interface Design
LITTLE BOXES Controlling size of boxes Box model for borders, margin and padding Displaying and hiding boxes.
Web sites Design: Cascading Style Sheet (CSS) (Cont’d) Dimensions and Position of Elements –Width and Height Space –Table Cell Padding –Left and Top Position.
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.
Basics of Web Design Chapter 6 More CSS Basics Key Concepts.
 2008 Pearson Education, Inc. All rights reserved Cascading Style Sheets™ (CSS)
 2008 Pearson Education, Inc. All rights reserved Cascading Style Sheets™ (CSS)
Today’s Agenda Advanced CSS Techniques Floating Z-index Centering Sliding Doors Fluid Layouts CSS3 Advanced CSS Lab Mini Project #2.
Cascading Style Sheets Chapters 5-6 Color and Background Controls Border and Margin Controls.
CSS WORKSHOP Design Principles for Web Standards.
CSS Layout Arrangement and Positioning of the HTML Elements Svetlin Nakov Technical Trainer Software University
>> 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.
Week 8 – Part 2 Page Layout Basics Key Concepts 1.
1 Web Development CSS (Cascading Style Sheet). 2 1.Setting rules for multiple elements To decrease the amount of typing for setting rules for multiple.
LING 408/508: Programming for Linguists Lecture 10 September 30 th.
Cascading Style Sheets Positioning Controls Visibility.
CIS234A Lecture 5 Instructor Greg D’Andrea. Font Styles Review Font-Family: generic family, font family Font-Size: em, pt, px, %, mm, cm, in Font-Style:
3.2 Cascading Style Sheets. 2 Positioning Elements Normally, elements are laid out on the page in the order that they are defined in the XHTML document.
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.
Cascading Style Sheets Positioning Controls Visibility.
Tutorial 4 Creating Page Layouts with CSS
CSS: Cascading Style Sheets Part II. Style Syntax.
Understanding CSS Cascading Style Sheets control the presentation of content in HTML pages Style Sheets separate formatting from the content –Styles defined.
PERSPECTIVES: TUTORIAL 4 CREATING PAGE LAYOUTS WITH CSS.
Chapter 7.  Change body and link styles  Create a drop-down menu  Change color and font styles in the menu  Create a pop-up effect using CSS  Utilize.
CS 120: Introduction to Web Programming Lecture 10: Extra Features and Website Design Part 1 Tarik Booker CS 120 California State University, Los Angeles.
Internet & World Wide Web How to Program, 5/e Copyright © Pearson, Inc All Rights Reserved.
1 CS428 Web Engineering Lecture 07 Font, Text & Background (CSS - II)
HTML & CSS Contents: the different ways we can use to apply CSS to The HTML documents CSS Colors and Background CSS Fonts CSS Text CSS box model: padding,
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.
Mimi Opkins.  One of the major benefits of using CSS is that you’re not forced to lay your sites out in tables.  The layout possibilities of CSS give.
Laying out Elements with CSS
Cascading Style Sheets
>> The “Box” Model
Cascading Style Sheets
MORE Cascading Style Sheets (The Positioning Model)
Cascading Style Sheets
Cascading Style Sheets
Presentation transcript:

CSS to Know And this is just the beginning

What to What?  Tags = regular HTML  Ids = #id, only one hashtag per page  Class =.class, many as you want  Priorities?  Child priority over parent  Ids/classes priority over tags

Tags, Classes, IDs

Parents & Children

Display  Display: block;  Display: inline;  Display: inline-block;  Display: none;  Display: inline-table;

display: block;  One element per “line”  Default blocks  paragraphs  H-tags (eg. )  Lists  Can apply (almost) any style  Cannot easily align

display: inline;  Runs on in one line  Default inline   Cannot alter  Top/bottom padding  Top/bottom margin

display: inline-block;  Combines block and inline properties  Default inline-block? None  Can apply any style, except alignment  Also reference “float”

display: none;  Do not display anything  Commonly used to hide elements while keeping them on the page

display: table/inline-table;  The greatest thing ever  Treats block/inline block elements like regular inline/table elements  (solves alignment issues)

Floats

Position position: static; position: absolute; position: relative; position: fixed; position: inherit; top left right bottom z-index

 Determines what is on top of what  Default, later elements stacked on top

position: static;  Occurs in the order it appears in the doc  Default for everything  You’ll probably never use it (just saying)  Has “mass”  (aka, affects the position of the rest of the elements in the doc which also “have mass” on the same z-index)

position: relative;  Set position based on where it occurs in the doc  Original location maintains mass  Where ever you move it will not  Aka, you get a giant empty space if you move it

position: absolute;  Absolute position based on whatever parent is not static  Position with: top/left/right/bottom  Has no mass  Pushed to a higher z-index, but does not necessarily influence by other elements in that index

position: fixed;  A set, unchanging location based on the screen.  Location does not change with scrolling  Has “no mass”

Alignment Inline alignment text-align: right; text-align: left; text-align: center; margin: 0 auto; Block alignment vertical-align: top; vertical-align: middle; vertical-align: bottom; vertical-align: baseline; (and more) Center blocks,

Backgrounds  Regular (background: #ffffff;)  Gradient  Patterns  Images at specific coordinates  Opacity (transparent) backgrounds?

Gradient background  Need a webkit  Also, it is okay to use a generator like this: 

Patterns & Images  Patterns: repeat-x repeat-y repeat no-repeat  Full Images:  Vertical-alignment  Horizontal- alignment  Does it move with the doc?  Size

Opacity Backgrounds? Method 1  Make a wrapper around element  Set background & opacity of wrapper  Set element opacity: 1; Method 2  Make tiny pixel png  Set pattern background for the element

Borders border: (thickness) (color) (type); ** border-radius, to round the corners

Text-shadow / Box-shadow text-shadow, same but no spread distance box-shadow also has inset option

Size & Scrolling Pixel (px) *100px/inch Percentage (%) Computed font-size (em) overflow overflow-x overflow-y width max-width min-width height max-height min-height

Anchor Tag a = How link normally looks ** Default style overrides parent a:hover = How looks when cursor over it a:visited = How looks when clicked on and back on original page ** If change a, do not need to set

Other Things padding: (top) (right) (bottom) (left); Warning: padding adds to width/height margin: (top) (right) (bottom) (left); border-radius: (top-left) (top-right) (bottom- right) (bottom-left); 2 nd -4 th value is optional

Inline/text attributes font-family font-size font-weight (think bold) font-style (underline, italic) etc. line-spacing (think margin) line-height (think padding)

CSS Tricks  