11 Using CSS to Control Appearance Beginning ASP.NET 4.5.1 in C# and VB Chapter 3.

Slides:



Advertisements
Similar presentations
Intro to HTML. HTML HTML = HyperText Markup Language Used to define the content of a webpage HTML is made up of tags and attributes Content.
Advertisements

Introduction to HTML & CSS
CSS Cascading Style Sheets. Objectives Using Inline Styles Working with Selectors Using Embedded Styles Using an External Style Sheet Applying a Style.
Ideas to Layout Beginning web layout using Cascading Style Sheets (CSS). Basic ideas, practices, tools and resources for designing a tableless web site.
Cascading Style Sheets
Cascading Style Sheets: Basics I450 Technology Seminar Copyright 2003, Matt Hottell.
Cascading Style Sheets
Today CSS HTML A project.
HTML Overview - Cascading Style Sheets (CSS). Before We Begin Make a copy of one of your HTML file you have previously created Make a copy of one of your.
Project 8 Creating Style Sheets.
CSS. CSS, or Cascading Styles Sheets, is a way to style HTML. Whereas the HTML is the content, the style sheet is the presentation of that document.
Chapter 8 Creating Style Sheets.
Web Design with Cascading Style Sheet Lan Vu. Overview Introduction to CSS Designing CSS Using Visual Studio to create CSS Using template for web design.
Cascading Style Sheets. Slide 2 Lecture Overview Overview of Cascading Style Sheets (CSS) Ways to declare a CSS CSS formatting capabilities New features.
JMD2144 – Lesson 5 Web Design & New Media. ‘Div’ide and conquer One of the most versatile structure tags available is the.. tag Short for ision, it allows.
Working with Text and Cascading Style Sheets Adobe Dreamweaver Chapter 3.
Review HTML  What is HTML?  HTML is a language for describing web pages.  HTML stands for Hyper Text Markup Language  HTML is not a programming language,
Basics of HTML.
Cascading Style Sheet. What is CSS? CSS stands for Cascading Style Sheets. CSS are a series of instruction that specify how markup elements should appear.
© 2012 Adobe Systems Incorporated. All Rights Reserved. LEARNING THE LANGUAGE OF THE WEB INTRODUCTION TO HTML AND CSS.
Working with Cascading Style Sheets. Introducing Cascading Style Sheets Style sheets are files or forms that describe the layout and appearance of a document.
Cascading Style Sheets (CSS) Instructor: Mr. Ahmed Al Astal ITGD4104 Department Requirement for senior student University of Palestine Faculty of IT.
Online Chapter 1 4 th Edition.  Review elements  Whitespace handling  Rule structure  Linking to an external style sheet  Alternate Style Sheets.
STYLING THE WEBSITE - EXTERNAL CSS BY JORGE MARTINEZ.
 ult.htm ult.htm  This website illustrates the use of CCS (style sheets)
