JWD_Unit 4_Using CSS for Web Designing_PPT

Embed Size (px)

Citation preview

  • 7/27/2019 JWD_Unit 4_Using CSS for Web Designing_PPT

    1/16

  • 7/27/2019 JWD_Unit 4_Using CSS for Web Designing_PPT

    2/16

    C o n f i d e n t i a l

    2

    Using CSS for Web Designing

    HOME NEXTPREVIOUS

    Unit-4 Using CSS for Web Designing

    Objectives :

    To explain why CSS is useful.

    To analyse the working of CSS.

    To use CSS for organising content on Web pages.

    To create Web page layout with CSS.

  • 7/27/2019 JWD_Unit 4_Using CSS for Web Designing_PPT

    3/16

    C o n f i d e n t i a l

    3

    Lecture Outline

    Introduction

    Cascading Style Sheets (CSS)

    Benefits of CSS

    Working with CSS

    Methods of Applying Style

    Web Page Editing with CSS

    Formatting the Text

    Using Colours with CSS

    Positioning Elements with CSS

    Page Layout with CSS Summary

    Check Your Learning

    Activity

    HOME NEXTPREVIOUS

    Unit-4 Using CSS for Web Designing

  • 7/27/2019 JWD_Unit 4_Using CSS for Web Designing_PPT

    4/16

    C o n f i d e n t i a l

    4

    Introduction

    HOME NEXTPREVIOUS

    The World Wide Web Consortium (W3C) released the first official

    recommendation for CSS1 (Cascading Style Sheet 1) in 1996.

    CSS1 is also known as core CSS.

    CSS2 and CSS3 could not replace CSS1 but acts as supplements.

    In this session, we will learn the benefits of CSS, and also the techniques

    of formatting a Web page using CSS.

    Unit-4 Using CSS for Web Designing

  • 7/27/2019 JWD_Unit 4_Using CSS for Web Designing_PPT

    5/16

    C o n f i d e n t i a l

    5

    Cascading Style Sheets (CSS)

    HOME NEXTPREVIOUS

    CSS helps in the presentation of content on the Web page.

    It is a set of guidelines and properties defining the appearance of Web

    page, on a Web browser.

    It is possible to control the font colour, size and various other design

    aspects on a Web page, using CSS.

    Unit-4 Using CSS for Web Designing

  • 7/27/2019 JWD_Unit 4_Using CSS for Web Designing_PPT

    6/16

    C o n f i d e n t i a l

    6

    Benefits of CSS

    HOME NEXTPREVIOUS

    Unit-4 Using CSS for Web Designing

    Savestime

    Reducesuseof JavaScript

    Reducesdownload time

    Reduces code

    complexity

    Separates content

    from presentation

    Benefits

  • 7/27/2019 JWD_Unit 4_Using CSS for Web Designing_PPT

    7/16C o n f i d e n t i a l

    7

    Working with CSS

    HOME NEXTPREVIOUS

    Unit-4 Using CSS for Web Designing

    To work with CSS the following points has to be considered:

    Define a set of rules in the style sheet.

    Establish a link between content in HTML document and style sheet.

    Browser then applies style defined in CSS to the content and displays it

    on Web page.

    Basic syntax of CSS: selector {property: value;}

  • 7/27/2019 JWD_Unit 4_Using CSS for Web Designing_PPT

    8/16C o n f i d e n t i a l

    8

    Methods of Applying Style

    HOME NEXTPREVIOUS

    Unit-4 Using CSS for Web Designing

    Example

    This is a red page

    Example

    body {background-color: #FF0000;}

    My document

    Inline method:

    Internal method:

    Link to stylesheet:

  • 7/27/2019 JWD_Unit 4_Using CSS for Web Designing_PPT

    9/16C o n f i d e n t i a l

    9

    Web Page Editing with CSS

    HOME NEXTPREVIOUS

    Unit-4 Using CSS for Web Designing

    CSS class selector: It specifies style for a group of HTML elements.

    .center{ text-align:center;}

    Center-aligned heading

    Center-aligned

    paragraph.

  • 7/27/2019 JWD_Unit 4_Using CSS for Web Designing_PPT

    10/16C o n f i d e n t i a l

    10

    Formatting the Text

    HOME NEXTPREVIOUS

    Unit-4 Using CSS for Web Designing

    Text indention p.align {text-indent: 30px;}

    Text alignment p.aligntext { text-align: centre}

    Text decoration .decoration {text-decoration: underline;}

    Letter space p.spacing{ letter-spacing: 3px;}

    Text transformation .transform { text-transform: uppercase;}

    Margins .fixmargin{ margin-top: 100px;

    margin-right: 40px;

    margin-bottom: 10px;

    margin-left: 70px;}

  • 7/27/2019 JWD_Unit 4_Using CSS for Web Designing_PPT

    11/16C o n f i d e n t i a l

    11

    Using Colours with CSS

    HOME NEXTPREVIOUS

    Unit-4 Using CSS for Web Designing

    Colour property .redcolour{color:red;}

    Background colour

    body { background-color: grey;}

    h1 { background-color: blue;}

    p { background-color: green;}

  • 7/27/2019 JWD_Unit 4_Using CSS for Web Designing_PPT

    12/16C o n f i d e n t i a l

    12

    Positioning Elements with CSS

    HOME NEXTPREVIOUS

    Unit-4 Using CSS for Web Designing

    Absolute positioning p { position:absolute;

    left:100px;

    top:150px;}

    Relative positioning h1{position:relative;

    left: 350px;

    top: 150px;}

    h2{position:relative;

    left: 150px;

    top: 150px;}

    h3{position:relative;left: 50px;

    top: 150px;}

  • 7/27/2019 JWD_Unit 4_Using CSS for Web Designing_PPT

    13/16

  • 7/27/2019 JWD_Unit 4_Using CSS for Web Designing_PPT

    14/16

  • 7/27/2019 JWD_Unit 4_Using CSS for Web Designing_PPT

    15/16C o n f i d e n t i a l

    15

    Check Your Learning

    1. What is CSS?

    Ans. CSS is a set of guidelines and properties defining the appearance of

    Web page on a Web browser.

    2. List any three benefits of CSS.

    Ans. The three benefits of CSS are: it reduces download time, separates

    content from presentation, and saves time.

    3. Write the code to add a blue background colour to your Web page.Ans. body { background-color: blue;}

    HOME NEXTPREVIOUS

    Unit-4 Using CSS for Web Designing

  • 7/27/2019 JWD_Unit 4_Using CSS for Web Designing_PPT

    16/16C o n f i d e n t i a l

    16

    Activity

    1. Search on Web, and find out why many designers prefer CSS layout

    over HTML table layout.

    HOMEPREVIOUS

    Unit-4 Using CSS for Web Designing