Web Design Basics. Cindy Royal, Ph.D. Associate Professor Texas State University



Similar documents
Web Design and Databases WD: Class 7: HTML and CSS Part 3

Web Building Blocks. Joseph Gilbert User Experience Web Developer University of Virginia Library

Outline of CSS: Cascading Style Sheets

Web Design Revision. AQA AS-Level Computing COMP2. 39 minutes. 39 marks. Page 1 of 17

ICE: HTML, CSS, and Validation

ITNP43: HTML Lecture 4

Dreamweaver CS4 Day 2 Creating a Website using Div Tags, CSS, and Templates

Using Style Sheets for Consistency

Last week we talked about creating your own tags: div tags and span tags. A div tag goes around other tags, e.g.,:

HTML5 and CSS3 Part 1: Using HTML and CSS to Create a Website Layout

CST 150 Web Design I CSS Review - In-Class Lab

Chapter 2 HTML Basics Key Concepts. Copyright 2013 Terry Ann Morris, Ed.D

Web Design with CSS and CSS3. Dr. Jan Stelovsky

CREATING A NEWSLETTER IN ADOBE DREAMWEAVER CS5 (step-by-step directions)

Introduction to Web Design Curriculum Sample

{color:blue; font-size: 12px;}

Development Perspective: DIV and CSS HTML layout. Web Design. Lesson 2. Development Perspective: DIV/CSS

Web Design I. Spring 2009 Kevin Cole Gallaudet University

Contents. Downloading the Data Files Centering Page Elements... 6

Web layout guidelines for daughter sites of Scotland s Environment

Building Your Website

