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.

Slides:



Advertisements
Similar presentations
Cascading Style Sheets
Advertisements

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.
Cascading Style Sheets. CSS stands for Cascading Style Sheets and is a simple styling language which allows attaching style to HTML elements. CSS is a.
กระบวนวิชา 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.
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.
Stylin’ with CSS. 2 Topics What is CSS? Why CSS? CSS Examples.
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.
Text Properties, Line Box, CSS. Text Properties Properties related to the display of text. Text-align : left, right, center I like FSU!
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.
Workshop: CSS-Part I Cascading Style Sheets add style to your HTML web pages.
Using Cascading Style Sheets CSS Structure. Goals Understand how contextual, class and ID selectors work Understand how contextual, class and ID selectors.
More HTML Chapter 4. 2 Nesting Tags How do you write the following in HTML? The wrong way: This is really, REALLY fun ! Tags must be correctly nested.
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.
Lecture CSS: Cascading Style Sheets. What are Styles? Cascading Style Sheets (CSS) is a style sheet language used to describe the presentation semantics.
Copyright © Terry Felke-Morris WEB DEVELOPMENT & DESIGN FOUNDATIONS WITH HTML5 7 TH EDITION Chapter 3 Key Concepts 1 Copyright © Terry Felke-Morris.
3.1 Cascading Style Sheets. Motto Fashions fade, style is eternal. —Yves Saint Laurent.
Stylin’ with CSS. 2 Topics What is CSS? Why CSS? CSS Examples.
HIGHER COMPUTING CSS. WHAT IS CSS? CSS: Cascaded Style Sheets used to separate a web site’s content(information) from its style(how it looks).
Using Cascading Style Sheets. Introduction to Styles and Properties  Cascading Style Sheets (CSS) are a standard set by the World Wide Web Consortium.
CSS Dvijesh Bhatt.
Cascading style sheets (CSS)
Dreamweaver -- CSS. Dreamweaver -- MX New icons are added in MX Most of the features commonly used in web design, and are same as FrontPage. New feature.
Copyright © Terry Felke-Morris WEB DEVELOPMENT & DESIGN FOUNDATIONS WITH HTML5 Chapter 3 Key Concepts 1 Copyright © Terry Felke-Morris.
Chapter 7 Web Typography Principles of Web Design, 4 th Edition.
Tutorial #3 Cascading Style Sheets. Review: Last Class Image sizing Pathnames Project Default Path Relative Path Absolute Path Blackboard Homework Submission.
Cascading Style Sheets CSS. CSS - Structure Declaration block Property: identifies what to change Value: how to change it Selector – example h1{ font-size:
1 Cascading Style Sheets (CSS) Part 2. 2 The Sources of Style Sheets.
CSS The Definitive Guide Chapter 8.  Allows one to define borders for  paragraphs  headings  divs  anchors  images  and more.
INTRODUCTION TO HTML5 Styling Text. Change the Font Size  You can use the font-size property to change the font size for a document’s text.  Instead.
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.
 A style sheet is a single page of formatting instructions that can control the appearance of many HTML pages at once.  If style sheets accomplished.
CSS My favourite ICT lesson By Federico Boschi Cascading 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.
CO1552 – Web Application Development Cascading Style Sheets.
Tutorial #3 Cascading Style Sheets. Tutorial #2 Review - Anchors Links to Site DMACC Internal Links Go to Top Mail To me Local.
Introduction to CSS. What is CSS?  Cascading Style Sheets  Used for styling HTML  Also important in javascript and jquery for selectors  External.
Stylin’ with CSS Monday October 8 th and Tuesday October 9 th.
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.
 2008 Pearson Education, Inc. All rights reserved Cascading Style Sheets™ (CSS)
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 (CSS) ◦ Used to specify the presentation of elements separately from the structure of the document.  Inline style ◦ declare.
INTRODUCTORY Tutorial 3 Using CSS to Format Multiple Pages.
CSS with XHTML Please use speaker notes for additional information!
Cascading Style Sheets Eugenia Fernandez IUPUI. CSS Purpose CSS allow you to specify the style in which your XML elements are displayed. CSS were originally.
XP Review 2 New Perspectives on JavaScript, Comprehensive1 Introducing Cascading Style Sheets Formatting Web Pages with CSS.
©SoftMoore ConsultingSlide 1 Introduction to HTML: Cascading Style Sheets.
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.
CSS properties Basharat Mahmood, Department of Computer Science, CIIT, Islamabad, Pakistan 1.
Web Design (14) CSS Formatting Text. Formatting Text In Brackets, go to your ‘externalcss’ website and find the ‘formattingtext’ page. Use the ‘main’
5 th ed: Chapter 4 4 th ed: Chapter 5 SY306 Web and Databases for Cyber Operations SlideSet #5: Advanced CSS.
CSS: Cascading Style Sheets Part II. Style Syntax.
CSS Cascading Style Sheets *referenced from
Basic Webpage Design Cascading Style Sheet (CSS).
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,
Chapter 11 & 12 CSS Style Sheets: Intro. Why CSS? Separate presentation from content – more accessible Less work – can change appearance of whole site.
Blended HTML and CSS Fundamentals 3 rd EDITION Tutorial 3 Introducing Cascading Style Sheets.
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.
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.
CONFIGURING COLOR AND TEXT WITH CSS Chapter 3. Cascading Style Sheets (CSS) Used to configure text, color, and page layout. Launched in 1996 Developed.
CSS.
( Cascading style sheet )
Creating Your Own Webpage
Cascading Style Sheets
The Internet 10/13/11 The Box Model
Stylin’ with CSS.
Cascading Style Sheets
Cascading Style Sheets
Presentation transcript:

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 of a web page CSS uses a different format than HTML: HTML content CSSselector {property: value}

In-line CSS are put directly into HTML using style attributes. Above you see the in-line style that makes the specific paragraph red. Keep in mind that your HTML should be kept a presentation free document, so use in-line styles as sparingly as possible.

Embedded, or internal styles are used to style a whole page Inside the head tags the style tags surround all of the styles for the page The style on the following page will make all of the paragraphs on the page red and all of the links blue This approach should also be avoided because of the direct link it creates between HTML and CSS

External styles are used for the whole, multipage website This is an separate file from you HTML page The file is typically saved with the name, “style.css” It looks like this:

To be governed by an external CSS, the.HTML file must have a link to the stylesheet between the tags. The syntax of a stylesheet link is as follows:

HTML has tags – CSS has corresponding selectors Selectors are the names given to styles in internal and external style sheets CSS selectors are simply the names of HTML tags and are used to change the style of a specific tags

For each selector there are properties inside curly brackets These take the form of words such as color, font-weight, or background-color A value is given to the property following a colon – not an ‘equals’ sign – and semi-colons separate the properties

This will apply the given values to the font-size and color properties to the body selector When this is applied to the HTML document, the text between the body tags (which is the content of the whole page) will be 0.8ems in size and navy in color.

px (font-size: 12px) – is the unit for a 12 pixel-tall font. 12px is a standard default font size for many browsers. pt (font-size: 12pt) – is the typical unit for font sizes in print media. One point is equal to 1/72 of an inch. % (font-size: 80%) – this will make the font 80% smaller than the standard format When a value is zero, you don’t need a unit (no border – border:0)

em: (font-size: 2em) means the font size is twice the size of the browser default font size. For example, if the standard font-size for an HTML page without CSS styles is 12pt, then 2em would make the font 24pt

Web page fonts should be able to change according to the size of the window. Because of this, it is best practice to use em or percentages for sizing of all of your fonts

You have 16,777,216 colors to use within CSS They come in the forms of names, rgb (red/green/blue) value, or a hex code

aqua black blue fuchsia gray green lime white yellow maroon navy olive orange purple red silver teal transparent is also a valid value Of the dozens of named HTML colors, there are 17 standard colors:

Colors can be applied to most selectors using “color” and “background-color” properties

Named colors tend to be harsh primaries, so its best to play with their hexadecimal versions to tone them down It’s best to use hexadecimal colors all the time. The following rule states that all text tagged h1 will be Cyan over a DarkMagenta background.

The font-family property sets the font(s) your page is written in: Times New Roman, Arial, and Verdana are standard for most browsers. There are many font options, but the font you specify must be on the user’s computer, so avoid obscure fonts You can specify your first choice of font first, then list other options after the first choice that the browser can choose if the first choice if not supported by typing their names with commas in between. Fonts are case-sensitive, so be sure to capitalize! If the name of your font is more than one word, you must put the name of the font in quotations.

font-size declares the size of the font. Use the standard font size for,, etc. rather than stylizing with larger font and bold weight The font size hierarchy should be kept as much as possible for clear read of formatting You should also use em or % relative to other elements on the page. Try to avoid using set font sizes so that they can adjust relative to the size of the browser window

This stated whether the font is bold or not It’s best to stick with font-weight: bold, or no declaration at all.

This stated whether the font is italic or not It’s best to stick with font-style: italic, or no declaration at all.

Always use HTML tags when they can add meaning, structure, or semantics to your content. If you want to write the sentence I love cheese (where the word "love" should carry particular emphasis), the tag is the correct choice. CSS is absolutely not an acceptable solution. Similarly, the tag is used to denote importance. Always use CSS when you are changing the visual appearance of your page. The title heading on your page is a..., but you can make it bold or not, purple or not using CSS. A rule-of-thumb is to imagine how a screen reader will interpret your page. If a reader interprets the page without any stylesheets attached, it should ideally translate your content with your intended verbal tone intact.

This stated whether the font is underlined or not The options for this are: text-decoration: overline (places a line above the text) text-decoration: line-through (puts a line through the text) text-decoration: underline (puts a line under the text and should only be used for links because that is the expected formatting for links from standard formatting) text-decoration: none (this removes the standard underlining for links, and should be used regularly to increase the sophistication of your site)

Letter-spacing: spacing between letters in a word Word-spacing: spacing between words in a sentence Line-height: this sets the height of a line in an element Use “em” for these as much as possible Text-align: this is left, right, center or justify (like in Word) Text-indent: indents the first line in a paragraph

…. Element 2 Content …. …………………………….. …………………………………………………………. margin padding …. Element 1 Content …. ……………………………..

You can set margins and padding one side at a time: margin-top margin-bottom margin-left margin-right padding-top padding-bottom padding-left padding-right

You can use margin/padding shorthand to combine values for all four sides, starting on the top and moving clockwise around the box. margin: top right bottom left; You can also set the margin/padding of an element for all four sides at once like this:  This can be condensed into this 

Border-style establishes that you want a border around an element Here are types of border styles: solid, dotted, dashed, double, groove, ridge, inset, and outset Border-width sets the width of the border, and each side can be set individually like margins and padding Border-color is just like any other color setting we’ve discussed. Borders can be really tacky – use them cautiously.