CSS Style Rules Guang Tong, Zhan L;lo’p[ Css Style Rule Guang Tong Zhan Three ways to insert CSS 1 External style sheet 2 Internal style sheet 3 Inline.
Cascading Style Sheets (CSS) 1.  What is CSS?  Why CSS?  How to write a CSS? 2.
Creating an Expression Web Site
Bare bones notes. Suggested organization for main folder. REQUIRED organization for the 115 folder.
Introduction To CSS.. HTML Review What is HTML used for? Give some examples of formatting tags in HTML? HTML is the most widely used language on the Web.
Cascading Style Sheets Orientation Learning Web Design: Chapter 11.
CSS CSS is short for C ascading S tyle S heets. It is a new web page layout method that has been added to HTML to give web developers more control over.
CSS Basic (cascading style sheets)
WRT235: Writing in Electronic Environments Basic CSS.
Bare bones slide show. The format is text files, with.htm or.html extension. Hard returns, tabs, and extra spaces are ignored. DO NOT use spaces in file.
Essentials of HTML Class 4 Instructor: Jeanne Hart
© 2011 Delmar, Cengage Learning Chapter 8 Using Styles and Design Style Sheets for Design.
Introduction to Cascading Style-sheets (CSS) Basharat Mahm ood, Department of Computer Science, CIIT,Islamabad, Pakistan 1.
Definition CSS “Short for Cascading Style Sheets, a new feature being added to HTML that gives both Web site developers and users more control over how.
INTRODUCTION TO CSS. TOPICS TO BE DISCUSSED……….  Introduction Introduction  Features of CSS Features of CSS  Creating Style Sheet Creating Style Sheet.
INT222 - Internet Fundamentals Shi, Yue (Sunny) Office: T2095 SENECA COLLEGE.
© 2011 Delmar, Cengage Learning Chapter 3 Working with Text and Cascading Style Sheets.
HTML GUIDE Press F5 and then Click on the links on the left to get to the section you want Section 1: Getting Started Section 2: Moving Banner Section.
LEARN THE QUICK AND EASY WAY! VISUAL QUICKSTART GUIDE HTML and CSS 8th Edition Chapter 8: Working with Style Sheets.
Cascading Style Sheets CSS. Source W3Schools
1 HTML Tables. 22 Objectives You will be able to Create tables in HTML.
IN THIS LESSON, WE WILL BECOME FAMILIAR WITH HTML AND BEGIN CREATING A WEB PAGE IN YOUR COMPUTER HTML – the foundation.
1111 Master Pages Beginning ASP.NET in C# and VB Chapter 6.
CSS IS A LANGUAGE DESIGNED TO TARGET HTML ELEMENTS AND NODES BY TYPE, CLASS, ID AND VALUE, AND CHANGE THEIR VALUES CSS – change how your HTML looks and.
Practice for Chapter 3: Assume that you are a freelance web designer and need to create a website to promote your freelance company.
Chapter 4 Frames and Cascading Style Sheets. Frames Frames divide a browser window into two or more separate pieces or panes, with each pane containing.
1 Cascading Style Sheet (CSS). 2 Cascading Style Sheets (CSS)  a style defines the appearance of a document element. o E.g., font size, font color etc…
CASCADING STYLE SHEET CSS. CSS stands for Cascading Style Sheets Styles define how to display HTML elements Styles were added to HTML 4.0 to solve a problem.
Building CSS in Visual Studio Slide 2 Introduction Using the different HTML (and other) Visual Studio Editors CSS tools.
Getting Started with CSS
Bare boned notes.
Bare bones notes.
INTRODUCTION TO HTML AND CSS
IS 360 Declaring CSS Styles
CX Introduction to Web Programming
Website Design 3
Cascading Style Sheets (Introduction)
Cascading Style Sheets (Introduction)
INTRODUCTION TO HTML AND CSS
Some Stuff You Need to Know
Bare bones notes.
Understand basic HTML and CSS terminology, concepts, and basic operations. Objective 3.01.
5.00 Apply procedures to organize content by using Dreamweaver. (22%)
Presentation transcript:

11 Using CSS to Control Appearance Beginning ASP.NET in C# and VB Chapter 3

2 Objectives You will be able to Use basic features of CSS (Cascading Style Sheets) to control the appearance of your web pages. 2

3 Using CSS Modern websites use CSS to specify layout and appearance of HTML pages Rather than HTML markup. There are three ways to add CSS Directly inside an HTML tag Embedded in the section of a page In a separate file Sharable by multiple HTML files

Download Example Create a directory for testing examples on your desktop. Download the Hello World page from the class web site into your test directory _Using_CSS File hello.html 003_Using_CSS Details on following slides. 4

Download Example 5 Right click on file name, hello.html Then select Save Link as...

Download Example In the Save As window, navigate to your test directory. 6 Click Save.

View hello.html Open your test directory. 7 Double click on hello.html to open the page in your default browser.

View hello.html 8 Open the file in Visual Studio. hello.html in Chrome

Open the file in Visual Studio. 9 Back in your test directory, right click on hello.html. Select “Open with”. Then select Microsoft Visual Studio

10 Add In-Line Style Attribute Save file. Note intellisense

11 Back in your test directory Double click on the file to open it in your default browser.

12 Page in Chrome

13 Style Rules in Tag Apply to everything inside the body. Additional rules can be added in enclosed HTML tags. Higher level rules can be overridden with additional CSS rules in enclosed elements. When there are differences the applicable rule is the one closest to the element. This is the meaning of cascading.

14 Style for a Save the file, then click the “Reload” button on the browser.

15 Page in Chrome Click here to reload the page.

Things to Notice about In-line Style Rules A style rule is a set of property-value pairs. Equal sign between the keyword style and the style rule definition. Each property-value pair is called a declaration. Declarations are separated by semicolons. The entire block of declarations is enclosed in quotation marks. 16

17 Embedded Style Rules CSS rules inside the HTML tags tend to clutter the page. Obscure the structure. Generally better to embed the style rules in the page head. Style rules in the head have to identify the elements to which they apply.

18 Embedded Style Rules Optional in HTML5

19 Embedded Style Rules Selector Declaration Block PropertyValue Declaration

20 Remove Inline Style Attributes Save the file, then click the “Reload” button on the browser.

21 Page with Embedded CSS Effect is the same.

Things to Notice about Embedded Styles Selector required to say what the style applies to Definition enclosed in curly brackets No quotation marks No equal sign Name and value still separated by colon Declarations still separated by semicolons 22

Things to Notice about Embedded Styles Style applies to all elements of the page with tags that match the selector. In line styles apply only to the element that they are enclosed in (including any elements nested within it.) In line styles have no need for a selector. 23

24 Style Sheet File We can clean up the HTML file even more by moving the CSS out to a separate file. CSS file can be used by multiple pages.

Create in Visual Studio File > New File 25

26 A CSS File Save As StyleSheet1.css in same directory as the html file. Cut and paste the embedded style rules.

Save StyleSheet in test directory 27

28 Link the CSS File Delete the embedded style sheet. Save the file and reload the page.

29 Page in Chrome Effect is the same. End of Section

More Content Open Call_me_Ishmael.txt file from Downloads area of class web site. Click on file name to open in browser. Copy content to hello.html inside a new 30

31 More Content Hello, World! Call me Ishmael. Some years ago--never mind how long precisely-- having little or no money in my purse, and nothing particular to interest me on shore, I thought I would sail about a little and see the watery part of the world. It is a way I have of driving off the spleen and regulating the circulation. Whenever I find myself growing grim about the mouth; whenever it is a damp, drizzly November in my soul; whenever I find myself involuntarily pausing before coffin warehouses, and bringing up the rear of every funeral I meet; and especially whenever my hypos get such an upper hand of me, that it requires a strong moral principle to prevent me from deliberately stepping into the street, and methodically knocking people's hats off--then, I account it high time to get to sea as soon as I can. This is my substitute for pistol and ball. With a philosophical flourish Cato throws himself upon his sword; I quietly take to the ship. There is nothing surprising in this. If they but knew it, almost all men in their degree, some time or other, cherish very nearly the same feelings towards the ocean with me.

32 Page in Chrome

33 CSS Classes Allow us to identify elements as belonging to named classes and specify different styling for each class. Class names are arbitrary. Don’t confuse these CSS classes with classes in object oriented programming languages. This is a different use of the word.

34 CSS Classes

35 CSS Classes The dots in front of Heading and Content say that these style rules apply to classes rather than tags.

36 Page in Chrome

37 Dividing Text into Columns Easy in HTML5. column-count:3 Currently requires vendor prefix for most browsers -webkit-Chrome and Safari -moz-Firefox -ms-Internet Explorer -o-Opera

38 Specifying Columns.Content { color:Black; text-align:justify; font-size:small; -webkit-column-count:3; -moz-column-count:3; -ms-column-count:3; column-count:3 }

39 Page in Chrome

Learn More about CSS 40

41 Learn More about CSS