How To Create A Web Page On A Windows (For Free) With A Notepad) On A Macintosh (For A Freebie) Or Macintosh Web Browser (For Cheap) On Your Computer Or Macbook (

BASICS OF WEB DESIGN CHAPTER 2 HTML BASICS KEY CONCEPTS COPYRIGHT 2013 TERRY ANN MORRIS, ED.D

HTML CSS Basic Structure. HTML Structure [Source Code] CSS Structure [Cascading Styles] DIV or ID Tags and Classes. The BOX MODEL

WHITEPAPER. Skinning Guide. Let s chat Velaro info@velaro.com by Velaro

HTML, CSS, XML, and XSL

Introduction to XHTML. 2010, Robert K. Moniot 1

What is CSS? Official W3C standard for controlling presentation Style sheets rely on underlying markup structure

Web Development 1 A4 Project Description Web Architecture

Web Development I & II*

Website Planning Checklist

Using an external style sheet with Dreamweaver (CS6)

Responsive Design

CREATING HORIZONTAL NAVIGATION BAR USING ADOBE DREAMWEAVER CS5

Selectors in Action LESSON 3

CSS - Cascading Style Sheets

CIS 467/602-01: Data Visualization

Creating HTML authored webpages using a text editor

Creating a Resume Webpage with

Create Webpages using HTML and CSS

Campaign Guidelines and Best Practices

EUROPEAN COMPUTER DRIVING LICENCE / INTERNATIONAL COMPUTER DRIVING LICENCE WEB EDITING

HTML TIPS FOR DESIGNING

FETAC Certificate in Multimedia Production. IBaT College Swords. FETAC Certificate in Multimedia Production Web Authoring Dreamweaver 3

Web Design and Development ACS Chapter 9. Page Structure

Basics of HTML (some repetition) Cascading Style Sheets (some repetition) Web Design

How to Properly Compose HTML Code : 1

Professional & Workgroup Editions

CSE 3. Marking Up with HTML. Tags for Bold, Italic, and underline. Structuring Documents. An HTML Web Page File

With mobile devices and tablets becoming popular for browsing the web, an increasing number of websites are turning to responsive designs to

Advanced Drupal Features and Techniques

How to code, test, and validate a web page

WEB DESIGN LAB PART- A HTML LABORATORY MANUAL FOR 3 RD SEM IS AND CS ( )

Designing HTML s for Use in the Advanced Editor

CSS. CSS - cascading style sheets CSS - permite separar num documento HTML o conteúdo do estilo. ADI css 1/28

Chapter 7 Page Layout Basics Key Concepts. Copyright 2013 Terry Ann Morris, Ed.D

Basic tutorial for Dreamweaver CS5

Style & Layout in the web: CSS and Bootstrap

Website 101. Yani Ivanov. Student Assistant / Web Administrator

Creating the Surf Shop website Part3 REVISED

Short notes on webpage programming languages

Essential HTML & CSS for WordPress. Mark Raymond Luminys, Inc mraymond@luminys.com

So we're set? Have your text-editor ready. Be sure you use NotePad, NOT Word or even WordPad. Great, let's get going.

8 STEPS TO CODE KILLER RESPONSIVE S

Caldes CM12: Content Management Software Introduction v1.9

Web Publishing Basics 2

Introduction Designing your Common Template Designing your Shop Top Page Product Page Design Featured Products...

Web Development CSE2WD Final Examination June (a) Which organisation is primarily responsible for HTML, CSS and DOM standards?

Web Design for Print Designers WEB DESIGN FOR PRINT DESIGNERS: WEEK 6

Making Responsive s

Table of Contents THE DESIGNER S GUIDE TO CREATING NEWZAPP DRAG AND DROP TEMPLATES... 6 THE NEWZAPP SYSTEM... 7

Slicing and Coding the Navigation Background in CSS

JJY s Joomla 1.5 Template Design Tutorial:

ART 379 Web Design. HTML, XHTML & CSS: Introduction, 1-2

Advanced Web Design. Zac Van Note.

1 of 8 9/14/2011 5:40 PM

BlueHornet Whitepaper

Introduction to Adobe Dreamweaver CC

Table of Contents Find out more about NewZapp

Cascading Style Sheet (CSS) Tutorial Using Notepad. Step by step instructions with full color screen shots

CSS for Page Layout. Key Concepts

About webpage creation

Further web design: Cascading Style Sheets Practical workbook

Fortis Theme. User Guide. v Magento theme by Infortis. Copyright 2012 Infortis

A send-a-friend application with ASP Smart Mailer

CHAPTER 10. When you complete this chapter, you will be able to:

GUIDE TO CODE KILLER RESPONSIVE S

ICT 6012: Web Programming

Create Your own Company s Design Theme

Using Adobe Dreamweaver CS4 (10.0)

Web Authoring CSS. Module Descriptor

Inspiring Creative Fun Ysbrydoledig Creadigol Hwyl. Web Design in Nvu Workbook 2

HTML and CSS. Elliot Davies. April 10th,

Level 1 - Clients and Markup

Magento Responsive Theme Design

MCH Strategic Data Best Practices Review

CSS 101. CSS CODE The code in a style sheet is made up of rules of the following types

Garfield Public Schools Fine & Practical Arts Curriculum Web Design

Embedding a Data View dynamic report into an existing web-page

Web Design & Development - Tutorial 04

Transcription:

Web Design Basics Cindy Royal, Ph.D. Associate Professor Texas State University HTML and CSS HTML stands for Hypertext Markup Language. It is the main language of the Web. While there are other languages used on the Web (programming languages that provide interactivity functions), most websites have HTML in some form as the basis of the site code. HTML files are text files that describe the content of the page. You use HTML to structure your content on an html page without regard to style. A Web browser interprets the markup and renders the page on a user s computer. CSS (Cascading Stylesheets) is another text- based language, used in conjunction with HTML, but it is used to style the content on the page. CSS can be used to control color, fonts and layout. By using a single CSS page linked to each HTML page, an entire website s style and layout can be centrally controlled. This allows for easy changes to design without affecting content. HTML/CSS files can be developed in a simple text editor like TextEdit or Notepad, but many HTML editors exist that provide additional coding functionality, like line numbers and color context. We are using Text Wrangler, but others include Sublime Text, TextMate, KomodoEdit or Notepad++. Adobe Dreamweaver is a graphical HTML editing program, but learning to work with code will help when you need to troubleshoot problems or work with existing files or frameworks. HTML5 is the next generation of HTML. It functions in the same manner as HTML, but adds semantic tags, rich media and animation features and works with CSS3. The basis of HTML is in its elements or tags. Tags are designated by opening and closing angle brackets. <html> Some tags have additional options, called attributes. The attributes have values designated by the designer. Values are surrounded by quotation marks. <tag attribute = "value"> <body bgcolor = "blue"> <body bgcolor = "#AACC00">

Most tags must be closed after inserting the contained text. This tag bolds the text enclosed within it. The closing tag makes sure no other text is bolded. <strong>cindy Royal s page</strong> Proper coding style requires tags to be written in lowercase. Format of an HTML File You open and close an HTML page with the <html> tag. That tells the browser to expect HTML. There are two sections of a Web page. <head> The head of the document contains information about the page. In the head section, you can include the title of the page (renders in title bar of browser), links to stylesheets and other related files and meta tags. <body> The body of the document contains all the content on the page. <html> <head> head information goes here </head> <body> body information goes here </body> </html> Notice that there is no content between the closing <head> tag and the opening <body> tag. Content for the site goes either in the head or body sections. In most cases, all tags that are opened, need to be closed after the content that it marks up.

Basic Site Tags <title> - The title tag puts the title in the title bar of the browser. Insert in the head section. <p> - Use this tag for paragraphs of text <h1> - <h6> - Use these tags for headings <strong> - bold; you may also see <b>. <em> - italics; you may also see <i>. Tags with attributes <a> - This tag, in conjunction with the href attribute, creates a link. <a href="http://www.google.com">google</a> - is my favorite search engine. Notice the placement of the quotation marks around the value of the attribute, in this case, the URL of the page. The text that will show up on the page is the word Google and it will appear as a link. Everything after the closing </a> tag will not appear as a link. If you want to open the link in a new window, use the target attribute with the _blank value. <a href="http://www.google.com" target="_blank">google</a> - is my favorite search engine. You can use the <a> tag for internal links (links to other pages on your site) as well. <a href="resume.html">resume</a> Internal links should open in the same window. <img> - This tag allows you to insert images. <img src="photo.jpg" /> The src (source) is the filename of the image. The file must be uploaded to your Web host so that your page can access it. Standalone tags You will notice that <img> included a / within the original tag. <img src="photo.jpg" /> Since you are not surrounding any text with the markup, this is considered a standalone tag. The proper way to close a standalone tag is to put the / inside the tag just before the closing angle bracket >. <br />

This provides a line break. It is also considered a standalone tag, because there is nothing for it to surround and should be closed with a / before the closing >. Block vs. Inline Elements Some tags automatically create new blocks of text by nature. These are block elements. You can t include a block element inside another block element. Elements like <p>, <h1> <h6> are considered block elements. You can t have one paragraph inside another or headings inside of paragraphs or other headings. Inline elements all you to insert the tag inline or within another element. Things like <strong>, <em>, <img> and <a> are all inline elements. They can be included within paragraphs or headings and function just as other elements do within the line. <p> <img src="cindy.jpg" />Cindy Royal is an associate professor at <a href=http://txstate.edu>texas State University</a>. </p> Layout Divs and Spans HTML allows you to divide the page into containers for content. Use the <div> tag for this. You will then apply classes or ids to the <div> to style it for layout. <div> is a block element. <span> is similar to <div> except that you can use it inline. Use <span> when you want to style something inline differently than other items in the block. <div> and <span> will make more sense as we work with CSS. Classes and IDs <div> and <span> will take classes and ids as attributes. You can define the names of classes and ids in CSS. An id can be used once, for a section of a page that will not be used again. Classes can be used multiple times, for styles that you want to use in multiple places. This will make more sense as we work with CSS.

Comments Sometimes you want to include a comment on your HTML page that doesn t get rendered by the browser. A comment might be a note to yourself or to another designer working on the page. It could be a way to delineate different sections of the page. Comments are handled differently by different languages. Use comments in html like this: <!-- This is a comment --> Doctype Open the page, before any HTML, with the proper Doctype. A Doctype tells the browser which version of HTML you are using. For HTML5, the doctype is simple. <!DOCTYPE html>

Format of an HTML Page With Divs For Layout A basic page is created using <div> tags to designate header, nav and section containers on the page. <!DOCTYPE html> <html> <head> <title>my New Website</title> </head> <body> <div id="main"> <div id="header"> <h1>my New Website</h1> </div> <div id="nav"> <p><a href="index.html">home</a> <a href="resume.html">resume</a> <a href="links.html">links</a></p> </div> <div id="section"> <h2>welcome</h2> <p><img src="royal.jpg" width="150" />Welcome to my new website. I am an associate professor at <a href="http://txstate.edu" target="_blank">texas State University</a> teaching <span class = "red">web design and digital media concepts</span>. </p> </div> <div id="aside"> <h3>courses</h3> <p>web Design<br /> Issues in New Media<br /> </p> </div> </div><!-- closing main div --> </body> </html>

The image above shows what the sample html looks like in the browser before applying a stylesheet.

Other tags Lists Lists can provide a way to structure content with bullets (or other items depending on attributes). Lists use two nested tags. <ul> <li>dogs</li> <li>cats</li> <li>rabbits</li> </ul> Lists are sometimes used, in conjunction with CSS, to style navigation bars. You style the list elements to create the proper spacing and layout. <ul> <li><a href="index.html">home</a></li> <li><a href="resume.html">resume</a> </li><li><a href="links.html">links</a></li> </ul> You can use styles to remove bullets and display inline instead of down, and use CSS padding for spacing. Tables Tables provide a more advanced way to layout content on a page. It uses three nested elements. <table> - main table tag <tr> - table row <td> - table data <table> <tr><td>cats</td><td>dogs</td><td>rabbits</td></tr> </table> The code above creates a one- row table with three items in it. Early HTML pages used tables to control the layout of the page, but now we have more advanced methods using divs and css to control page layout. Only use <table> for presenting data on a page.

CSS CSS (Cascading Stylesheets) is a separate set of codes that allow you to style the elements of your page. You can use CSS in a separate stylesheet linked to each page of your site (preferred), in the <head> of the document or inline on a specific element. To link a CSS page in an html page, include a line like this in the <head> section. <link rel="stylesheet" href="style.css" type="text/css" /> Make sure you use your stylesheet s name in the href, save it in the folder with your html pages (or identify the folder to which you save it in the href) and you also upload the stylesheet to your server when you post to the Web. You open a style by indicating the element. Within curly braces, you indicate properties and their values. For example, p { color: #000000; font-size: 12px;

Sample CSS Apply this CSS to the HTML page above and see what happens. Notice that comments in CSS are handled like this: /* This is a comment */ The code below is commented to explain the styles. /* Use body styles to control most of the site */ body { color: #000000; background-color: #FFFFFF; margin-left: 20px; font-family: Helvetica; /* Designate paragraphs and headings as needed */ p { font-size: 1em; margin: 10px; margin-top: 0px; h1 { font-size: 1.8em; color: #8ca571; margin: 10px; h2 { font-size: 1.2em; margin: 10px; h3 { font-size: 1.1em; margin-bottom: 0px;

/* Modify the colors and presentation of the <a> tag. In CSS, lists can have a hover effect */ a {color: #000000; text-decoration: none a:visited {color: #a4a5a3; text-decoration: none a:hover {color: #8ca571; text-decoration: underline /* This area designates the ids for <divs>. Notice the # to designate ids. */ #header { width: 100%; #nav { position: relative; height: 24px; border-bottom: 1px solid #8ca571; width: 98%; margin: auto; /* You can use special styles for tags within certain elements */ #nav a {color: #000000; font-weight: bold; text-decoration: none; margin-right: 10px; #nav a:visited {color: #000000; #nav a:hover {color: #8ca571; #nav p { margin-left: 0px; #section { position: relative; width: 75%; float: left; /* We are using this style for a sidebar */ #aside { position: relative; width: 25%; float: left;

/* You can use as many divs as you want. If you want to include a footer, establish a div with this id. */ #footer { position: relative; margin-left: auto; margin-right: auto; height: 42px; /* This main div is used to put a border, with rounded corners, around the entire page */ #main { border: 1px solid #8ca571; clear: both; overflow: auto; border-radius: 15px; /* This demonstrates a special class. It begins with a. You can use this whenever you want to turn something red. Could be used with a <span>. */.red { color: red; /* This area controls the look of certain styles on the page on a mobile device, like an iphone */ @media screen and (max-width: 480px) { #section { float: none; width: 100%; #aside { float: none; width: 100%;

The image demonstrates what the file looks like in the browser when you apply the CSS. Media Queries The last section of the stylesheet includes an area we created for media queries. This is a feature that allows you to create separate styles for different sized screens. The code above only applies to screens less than or equal to 480px, like an iphone. Used in conjunction with percentage widths for <divs> and <img>, this forms the basis of responsive design. @media screen and (max-width: 480px) { #section { float: none; width: 100%; #aside { float: none; width: 100%; There will be more information to come about responsive design in future sessions.

CSS Properties Reference W3C CSS Recommendation - www.w3.org/tr/css3- selectors Full description of these properties can be found at www.htmlhelp.com/reference/css/properties.html. Another good description of properties - www.blooberry.com/indexdot/css/propindex/all.htm Font properties font- family: Arial, Verdana, Helvetica etc. font- size use em or px font- weight - bold font- style italic Color and Background properties color color of text background- color color of background background- image (background- image: url( name.gif ); background- repeat use no- repeat to show once Text properties text- decoration underline vertical- align- vertical positioning of the element text- align alignment within element text- indent first line indent Box properties margin- top, margin- right, margin- bottom, margin- left shorthand example - margin: 1px 1px 1px 1pxm; padding- top, padding- right, padding- bottom, padding- left shorthand example: padding: 1px 1px 1px 1pxm; Border properties border- top- width, etc. or shorthand example border- width: 1px 1px 1px 1px border- color border- style dotted, dashed, solid, none shorthand example: border: solid red List properties list- style- type- disc, bullet, none list- style display: inline (to make lists present horizontally) Other properties width height float used for positioning and wrapping around an element display: inline or block to change default position absolute or relative top use with absolute positioning left- use with absolute positioning Positioning Use divs as containers for layout can use absolute or relative positioning can size containers with px or % #header { width: 950px; height: 100px; padding- top: 0px; padding- left: 0px; New ways to do positioning with HTML 5 no need to use divs for main/common sections of the page. <header></header> <nav></nav> <section></section> <footer></footer> Add CSS properties as you would for divs in stylesheet, i.e: header { width: 950px; height: 100px; padding- top: 0px; padding- left: 0px;