+ All Categories
Home > Documents > Create Web Pages - halvorsen.blog · • That’s because the new HTML editor is the default editor...

Create Web Pages - halvorsen.blog · • That’s because the new HTML editor is the default editor...

Date post: 03-Jun-2020
Category:
Upload: others
View: 10 times
Download: 0 times
Share this document with a friend
44
Create Web Pages with HTML & CSS Hans-Petter Halvorsen http://www.halvorsen.blog
Transcript
Page 1: Create Web Pages - halvorsen.blog · • That’s because the new HTML editor is the default editor for all HTML files with the exception of ASP.NET Web Forms files (.aspx, .ascx,

Create Web Pageswith HTML & CSS

Hans-Petter Halvorsen

http://www.halvorsen.blog

Page 2: Create Web Pages - halvorsen.blog · • That’s because the new HTML editor is the default editor for all HTML files with the exception of ASP.NET Web Forms files (.aspx, .ascx,

Contents• Part 1: – Introduction to HTML and CSS

• Part 2:–Step by Step Example

• Deploy to Web Server –FTP

Page 3: Create Web Pages - halvorsen.blog · • That’s because the new HTML editor is the default editor for all HTML files with the exception of ASP.NET Web Forms files (.aspx, .ascx,

HTML & CSSIntroduction

Hans-Petter Halvorsen

http://www.halvorsen.blog

Page 4: Create Web Pages - halvorsen.blog · • That’s because the new HTML editor is the default editor for all HTML files with the exception of ASP.NET Web Forms files (.aspx, .ascx,

Web Site Example

Presentation (Figures and Text) of your Software Product

Documents available for download (Hyperlinks)

Page 5: Create Web Pages - halvorsen.blog · • That’s because the new HTML editor is the default editor for all HTML files with the exception of ASP.NET Web Forms files (.aspx, .ascx,

WYSIWYG HTML Editors

• Adobe Dreamweaver (Monthly Payment)

• Kompozer (Free)

• Bluegriffon (Free)

• Sparkle ($80), etc...

Other HTML Editors (not WYSIWYG)• Visual Studio (ASP.NET)

• Visual Studio Code• CoffeeCup ($69, Free Trial)

• Coda ($99)

• NotePad (-> any textbased editor)

WYSIWYG – What You See Is What You Get

You dont need to know HTML syntax - Its

just like using MS Word.

Only possible to change the HTML

source code and then select “Preview”

in order to see how it looks like in a

Web Browser.

You need to know HTML syntax

Page 6: Create Web Pages - halvorsen.blog · • That’s because the new HTML editor is the default editor for all HTML files with the exception of ASP.NET Web Forms files (.aspx, .ascx,

Create a Web Site with Visual Studio

• Visual Studio is not well suited for creating Static HTML Web Pages.

• Visual Studio has poor WYSIWYG Editing possibilities• Visual Studio is more optimized for creating Dynamic

Web Pages and creating ASP.NET Web Pages in special• For HTML pages Visual Studio Code may be a better

choice.

Page 7: Create Web Pages - halvorsen.blog · • That’s because the new HTML editor is the default editor for all HTML files with the exception of ASP.NET Web Forms files (.aspx, .ascx,

Simple Web Page in Visual Studio Code

Page 8: Create Web Pages - halvorsen.blog · • That’s because the new HTML editor is the default editor for all HTML files with the exception of ASP.NET Web Forms files (.aspx, .ascx,

Web ServerApache Web Server or IIS Web Server

Your Development PC PC with Web Browser

Visual Studio

FTPE.g. WinSCP, FileZilla or use FTP features in Visual Studio

Upload Files

Web Page UrlHTTP

Request

ResponseClients

Visual Studio Code

Page 9: Create Web Pages - halvorsen.blog · • That’s because the new HTML editor is the default editor for all HTML files with the exception of ASP.NET Web Forms files (.aspx, .ascx,

Create a Web Site with Visual Studio

Note! Make sure the Source Code should be stored in your Team Services Project

Page 10: Create Web Pages - halvorsen.blog · • That’s because the new HTML editor is the default editor for all HTML files with the exception of ASP.NET Web Forms files (.aspx, .ascx,

Create a Web Site with Visual Studio

Your Start Page needs to be named “index.htm”

Page 11: Create Web Pages - halvorsen.blog · • That’s because the new HTML editor is the default editor for all HTML files with the exception of ASP.NET Web Forms files (.aspx, .ascx,

Visual Studio HTML Editor

Note! Due to the brand new HTML editor in Visual Studio, static HTML files no

longer has the Design|Split|Source options enabled by default.

• That’s because the new HTML editor is the default editor for all HTML files

with the exception of ASP.NET Web Forms files (.aspx, .ascx, .master).

• However, it is only the Web Forms editor that has support for the designer

and split view.

• So all we have to do is to map our .html or .htm files to use the Web Forms

editor instead of the new HTML editor.

• Simply right-click any .html/.htm file in Solution Explorer and select Open

With…

Page 12: Create Web Pages - halvorsen.blog · • That’s because the new HTML editor is the default editor for all HTML files with the exception of ASP.NET Web Forms files (.aspx, .ascx,

HTML Editor in Visual Studio

Page 13: Create Web Pages - halvorsen.blog · • That’s because the new HTML editor is the default editor for all HTML files with the exception of ASP.NET Web Forms files (.aspx, .ascx,

Simple “WYSIWYG” Editor + Preview

Code Editor

Create your HTML Code here!

Page 14: Create Web Pages - halvorsen.blog · • That’s because the new HTML editor is the default editor for all HTML files with the exception of ASP.NET Web Forms files (.aspx, .ascx,

Simple HTML Page Example

14

<!DOCTYPE html><html><body>

<h1>My First Heading</h1>

<p>My first paragraph.</p>

</body></html>

HTML Code

Web Browser:

Page 15: Create Web Pages - halvorsen.blog · • That’s because the new HTML editor is the default editor for all HTML files with the exception of ASP.NET Web Forms files (.aspx, .ascx,

Test in Browser

Hit F5 to Run It

Or Select “View in Browser”Note! All documents should be PDF Files!!

Page 16: Create Web Pages - halvorsen.blog · • That’s because the new HTML editor is the default editor for all HTML files with the exception of ASP.NET Web Forms files (.aspx, .ascx,

Hyper-links:

<!DOCTYPE html><html><body>

<h1>This is a heading</h1>

<a href="http://www.google.com">This is a link to Google</a>

</body></html>

<!DOCTYPE html><html><body>

<h1>This is a heading</h1>

<img src=“myimage.jpg" alt=”blabla" width="104" height="142">

</body></html>

Images:

Page 17: Create Web Pages - halvorsen.blog · • That’s because the new HTML editor is the default editor for all HTML files with the exception of ASP.NET Web Forms files (.aspx, .ascx,

HTML Tags Overview<a href="http://www.google.com">This is a link to Google</a>

<b>This is my Text</b>

Hyperlink:

Bold Text:

<h1>This is my Header</h1>Headers:

This is my Text<br>This is also my Text

Line Break:

<p>My first paragraph.</p>Paragraph:

<img src=“myimage.jpg" alt=”blabla" width="104" height="142">Image:

<h2>This is my Header</h2>

<h3>This is my Header</h3>

<title>This is my Title</title>Title:

<!-- Write your comments here -->Comments:

Page 18: Create Web Pages - halvorsen.blog · • That’s because the new HTML editor is the default editor for all HTML files with the exception of ASP.NET Web Forms files (.aspx, .ascx,

HTML Tags - Table<table width="200" border="1"><tr>

<td>a</td> <td>b</td> <td>c</td> <td>d</td>

</tr> <tr>

<td>e</td> <td>f</td> <td>g</td> <td>h</td>

</tr> <tr>

<td>i</td> <td>j</td> <td>k</td> <td>l</td>

</tr></table>

Page 19: Create Web Pages - halvorsen.blog · • That’s because the new HTML editor is the default editor for all HTML files with the exception of ASP.NET Web Forms files (.aspx, .ascx,

...<head...

<link rel="stylesheet" type="text/css" href="stylesheet.css" />..

</head>...

CSS (Cascading Style Sheet)CSS is a stylesheet language that describes the presentation of an HTML page.

body {background-color: #d0e4fe;

}

h1 {color: orange;text-align: center;

}

p {font-family: "Times New Roman";font-size: 20px;

}

stylesheet.css:

myfile.htm:

Page 20: Create Web Pages - halvorsen.blog · • That’s because the new HTML editor is the default editor for all HTML files with the exception of ASP.NET Web Forms files (.aspx, .ascx,

HTMLGood Resource for creating Web Pages with HTML, CSS, JavaScript, SQL, etc.

http://www.w3schools.com

Page 21: Create Web Pages - halvorsen.blog · • That’s because the new HTML editor is the default editor for all HTML files with the exception of ASP.NET Web Forms files (.aspx, .ascx,

HTML & CSSStep by Step Example

Hans-Petter Halvorsen

http://www.halvorsen.blog

Page 22: Create Web Pages - halvorsen.blog · • That’s because the new HTML editor is the default editor for all HTML files with the exception of ASP.NET Web Forms files (.aspx, .ascx,

We are going to make a Web Page like this:

Page 23: Create Web Pages - halvorsen.blog · • That’s because the new HTML editor is the default editor for all HTML files with the exception of ASP.NET Web Forms files (.aspx, .ascx,

Create a proper Folder structure, e.g.:

My Web Site/css

.../documents

.../html

.../images

.../js

...index.html

You should always think structure before you start coding

Page 24: Create Web Pages - halvorsen.blog · • That’s because the new HTML editor is the default editor for all HTML files with the exception of ASP.NET Web Forms files (.aspx, .ascx,

Start with an empty HTML Page

Page 25: Create Web Pages - halvorsen.blog · • That’s because the new HTML editor is the default editor for all HTML files with the exception of ASP.NET Web Forms files (.aspx, .ascx,

Create Title, Header and Text

Page 26: Create Web Pages - halvorsen.blog · • That’s because the new HTML editor is the default editor for all HTML files with the exception of ASP.NET Web Forms files (.aspx, .ascx,

Create Images

Page 27: Create Web Pages - halvorsen.blog · • That’s because the new HTML editor is the default editor for all HTML files with the exception of ASP.NET Web Forms files (.aspx, .ascx,

Create Hyperlinks

Hyperlinks can be other web pages, documents, etc.

Page 28: Create Web Pages - halvorsen.blog · • That’s because the new HTML editor is the default editor for all HTML files with the exception of ASP.NET Web Forms files (.aspx, .ascx,

Learn more HTML• https://www.w3schools.com/html

Page 29: Create Web Pages - halvorsen.blog · • That’s because the new HTML editor is the default editor for all HTML files with the exception of ASP.NET Web Forms files (.aspx, .ascx,

CSS• CSS is a language that describes the style of an

HTML document.• CSS describes how HTML

elements should be displayed.• Examples: Font Size, Colors,

Alignment, etc.

Page 30: Create Web Pages - halvorsen.blog · • That’s because the new HTML editor is the default editor for all HTML files with the exception of ASP.NET Web Forms files (.aspx, .ascx,

Inline CSS• The CSS in part of the

HTML file<style>..</style>

Page 31: Create Web Pages - halvorsen.blog · • That’s because the new HTML editor is the default editor for all HTML files with the exception of ASP.NET Web Forms files (.aspx, .ascx,

External CSS File

Here you see a simple example:

Page 32: Create Web Pages - halvorsen.blog · • That’s because the new HTML editor is the default editor for all HTML files with the exception of ASP.NET Web Forms files (.aspx, .ascx,

Create CSS

Page 33: Create Web Pages - halvorsen.blog · • That’s because the new HTML editor is the default editor for all HTML files with the exception of ASP.NET Web Forms files (.aspx, .ascx,
Page 34: Create Web Pages - halvorsen.blog · • That’s because the new HTML editor is the default editor for all HTML files with the exception of ASP.NET Web Forms files (.aspx, .ascx,

Explore!

Find Colors, Font Sizes, etc. that fits your system

Page 35: Create Web Pages - halvorsen.blog · • That’s because the new HTML editor is the default editor for all HTML files with the exception of ASP.NET Web Forms files (.aspx, .ascx,

Learn more CSS• https://www.w3schools.com/css/

Page 36: Create Web Pages - halvorsen.blog · • That’s because the new HTML editor is the default editor for all HTML files with the exception of ASP.NET Web Forms files (.aspx, .ascx,

Bootstrap

http://www.w3schools.com/bootstrap/

Bootstrap is the most popular HTML, CSS, and JavaScript framework for developing responsive, mobile-first web sites.

Bootstrap is completely free to download and use!

Page 37: Create Web Pages - halvorsen.blog · • That’s because the new HTML editor is the default editor for all HTML files with the exception of ASP.NET Web Forms files (.aspx, .ascx,

Alternative 1

Page 38: Create Web Pages - halvorsen.blog · • That’s because the new HTML editor is the default editor for all HTML files with the exception of ASP.NET Web Forms files (.aspx, .ascx,

Alternative 2

Page 39: Create Web Pages - halvorsen.blog · • That’s because the new HTML editor is the default editor for all HTML files with the exception of ASP.NET Web Forms files (.aspx, .ascx,

Explore!

With CSS and Bootstrap you have endless possibilities

Page 40: Create Web Pages - halvorsen.blog · • That’s because the new HTML editor is the default editor for all HTML files with the exception of ASP.NET Web Forms files (.aspx, .ascx,

FTP

Hans-Petter Halvorsen

http://www.halvorsen.blog

File Transfer Protocol

Page 41: Create Web Pages - halvorsen.blog · • That’s because the new HTML editor is the default editor for all HTML files with the exception of ASP.NET Web Forms files (.aspx, .ascx,

Web Server• You need to deploy your files to the Web

Server• Typically you use a FTP program– You need to know the Host Name, and a User

Name and a Password

Page 42: Create Web Pages - halvorsen.blog · • That’s because the new HTML editor is the default editor for all HTML files with the exception of ASP.NET Web Forms files (.aspx, .ascx,

Web

PCs with Web Browsers

Clients

Server-side

Internet

HTML

HTML

CSS

Page 43: Create Web Pages - halvorsen.blog · • That’s because the new HTML editor is the default editor for all HTML files with the exception of ASP.NET Web Forms files (.aspx, .ascx,

FTP Software• WinSCP– https://winscp.net

• FileZilla– https://filezilla-project.org

Page 44: Create Web Pages - halvorsen.blog · • That’s because the new HTML editor is the default editor for all HTML files with the exception of ASP.NET Web Forms files (.aspx, .ascx,

Hans-Petter Halvorsen

University of Southeast Norwaywww.usn.no

E-mail: [email protected]: https://www.halvorsen.blog


Recommended