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,

Slides:



Advertisements
Similar presentations
กระบวนวิชา 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.
Advertisements

Cascading Style Sheets Color and Background Controls Border and Margin Controls (Boxes)
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.
Stylin’ with CSS. 2 Topics What is CSS? Why CSS? CSS Examples.
CS4370/6370 Web Development Cascading Style Sheets (CSS)
CASCADING STYLE SHEETS CSS. 2 What CSS means?  CSS is an extension to basic HTML that allows you to style your web pages.  It separates the part that.
Cascading Style Sheets SP.772 May 6, CSS Useful for creating one unified look for an entire web site. Helps to seperate style from content. Can.
Web Design & Development Cascading Style Sheets (CSS)
CSE CASCADING STYLE SHEETS CSS Faculty of Computer Science and Engineering.
4.01 Cascading Style Sheets
Lecture CSS: Cascading Style Sheets. What are Styles? Cascading Style Sheets (CSS) is a style sheet language used to describe the presentation semantics.
Selectors thru Borders. CSS – Cascading Style Sheets – is a way to style HTML HTML is the content base of a web page CSS provides the presentation qualities.
IMAGES Controlling size of images in CSS Aligning images in CSS Adding background images.
Cascading Style Sheets CS3505. What are CSS? Method for adding style attributes consistently to HML tags Cascading because styles are applied in order.
Cascading Style Sheets Billy Toy Cascading Style Sheets Syntax review How to Implement style sheets Background properties Text properties.
CSS Dvijesh Bhatt.
HTML - Quiz #2 Attendance CODE:
Cascading style sheets (CSS)
Cascading Style Sheets CSS. CSS - Structure Declaration block Property: identifies what to change Value: how to change it Selector – example h1{ font-size:
WRT235: Writing in Electronic Environments CSS Backgrounds, colors, fonts.
CSS in XHTML continued Please use speaker notes for additional information!
Doman’s Sections Information in this presentation includes text and images from
MCS 270 Cascading Style Sheets (CSS) Gustavus Adolphus College.
CSS: Cascading Style Sheets. 2 What are Style Sheets A style sheet is a mechanism that allows to specify how HTML (/XHTML/XML) pages should look The style.
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.
CIS 1315 – Web Development for Educators CIS 1315 HTML Tutorials 3 & 4: Working With CSS.
CSS My favourite ICT lesson By Federico Boschi Cascading Style Sheets.
FTS: The Perils and Promise of Computing Cascading Style Sheets (CSS) Gustavus Adolphus College Fall 2012.
Just A Few More Fun Objectives 1 Having Some Fun With Java Script 2 Using Style Sheets.
Cascading Style Sheets Chapter Four. What are they? A set of style rules that tell the web browser how to present a web page or document. Cascading Style.
Tutorial #3 Cascading Style Sheets. Tutorial #2 Review - Anchors Links to Site DMACC Internal Links Go to Top Mail To me Local.
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.
Cascading Style Sheets in.NET Lilian Kiilu, Client/Server & Web Applications, Coms 463/563, Section 1pm, Fall 2005, November 16 th 2005.
Introduction to CSS. What is CSS?  Cascading Style Sheets  Used for styling HTML  Also important in javascript and jquery for selectors  External.
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.
Cascade Style Sheet Introduction. What is CSS?  CSS stands for Cascading Style Sheets  Styles define how to display HTML elements  Styles were added.
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.
Web Design and Development for Business Lecture 4 Cascading Style Sheet (CSS)
 2008 Pearson Education, Inc. All rights reserved Cascading Style Sheets™ (CSS)
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.
>> 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.
Colors and backgrounds The following CSS properties will be explained: 1.color 2.background-color 3.background-image 4.background-repeat 5.background-attachment.
So far, we have looked at CSS selectors that correlate with HTML tags Now, we’ll see how you can define your own selectors using class and ID selectors.
DIV, Span, CSS.
CSS with XHTML Please use speaker notes for additional information!
Cascading Style Sheets (CSS). A style sheet is a document which describes the presentation semantics of a document written in a mark-up language such.
XP Review 2 New Perspectives on JavaScript, Comprehensive1 Introducing Cascading Style Sheets Formatting Web Pages with CSS.
REEM ALMOTIRI Information Technology Department Majmaah University.
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:
Colors and backgrounds The following CSS properties will be explained: 1.color 2.background-color 3.background-image 4.background-repeat 5.background-position.
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.
Microsoft Expression Web-Illustrated Unit F: Enhancing a Design with CSS.
CSS – Cascading Style Sheets
تقنيات الإنترنت وبرمجة الويب “ العملي “ أ. غادة الرواشدة 1 CSS Cascading Style Sheets.
5 th ed: Chapter 4 4 th ed: Chapter 5 SY306 Web and Databases for Cyber Operations Slide Set #4: CSS.
Web Technologies Beginning Cascading Style Sheets (CSS) 1Copyright © Texas Education Agency, All rights reserved.
5 th ed: Chapter 4 4 th ed: Chapter 5 SY306 Web and Databases for Cyber Operations SlideSet #5: Advanced CSS.
Web Technology (NCS-504) Prepared By Mr. Abhishek Kesharwani Assistant Professor,UCER Naini,Allahabad.
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.
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.
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)
Welcome To Website Design, Hosting And Management Prepared By Webdev Solution ip ,223,96.
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 Introductions. Objectives To take control of the appearance of a Web site by creating style sheets. To use a style sheet to give all the pages of.
Presentation transcript:

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, margin,Borders Height and width Floating elements (floats) Positioning of elements Web page layout using elements HTML- lec 5 T.A. Reem Alshnaifi17-Feb-13

