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.

Slides:



Advertisements
Similar presentations
Client-Side Internet and Web Programming
Advertisements

กระบวนวิชา 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.
Cascading Style Sheets Color and Background Controls Border and Margin Controls (Boxes)
CSS Nael Alian div.ex { width:220px; padding:10px; border:5px solid gray; margin:0px; } The line above is 250px wide. The.
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.
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.
方框的CSS樣式.
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.
1 Lesson Style Sheets Box Model Content (text,image,table) Margin Padding Border Box.
Cascading Style Sheets Part 3 Fall, 2007 Modified by Linda Kenney Nov. 12, 2007.
CSS Box Model margin border padding content 23. Box Model Properties PropertyValid valuesExample border-widththin, medium, thick, numberborder-width:
MORE Cascading Style Sheets (The Positioning Model)
4.01 Cascading Style Sheets
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.
1 CS428 Web Engineering Lecture 10 Images, Tables, Forms, Border-Radius (CSS – V)
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".
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.
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.
 This presentation introduces the following: › 3 types of CSS › CSS syntax › CSS comments › CSS and color › The box model.
CSS Border.
Css ( CASCADING STYLE SHEETs ) CSS Box Model. All HTML elements can be considered as boxes. In CSS, the term "box model" is used when talking about design.
INTRODUCTION TO WEB DEVELOPMENT AND HTML Lecture 10: A Deeper Look at CCS- Spring 2011.
COMP213 – Web Interface Design
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.
Creating Your Own Webpage COSC Cascading Stylesheets Think of: HTML: content of your webpage HTML has tags CSS: presentation and appearance of your.
Cascading Style Sheets Chapters 5-6 Color and Background Controls Border and Margin Controls.
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.
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.
11/12/2015 Box Model Reed Crouch. 11/12/2015  HTML elements can be considered as boxes. In CSS, the term "box model" is used when referring to layout.
Table Styling. Using CSS to Style Tables: So far, our table styling - such has "width" and "border" - has not used CSS. CSS provides us with many tools.
آموزش طراحی وب سایت جلسه پنجم– سی اس اس 2 تدریس طراحی وب برای اطلاعات بیشتر تماس بگیرید تاو شماره تماس: پست الکترونیک :
CONTROLLING Page layout
Extra-simplified.  Only truly happen when the CSS and HTML are defined as separate files (external style sheet) Introduction The main idea of CSS is.
Department of Computer Science, Florida State University CGS 3066: Web Programming and Design Spring 2016 CSS Positioning 1.
Doncho Minkov Telerik School Academy schoolacademy.telerik.com Technical Trainer
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 Table Styling. Up to this point, as we haven't applied any CSS styling to our tables, our example tables have not been too pleasing to the eye. CSS.
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,
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 Box Model.
4.01 Cascading Style Sheets
( Cascading style sheet )
Table Styling.
Table Styling.
Google fonts CSS box model
Table Styling.
CS1220 Web Programming Saloni Chacha.
>> The “Box” Model
Box model.
Table CSS Create a new CSS called tablestyle.CSS Green Background
The Internet 10/13/11 The Box Model
CSS Borders and Margins.
CSS Box Model.
CSS and Class Tools.
4.01 Cascading Style Sheets
CSS Box Model.
CSS Box Model.
Presentation transcript:

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 specifies a black border for table, th, and td elements

Table Borders table, td, th { border:1px solid black; border-collapse:collapse } Firstname Lastname Bader Ali Paul Manuel The table in the previous example has double borders. Why? To display a single border for the table, use the border-collapse property.

Table Width and Height table,td,th { border:1px solid black; } table { width:100%; height:150px; } th { height:75px; } Firstname Lastname Bader Ali Paul Manuel

Table – Text alignment table,td,th { border:1px solid black; } td { width: 100px; height:100px; text-align:right; } Name Saving Bader 100 Paul 300

Table colors table,td,th { border:1px solid green; } th { background-color:green; color:white; } Firstname Lastname Bader Ali Paul Manuel

Box Model

The CSS Box Model All HTML elements can be considered as boxes. In CSS, the term "box model" is used when talking about design and layout. The CSS box model is essentially a box that wraps around HTML elements, and it consists of: margins, borders, padding, and the actual content.

CSS box model Explanation of the different parts: Margin - Clears an area around the border. The margin does not have a background color, it is completely transparent Border - A border that goes around the padding and content. The border is affected by the background color of the box Padding - Clears an area around the content. The padding is affected by the background color of the box Content - The content of the box, where text and images appear

CSS Box Model div.ex { margin:10px; border:3px solid gray; padding:7px; width:200px; } ISC 340 Web Programming ISC 340 web Programming 200px 7px 3px grey color 10px What is the total width of the box? NOTE: you can specify the height of The box also.

CSS Border

Border p{ border-style: dotted } /* dashed, solid, double, groove, ridge, inset, outset */ p{ border-color: yellow green red blue} /* top –yellow; right – green; bottom – red; left – blue */ p{ border-width: 10px 20px 30px 40px } /*top – 10px; right – 20 px; bottom – 30 px; left – 40px **NOTE**: None of the border properties will have ANY effect unless the border- style property is set!

Border - Individual sides /* Setting the style for the top border only */ /* border-right, border-bottom, border-left */ p{ border-top-color: yellow } /* green, blue */ p{ border-top-width: 50px } /* 50cm */ What is missing in the above CSS rules?

All Borders Together - short notation h1{border: 50px solid red} /* width, style, color */ This is head This is head

border-bottom Together – short notation ( border-top, border-right, border-left ) h1{border-bottom: 50px solid red} /* width, style, color*/ This is head This is head

CSS Margin

Margin-Individual sides margin-top:100px; margin-bottom:100px; margin-right:2cm; margin-left:2cm; NOTE: It is possible to use negative values, to overlap content.

Margin Together – Shorthand h1{margin: 2cm 3cm 20cm 5cm} //top, right, bottom, left This is head

CSS Padding

Padding-Individual sides padding-top:25px; padding-bottom:25px; padding-right:50px; padding-left:50px; The padding clears an area around the content (inside the border) of an element.

Padding Together – Shorthand td {padding:20px 30px 40px 50px;} //top, right, bottom, left