Web Programming A different world! Three main languages/tools No Java

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

HTML popo.
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.
HTML: HyperText Markup Language Hello World Welcome to the world!
Presenter: James Huang Date: Sept. 26,  Introduction  Basics  Lists  Links  Forms  CSS 2.
HTML – A Brief introduction Title of page This is my first homepage. This text is bold  The first tag in your HTML document is. This tag tells your browser.
COMPSCI 345 / SOFTENG 350 TUTORIAL WEEK 8 | SAM KAVANAGH.
1 HTML Markup language – coded text is converted into formatted text by a web browser. Big chart on pg. 16—39. Tags usually come in pairs like – data Some.
CM143 - Web Week 2 Basic HTML. Links and Image Tags.
Creating a Simple Page: HTML Overview
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.
HTML. What is HTML? HTML is a language for describing web pages. HTML stands for Hyper Text Markup Language HTML is a markup language A markup language.
DAT602 Database Application Development Lecture 14 HTML.
DIY Web Development Hand Code Your Own Page (For Free!) by Bryan Brown, Indiana University Bloomington SLIS.
HTML (HyperText Markup Language)
 HTML stands for Hyper Text Mark-up Language. The coding language used to create documents for the World Wide Web  HTML is composed of tags. HTML tags.
HTML history, Tags, Element. HTML: HyperText Markup Language Hello World Welcome to the world!
1 CSC 121 Computers and Scientific Thinking David Reed Creighton University HTML and Web Pages.
Programming in HTML.  Programming Language  Used to design/create web pages  Hyper Text Markup Language  Markup Language  Series of Markup tags 
1 HTML John Sum Institute of Technology Management National Chung Hsing University.
INTRODUCTION. What is HTML? HTML is a language for describing web pages. HTML stands for Hyper Text Markup Language HTML is not a programming language,
Introduction To HTML.  HTML stands for Hyper Text Markup Language.  HTML was developed by Tim Berners-Lee.  HTML is maintained by World Wide Web Consortium(W3C).
Ali Alshowaish. What is HTML? HTML stands for Hyper Text Markup Language Specifically created to make World Wide Web pages Web authoring software language.
LEARNING HTML PowerPoint #1 Cyrus Saadat, Webmaster.
CS 111 – Oct. 4 Web design –HTML –Javascript Commitment: –This week, read sections 4.3 – 4.5.
Cascading Style Sheets CSS.  Standard defined by the W3C  CSS1 (released 1996) 50 properties  CSS2 (released 1998) 150 properties (positioning)  CSS3.
Department of Computer Science, Florida State University CGS 3066: Web Programming and Design Spring
Department of Computer Science, Florida State University CGS 3066: Web Programming and Design Spring
Chapter 1: Intro to HTML Section 1: HTML Structure Presentation Section 2: Layout of an HTML File Section 3: Working with Lists & Tables Section 4: HTML.
Introduction to HTML Hypertext Mark-up Language. HTML HTML = Hypertext Mark-up Language Is just plain simple text marked up by “tags” You can create a.
Blended HTML and CSS Fundamentals 3 rd EDITION Tutorial 1 Using HTML to Create Web Pages.
Week 1: Introduction to HTML and Web Design
Introduction to CSS: Selectors
Cascading Style Sheets
INTRO TO WEB DEVELOPMENT html
HTML CS 4640 Programming Languages for Web Applications
Web Architecture & HTML
Web Basics: HTML/CSS/JavaScript What are they?
HTML Basics.
Introduction to HTML:.
HTML – The COMPUTING UNLOCKED GUIDE
Section 4.1 Section 4.2 Format HTML tags Identify HTML guidelines
Elements of HTML Web Design – Sec 3-2
>> Introduction to CSS
HTML: HyperText Markup Language
Human Computer Interaction
Elements of HTML Web Design – Sec 3-2
Cascading Style Sheets
Uppingham Community College
Concepts of HTML, CSS and Javascript
HTML, CSS and DOM The basics
AN INTRODUCTORY LESSON TO MAKING A SIMPLE WEB PAGE By: RC Emily Solis
Elements of HTML Web Design – Sec 3-2
A guide to HTML.
Computers and Scientific Thinking David Reed, Creighton University
DynamicHTML Cascading Style Sheet Internet Technology.
HTML ELEMENTS Ms. Olifer.
Web Programming Language
Cascading Style Sheets
DynamicHTML Cascading Style Sheet Internet Technology.
Understand basic HTML and CSS terminology, concepts, and basic operations. Objective 3.01.
Computer communications
HTML – The COMPUTING UNLOCKED GUIDE
Johan Ng and Muhammad Hazzry
Web Programming and Design
Web Programming and Design
HTML CS 4640 Programming Languages for Web Applications
CGS 3066: Web Programming and Design Fall 2019
Presentation transcript:

Web Programming A different world! Three main languages/tools No Java HTML HyperText Markup Language CSS Cascading Style Sheets JavaScript Is NOT Java!! (only looks similar)

