CS 0134 (term 2181) Jarrett Billingsley

Slides:



Advertisements
Similar presentations
HTML Basics Customizing your site using the basics of HTML.
Advertisements

Table, List, Blocks, Inline Style
HTML and CSS. HTML Hyper Text Markup Language Tells browser how to display text and images.
HTML popo.
CSS Cascading Style Sheets. Objectives Using Inline Styles Working with Selectors Using Embedded Styles Using an External Style Sheet Applying a Style.
Cascading Style Sheets
CHAPTER 7 STYLING CONTENT WITH CASCADING STYLE SHEETS.
Chapter 3 – Designing your web pages Dr. Stephanos Mavromoustakos.
Introduction to CSS. What is CSS? A CSS (cascading style sheet) file allows you to separate your web sites (X)HTML content from it’s style. Use your (X)HTML.
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.
Very quick intro HTML and CSS. Sample html A Web Title.
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.
SM5312 week 11: CSS Menus & Navigation Bars1 An Introduction to Cascading Style Sheets CSS Menus and Navigation Bars Nick Foxall.
1 Web Developer & Design Foundations with XHTML Chapter 9 Key Concepts.
End User Computing An Introduction to CSS Sujana Jyothi Research Lab1, Callan Building, Department of Computer Science
CSS BASICS. CSS Rules Components of a CSS Rule  Selector: Part of the rule that targets an element to be styled  Declaration: Two or more parts: a.
Cascading Style Sheets Based on Castro, HTML for the WWW, 6 th edition Ron Gerton, Fall 2007.
Recognizing the Benefits of Using CSS 1. The Evolution of CSS CSS was developed to standardize display information CSS was slow to be supported by browsers.
1 Dreamweaver CS5 intermediate class by Cookie Setton Build a CSS website WITHOUT TABLES Just when you thought you were starting to understand HTML coding,
Web Pages and Style Sheets Bert Wachsmuth. HTML versus XHTML XHTML is a stricter version of HTML: HTML + stricter rules = XHTML. XHTML Rule violations:
กระบวนวิชา 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.
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.
XHTML and CSS Overview. Hypertext Markup Language A set of markup tags and associated syntax rules Unlike a programming language, you cannot describe.
Tutorial 3: Adding and Formatting Text. 2 Objectives Session 3.1 Type text into a page Copy text from a document and paste it into a page Check for spelling.
CSS (Cascading Style Sheets): How the web is styled Create Rules that specify how the content of an HTML Element should appear. CSS controls how your web.
HTML & CSS A brief introduction. OUTLINE 1.What is HTML? 2.What is CSS? 3.How are they used together? 4.Troubleshooting/Common problems 5.More resources.
ITP 104.  While you can do things like this:  Better to use styles instead:
The Characteristics of CSS
Website Development with Dreamweaver
IDs versus Classes Naming Your Tags for Maximum Functionality.
More Basic HTML. Add spacing (single & double space) Save Refresh Add horizontal rule Add comments Add styles Add headings Add features Add alignments.
 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.
HTML: Hyptertext Markup Language Doman’s Sections.
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.
Tutorial 3 Adding and Formatting Text with CSS Styles.
Introduction to CSS. Why CSS? CSS Provides Efficiency in Design and Updates CSS relatively easy to use Can give you more flexibility and control Faster.
Getting Started with HTML. HTML  Hyper Text Markup Language  HTML isn’t a program language, its known as a markup language  A Markup language has tags.
Group 9: Through examples, explain how to build a css navigation bar. Presented by: Daniel Ku, Matt Iannacci & Iphia Henry.
Introduction to HTML Dave Edsall IAGenWeb County Coordinator’s Conference June 30, 2007.
Welcome to the Basic Microsoft Word Guide. Before you start this Guide, you will need to complete “Basic Computer”; “Basic Windows” and know how to type.
CSS (Cascading Style Sheets). CSS CSS – Cascading Style Sheets – Cascade because of the way CSS rules can stack on top of each other. Allows you to add.
Cascading Style Sheets for layout
Cascading Style Sheets
Let’s Try It! Open Notepad
CSS for Styling Text.
INTRO TO WEB DEVELOPMENT html
Web Development & Design Foundations with XHTML
Animation and Flexboxes
More advanced HTML and CSS
>> Introduction to CSS
INTRODUCTION TO HTML AND CSS
Breaking the mold with CSS
Using Cascading Style Sheets Module B: CSS Structure
Cascading Style Sheets for layout
Introduction to Web programming
COMP 101 Review.
IS333: MULTI-TIER APPLICATION DEVELOPMENT
CSS.
Introduction to HTML Today we will look at:
Software Engineering for Internet Applications
Intro to CSS Mr. Singh.
Web Programming– UFCFB Lecture 11
INTRODUCTION TO HTML AND CSS
Training & Development
Cascading Style Sheets (CSS)
Session 3: Basic CSS Spring 2009
Johan Ng and Muhammad Hazzry
Session IV Chapter 15 - How Work with Fonts and Printing
Web Programming and Design
Introduction to Styling
Presentation transcript:

CS 0134 (term 2181) Jarrett Billingsley Basic HTML and CSS CS 0134 (term 2181) Jarrett Billingsley

Class announcements Welcome back lol The first week didn't count towards your grade! Today is the first "real" lab. If you forgot the stuff about uploading your site, that's fine! Check out the "Lab0" link in the site schedule. These slides are linked from the course site. You can open them up to follow along or refer back to. 9/11/2017 CS 0134 term 2181

HTML Basics 9/11/2017 CS 0134 term 2181

What's HTML? Hypertext Markup Language is the computer language used to define the structure and content of a webpage. The header and links at the top The colors, fonts, spacing between things etc. are defined by CSS. If I turn it off… The text on the page Images and other media 9/11/2017 CS 0134 term 2181

<em>emphasized text</em> Tags, tags, tags HTML files contain text and tags: text is the text on your page, and tags control how it looks. A tag looks like this: <br> Most kinds of tags come in pairs. A closing tag has a / before the name, and they surround stuff: <em>emphasized text</em> Think of them like (parentheses)! If you forget a closing tag, often it still works fine, but other times it's a problem. 9/11/2017 CS 0134 term 2181

Nesting and structuring Tags can be nested: put inside one another. This is how we can make a whole complex page. An article… which contains an image… and some text…. and a button… etc. 9/11/2017 CS 0134 term 2181

Under the hood <!doctype html> <html> <head> Every HTML file has a structure required by the HTML specification. This weird line says that we're using HTML5. <!doctype html> <html> <head> </head> <body> </body> </html> The <head> tag contains information about the page. The <html> tag surrounds the rest of the file. Don't forget it! The <body> tag contains the page contents – text, images, links, layout, etc. 9/11/2017 CS 0134 term 2181