HTML & CSS CSS can be added to HTML in the following ways: Inline - using the style attribute in HTML elements Internal - using the element in the section External - using an external CSS file CSS (Cascading Style Sheets) is used to style HTML elements.

CSS Example This is a heading This is a paragraph. Inline Styles

CSS Example body {background-color:#d0e4fe;} h1 {background-color:red;} p {background-color:green;} CSS example! This is a paragraph. Internal Style Sheet

An external style sheet is ideal when the style is applied to many pages. With an external style sheet, you can change the look of an entire Web site by changing one file. Each page must link to the style sheet using the tag. The tag goes inside the section External Style Sheet

CSS Example External Style Sheet

CSS Example CSS example! This is a paragraph. External Style Sheet body {background-color:#d0e4fe;} h1 {background-color:red;} p {background-color:green;} mystyle.css

CSS Colors and Background CSS Colors Property : 1.Colors CSS Background Properties: 1.background-color 2.background-image 3.background-repeat 4.background-attachment 5.background-position

CSS Colors and Background welcome to baby's shop Here you can find all your child's needs Index.html

CSS Colors and Background body { background-color: #FFCC66; background-image: url("butterfly.gif"); background-repeat: no-repeat; background-attachment: fixed; background-position: right bottom; } h1 { color: #990000; background-color: #FC9804; } Style.css body { background: #FFCC66 url("butterfly.gif") no-repeat fixed right bottom; } Can be compiled into:

Repeat background image [background-repeat] ValueDescription background-repeat: repeat-x The image is repeated horizontally background-repeat: repeat-yThe image is repeated vertically background-repeat: repeat The image is repeated both horizontally and vertically background-repeat: no-repeatThe image is not repeated

[background-attachment] ValueDescription Background-attachment:scroll he background image scrolls with the rest of the page. This is default Background-attachment: fixedThe background image is fixed

Place background image [background-position]

CSS Fonts CSS Font Properties: font-family font-style font-weight font-size

CSS Fonts. p { font-style: italic; font-weight: bold; font-size: 30px; font-family: arial; } Style.css

CSS Text CSS Text Properties: text-align Center, right, left text-decoration : Underline, overline, line-through,none

CSS box model The box model in CSS describes the boxes which are being generated for HTML-elements. The box model also contains detailed options regarding adjusting margin, border, padding and content for each element

CSS box model

Article 1: All human beings are born free and equal in dignity and rights. They are endowed with reason and conscience and should act towards one another in a spirit of brotherhood Example

CSS box model By adding some color and font-information the example could be presented as follows: Result

CSS box model The example contains two elements: and. The box model for the two elements can be illustrated as follows:

CSS box model The properties which regulate the different boxes are: padding, margin and border Set the margin in an element An element has four sides: right, left, top and bottom. The margin is the distance from each side to the neighboring element (or the borders of the document)

CSS box model the margin in an element As the first example, we will look at how you define margins for the document itself i.e. for the element body { margin-top: 100px; margin-right: 40px; margin-bottom: 10px; margin-left: 70px; } CSS Code body { margin: 100px 40px 10px 70px; } Can be compiled into:

CSS box model the margin in an element You can set the margins in the same way on almost every element. For example, we can choose to define margins for all of our text paragraphs marked with : p { margin: 5px 50px 5px 50px; } CSS Code

CSS box model Set padding in an element: padding does not affect the distance of the element to other elements but only defines the inner distance between the border and the content of the element. h1 { background: yellow; padding: 20px 20px 20px 80px; } CSS Code

CSS Borders CSS Borders Properties: border-width border-color border-style P { border-width: 1px; border-style: solid; border-color: blue; } p { border: 1px solid blue; } Can be compiled into: CSS Code

border-style : CSS Borders

Height and width Setting the width and the height p{ height: 500px; width: 200px; border: 1px solid black; background: orange; } CSS Code

Floating elements (floats) An element can be floated to the right or to left by using the property float. That is to say that the box with its contents either floats to the right or to the left in a document

Floating elements (floats) If we for example would like to have a text wrapping around a picture, the result would be like this:

Floating elements (floats) How is it done? The HTML code for the example above, look as follows: img { float:left; width: 100px; } p { width: 400px; } CSS Code An element can be floated to the...

Positioning of elements With CSS positioning, you can place an element exactly where you want it on your page.

The principle behind CSS positioning: Imagine a browser window as a system of coordinates:

CSS positioning: Let's say we want to position a headline. By using the box model the headline will appear as follows: If we want this headline positioned 100px from the top of the document and 200px from the left of the document, we could type the following in our CSS: h1 { position:absolute; top: 100px; left: 200px;} CSS Code

CSS positioning: The result will be as follows:

HTML & CSS HTML Layouts: Web page layout using elements

Website Layouts This element uses separate opening and closing tags.... The tag can be used to divide an HTML document into sections. Styles can then be applied to whole sections at the same time. The tag is a block-level element that can contain other block-level elements

Website Layouts body{ margin : -20px 20px 10px 130px; background-color: # ; background-image: url("soon.jpg"); background-repeat:repeat; background-attachment:scroll; background-position: top left;} #container{width:1100px;} #header{ background-color:#CC9933; margin-bottom:-22px; color:#000000; text-align:center;}

Website Layouts #menu{background-color:#DEB887 ; height:555px; width:150px; float:left;} #content{ background-color:#ffffff; height:555px; width:950px; float:left;} #footer{ background-color:#CC9933; clear:both; text-align:center;}

Website Layouts Main Title of Web Page Menu HTML CSS JavaScript Content goes here Copyright © W3Schools.com

Website Layouts