Getting Started We won’t need Eclipse “Compilation” happens when we open an HTML file in a web browser HTML data/files are the basis of any webpage Can be used to import more code such as CSS, JavaScript, images HTML files end in “.html” CSS files end in “.css” JavaScript files end in “.js”

Getting Started To make a basic webpage, open a “.html” file (e.g. “HelloWorld.html”) in any text editor (e.g. Eclipse or Notepad++) Make some changes to the file, save it. Open the file with a web browser Right click -> “Open with” -> [Your web browser of choice] To see future changes, you need to ”refresh” the page

HTML Not a programing language, but is a “markup” language Think of it as an encoding of shapes, styles, formatting Used to format a document with complicated pieces, but using only text Most recognizable feature: the opening and closing “tags” <div> … </div> <p> … </p> <table> … </table> Many more

HTML Similar to blocks of code, HTML tags denote “blocks” of content Example: We can enter plain text into an HTML file and it will be displayed in the browser “Hello, World!” We can also enclose the text in meaningful tags Paragraph tags: <p> and </p> Div tags: <div> and </div> Bold font tags: <strong> and </strong> Italics tags: <i> and </i>

HTML Notice: the browser rarely complains about bad/wrong/invalid code If detected, it usually has some default behavior that is up to who ever wrote the browser E.g. try using the <strong> tag without closing it

HTML Layout Certain tags impose structure on the document by default Paragraph tags will be put on separate lines inside their container Strong tags will not be put on separate lines Forced line break: <br> Makes a single break between the elements on the page Does not need a closing tag Lists: <ul></ul> for unorderd (bullets) and <ol></ol> for ordered (numbers) For each item, nest it inside <li></li> tags (stands for list item) For the sake of discussion, we generally abbreviate the tag name as just “br”, “ul”, “li”, etc.

Tags with attributes Some tags need extra data to function properly E.g. adding a link to another web page: the “a” (anchor) tag <a href=“http://www.google.com”>CLICK HERE</a> The URL above will not be visible, but will be encoded into the link “under” the text Note the space after the tag name (“a”) and the attribute name (“href”) Note that the attribute is assigned (“=”) the value in quotes (“http://www.google.com”) (Any tag can have any attribute, but as we have seen, they’re not always needed)

Other Useful Tags Comments: <!-- … --> Head tag: head Only block-comments Head tag: head Used to import other needed files (CSS, JavaScript) Generally does not contain content Body tag: body Used to contain most of the page’s content Heading tags: h1, h2, h3, h4 Span tags: span Image tags: img Needs a “src” attribute to say where to find the image Table tags: table A bit more complex, but very useful Html tag: html Not usually needed, but is usually included by convention or standard practices

Complex Layout Recall, we can nest tags So you can set up much more interesting layouts than standard “top to bottom”

Style Tags Denoted by <style> … </style> Usually put in the header Uses “selectors” to style different elements https://developer.mozilla.org/en-US/docs/Web/CSS/Reference#Selectors Can pull the style code into its own files and import the whole files <link rel=“stylesheet” href=“mystyles.css”>

More complex Element Attributes Id field id=“someIdName” Should be something unique To select by id, use “#someIdName” Class field class=“className” Primarily used to group conceptually similar elements for styling purposes To select by class, use “.className”

Examles .myClass #someID div.anotherClass Selects all elements with class=“myClass” #someID Selects the single element with id=“someID” div.anotherClass Selects all divs with class=“anotherClass”

Combinator Selectors Child selector A > B Selects all B elements which are directly contained in A elements div > p matches <div> <p> Text </p> </div> But not <span> </span>

Combinator Selectors Descendant selector: A B Matches any “B” tag any level descended from an “A” tag Matches both of the previous examples

Event Listeners Simple first example: “onclick” The value of the attribute needs to be Javascript But wtf is JavaScript  “Hello world” of event listeners: Add to an element: onclick=“alert(‘here’);” Try clicking the element

JavaScript What is it? How to use it in a webpage Mozilla overview A programming language Mainly used to run “on top of” a web page, or other interface How to use it in a webpage Write it in <script> tags, similar to syles Write in a .js file and import it Mozilla overview https://developer.mozilla.org/en- US/docs/Learn/Getting_started_with_the_web/JavaScript_basics

JavaScript Main idea: all your JavaScript “runs” as soon as it is loaded into the page. To take advantage of this, you will commonly use that time to define functions and objects to use later, during the lifetime of the webpage Example tasks: Set up ”handler” functions to process data from a form Set up handler functions to change the style of some elements

JavaScript Similarities with Java Differences from Java Syntax Differences from Java No strong, static, types! Does not need “classes” Different modes of standard input/output First-class functions Much more of a “script” than a Java program “Quick and dirty” design

JavaSCript JavaScript has access to the current web page and all of its structure! We can use it to adjust the UI to be responsive! This is what distinguishes “static” web pages from “dynamic” ones Important HTML elements: <input> for text input <checkbox> for toggles <button> and <submit> for buttons