Valid and invalid <html> <head> </head> <body> The browser is picky about how HTML is written. (It's not smart.) What's wrong with these? <html> <head> </head> <body> </body> </html> <!doctype html> <html> <head> <body> </body> </html> <!doctype html> <html> <head> <body> </head> </body> </html> 9/11/2017 CS 0134 term 2181

A little help… The W3C Markup Validator is a great tool for making sure your HTML files are valid. Check the course site – I linked it at the top. You can either upload your file or copy all of it and paste it. Many of the errors are hard to read for newcomers… But it's a lot better than nothing. Why bother validating? It helps you see where your mistakes are. Valid HTML code will behave consistently on all browsers. It gives you a warm fuzzy feeling when there are no errors :D 9/11/2017 CS 0134 term 2181

Starting your HTML document You know the icons and names in the tabs? The <head> does that, and other stuff! The very first thing in the <head> should be: <meta charset="utf-8"> The title (the name in the tab) is also required: <title>CS 0134</title> The icon isn't required ;) but it's a little wordy: <link rel="shortcut icon" href="file.png"> "file.png" is the name of an image file to use. It should be in the same folder as the HTML file. 9/11/2017 CS 0134 term 2181

A really common page layout Lots and lots of pages look generally like this: HTML makes this easy! Put this in the <body>: header navigation main footer <header> </header> <nav> </nav> <main> </main> <footer> </footer> This is totally different from the <head> tag!! You can put these in any order you want, but usually you'll put them in this order. (Who puts a footer at the top?) 9/11/2017 CS 0134 term 2181

<h1>The Title of my Page</h1> Headings You can put titles on things with headings. The code looks like: <h1>The Title of my Page</h1> You can use <h1> through <h6>. Don't try to make "big text" using headings. CSS will help us there. Don't pick a heading based on the text size. Again, CSS will help. Think of headings like an outline for a paper. <h1> for the big points, <h2> for the points under those, etc. 9/11/2017 CS 0134 term 2181

<p>This is paragraph one. <p>This is paragraph two! Making text work right If you put this inside the <main> in the <body>… This is paragraph one. This is paragraph two! It will show up as one line in your browser, like: This is paragraph one. This is paragraph two! That's… probably not what you want. To start a new paragraph, put the <p> tag at the beginning of it: <p>This is paragraph one. <p>This is paragraph two! 9/11/2017 CS 0134 term 2181

Lab: making a valid HTML file (with actual content!) 9/11/2017 CS 0134 term 2181

CSS Basics 9/11/2017 CS 0134 term 2181

What's CSS? Cascading Style Sheets are the computer language used to define the aesthetics of your page - colors, fonts, alignment, that kind of stuff. It's a separate language from HTML and looks pretty different. As an example of how important CSS is, here's the course site without it: 9/11/2017 CS 0134 term 2181

h1 { font-size: 200%; font-weight: bold; } CSS Rules A CSS file contains rules. A rule has two parts, and looks like this: h1 { font-size: 200%; font-weight: bold; } This is the selector. It chooses which things will be affected by this rule. This is the declaration block. This changes the properties of the selected items. You can put lots of things in here! 9/11/2017 CS 0134 term 2181

Where do we put the CSS? <head> ... other stuff ... We can put it in our HTML's <head> tag, in a<style> tag: <head> ... other stuff ... <style> h1 { font-size: 200%; font-weight: bold; } </style> </head> 9/11/2017 CS 0134 term 2181

Picking and choosing When you want to pick which things to style, it can be a pretty complicated process. The link text is blue and bold. The first row and column are blue. Today is red. Special lectures are yellow. 9/11/2017 CS 0134 term 2181

Very serious slide about classes A class (as in classify) is a group of things with a shared feature. 9/11/2017 CS 0134 term 2181

In HTML, you can put class="anything" inside any opening tag you want. CSS Classes A class in CSS is a way of putting things into categories to make them easier to select with a rule. In HTML, you can put class="anything" inside any opening tag you want. In CSS, a rule that uses .anything as a selector will apply to all those tags. <h1 class="special"> This is a fancy header!</h1> <p class="special">This is a fancy paragraph. Oooooh. .special { color: red; font-family: fantasy; } 9/11/2017 CS 0134 term 2181

<img id="site_logo" src="logo.png"> CSS IDs If you have something unique, you can give it a name: an ID (identifier). Unlike classes, you can't use an ID more than once on the page. (Cause it's a name.) site_logo <img id="site_logo" src="logo.png"> HTML: #site_logo { border: 2px solid black; } CSS: 9/11/2017 CS 0134 term 2181

Some basic text CSS properties You can change the font with the font-family property: font-family: serif; gives something like this. font-family: sans-serif; gives something like this. font-family: fantasy; gives something like this. font-family: "Impact"; uses the Impact font. You can color the text with the color property: color: red; makes it this color! color: limegreen; makes it this color! You can make it bold, italic, or underlined with: font-weight: bold; font-style: italic; text-decoration: underline; 9/11/2017 CS 0134 term 2181

Styling the <body> tag You can set the "overall style" by styling the <body> tag. Some examples: body { background-color: linen; width: 900px; margin: 0 auto; } What does this do? ;) Makes the page a nice width. Centers the page on the screen. 9/11/2017 CS 0134 term 2181

The inspector All modern browsers have an inspector. This lets you see all kinds of information about the page. Try right-clicking on something and choosing "Inspect"! (Safari has to enable this with an option.) This is really helpful for seeing how parts of a page fit together. And for figuring out why things aren't showing up right. Check the "Rules" panel on the right. 9/11/2017 CS 0134 term 2181

Lab: making it stylish 9/11/2017 CS 0134 term 2181