How to work with images and icons Murach's HTML and CSS, 4th Edition

Slides:



Advertisements
Similar presentations
Working with Images and HTML
Advertisements

1 Cascading Style Sheets Continued Different kinds of selectors in a style sheet –Simple- Pseudo-Class –Contextual- Pseudo-Element –Class Image Styles.
Slide 1 CMPS 211 Internet Programming Spring 2008 Dynamic Effects with Styles Chapter 12 2/6/08.
Web Development & Design Foundations with XHTML Chapter 4 Key Concepts.
Copyright © Terry Felke-Morris WEB DEVELOPMENT & DESIGN FOUNDATIONS WITH HTML5 Chapter 4 Key Concepts 1 Copyright © Terry Felke-Morris.
Very quick intro HTML and CSS. Sample html A Web Title.
Copyright © Terry Felke-Morris WEB DEVELOPMENT & DESIGN FOUNDATIONS WITH HTML5 Chapter 4 Key Concepts 1 Copyright © Terry Felke-Morris.
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.
Principles of Web Design 5 th Edition Chapter Nine Site Navigation.
Advance CSS (Menu and Layout) Miftahul Huda. CSS Navigation MENU It's truly remarkable what can be achieved through CSS, especially with navigation menus.
Building a Website: Cascading Style Sheets (CSS) Fall 2013.
CIS 1310 – HTML & CSS 6 Layout. CIS 1310 – HTML & CSS Learning Outcomes  Describe & Apply the CSS Box Model  Configure Float with CSS  Designate Positioning.
กระบวนวิชา 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.
Class four: the box model and positioning. is an HTML tag which allows you to create an element out of inline text. It doesn’t mean anything! try it:
CSS normally control the html elements. Three Ways to Insert CSS There are three ways of inserting a style sheet: External style sheet Internal style.
CIS 1310 – HTML & CSS 4 Visual Elements and Graphics.
Chapter 4 Adding Images. Inserting and Aligning Images Using CSS When you choose graphics to add to a web page, it’s important to use graphic files in.
Chapter 5 Web Graphics Styling Basics Key Concepts Copyright © 2013 Terry Ann Morris, Ed.D 1.
Chapter 3 Adding Images in HTML. Agenda Understanding Web Page Images Prepare Your Images for the Web Insert an Image Specify an Image Size Add Alternative.
Web Development & Design Foundations with HTML5
HTML Boot Camp: Rules and Images
Copyright © 2003 Pearson Education, Inc. Slide 4-1 Created by, Stephanie Ludi, Rochester Institute of Technology—NY Basic Web Page Construction Graphics.
1 Mastering the Internet and HTML Images and Image Tags.
Images Inserting an image on a web page. chcslonline.org2 ITEMS REQUIRED Go to the course download page on the course website and download the 3 images.
Images (1) Three most popular formats – Graphics Interchange Format (GIF) – Joint Photographic Experts Group (JPEG) – Portable Network Graphics (PNG) –
Images in HTML PowerPoint How images are used in HTML.
Chapter 5 Web Graphics Styling Basics Key Concepts Copyright © 2013 Terry Ann Morris, Ed.D 1.
Images & Image Maps 16 th February. Images & Image Maps Web authors can add icons, logos and high impact images to their pages Images enhance web pages.
Web Development & Design Foundations with XHTML Chapter 4 Key Concepts.
CHAPTER 4 LINKS Creating links between pages Linking to other sites links.
Adding Images Learning Web Design: Chapter 7. Using an Image Images have many purposed on a Web site Used as a static image To add illustration: ex. A.
INT222 - Internet Fundamentals Shi, Yue (Sunny) Office: T2095 SENECA COLLEGE.
HTML. Adding Background Color The bgcolor attribute lets you change the background color of the Web page. Located in the body tag See common Web Page.
REEM ALMOTIRI Information Technology Department Majmaah University.
HTML5 and CSS3 Illustrated Unit F: Inserting and Working with Images.
WebD Introduction to CSS By Manik Rastogi.
CSS.
Unit G - Images. Unit G - Images The great questions of life? How does an airplane stay up? Where does the tooth fairy get her money? Why is the sky.
Web Development & Design Foundations with XHTML
Web Development & Design Foundations with HTML5 8th Edition
CSS Layouts: Grouping Elements
Images in HTML PowerPoint How images are used in HTML
Inserting and Working with Images
CIIT-Human Computer Interaction-CSC456-Fall-2015-Mr
Images, Links and Multimedia
Creating Page Layouts with CSS
DW Tutorial 5 Sessions 5.1 & 5.2 REVIEW
Chapter 4 Adding Images.
HTML Images CS 1150 Spring 2017.
Web Development & Design Foundations with HTML5 8th Edition
Chapter 3 Images.
Session V - Chapter 9 How to Work with Images
Web Development & Design Foundations with HTML5 7th Edition
Web Development & Design Foundations with HTML5 8th Edition
4 Visual Elements and Graphics.
HTML5 Session IV Chapter 7 - How to Work with Links and Lists Chapter 9 - How to Work with Images Master a Skill.
TOPICS Chrome Dev Tools Process for Building a Static Website
ITI 133 HTML5 Desktop and Mobile Level I
Basics of Web Design Chapter 5 Graphics & Text Styling Basics Key Concepts Copyright © 2018 Terry Ann Morris, Ed.D.
Unit G - Images. Unit G - Images The great questions of life? How does an airplane stay up? Where does the tooth fairy get her money? Why is the sky.
Chapter 5 Graphics & Text Styling Basics Key Concepts
Web Development & Design Foundations with H T M L 5
How to use the CSS box model for spacing, borders, and backgrounds
HTML Images CS 1150 Fall 2016.
Floating and Positioning
Project 4 Creating an Image Map.
Murach's HTML and CSS, 4th Edition
USING IMAGES This is the bottom of the page. Note the alignment of having text before and after, at the top, in the middle and at the bottom. Code is on.
Lesson 3: Cascading Style Sheets (CSS) and Graphical Elements
Images in HTML PowerPoint How images are used in HTML
Presentation transcript:

How to work with images and icons Murach's HTML and CSS, 4th Edition Chapter 11 How to work with images and icons © 2018, Mike Murach & Associates, Inc. Murach's HTML and CSS, 4th Edition

Murach's HTML and CSS, 4th Edition Objectives Applied Use HTML to include images on a web page and CSS to align and float images. Use the HTML5 figure and figcaption elements to treat an image as a figure. Use HTML to create an image map that can be used to link to more than one web page. © 2018, Mike Murach & Associates, Inc. Murach's HTML and CSS, 4th Edition

Objectives (continued) Knowledge List and describe the four types of images that are used with websites. Describe the proper use of the img element and its related CSS. Describe the use of the figure and figcaption elements with images. Describe the use of the picture and source elements for working with images. Describe the use of image rollovers and image maps. Describe the use of image editors and tools for creating favicons. Describe the use of the svg element and Scalable Vector Graphics. © 2018, Mike Murach & Associates, Inc. Murach's HTML and CSS, 4th Edition

Murach's HTML and CSS, 4th Edition Image types JPEG GIF PNG WebP © 2018, Mike Murach & Associates, Inc. Murach's HTML and CSS, 4th Edition

Attributes of the <img> tag src alt height width © 2018, Mike Murach & Associates, Inc. Murach's HTML and CSS, 4th Edition

CSS properties for sizing an image height width © 2018, Mike Murach & Associates, Inc. Murach's HTML and CSS, 4th Edition

The HTML and CSS for two images <p><img src="images/students.jpg" alt="teacher and students" height="300" width="400">   <img id="small" src="images/students.jpg" alt="teacher and students"></p> The CSS for resizing the second image #small { height: 150px; width: 200px; } © 2018, Mike Murach & Associates, Inc. Murach's HTML and CSS, 4th Edition

The images in a web browser © 2018, Mike Murach & Associates, Inc. Murach's HTML and CSS, 4th Edition

Accessibility guidelines For images with useful content, always code an alt attribute that describes the content. For images that are used for decoration, code the alt attribute as an empty string. © 2018, Mike Murach & Associates, Inc. Murach's HTML and CSS, 4th Edition

The property for aligning images vertically vertical-align Common keywords for this property bottom middle top text-bottom text-top © 2018, Mike Murach & Associates, Inc. Murach's HTML and CSS, 4th Edition

The HTML and CSS for three images <h2>We want to hear from you</h2> <p><img src="images/computer.gif" alt="web address"> <strong>Web:</strong> www.murach.com</p> <p><img src="images/telephone.gif" alt="phone"> <strong>Phone:</strong> 1-800-221-5528</p> <p><img src="images/email.gif" alt="email"> <strong>Email:</strong> murachbooks@murach.com</p> The CSS that aligns the images img { vertical-align: middle; margin-right: 10px; } © 2018, Mike Murach & Associates, Inc. Murach's HTML and CSS, 4th Edition

The images in a web browser before they’re aligned © 2018, Mike Murach & Associates, Inc. Murach's HTML and CSS, 4th Edition

Three images in a web browser after they’re aligned © 2018, Mike Murach & Associates, Inc. Murach's HTML and CSS, 4th Edition

The properties for floating images clear © 2018, Mike Murach & Associates, Inc. Murach's HTML and CSS, 4th Edition

Some of the HTML for a web page <img src="images/students.jpg" alt="teacher and students"> <ul> <li>in college and university MIS programs that focus on providing students with practical, real-world experience</li> <li>by technical institutes and community colleges that focus on the skills that employers are looking for</li> <li>... </li> </ul> <p id="last">...</p> © 2018, Mike Murach & Associates, Inc. Murach's HTML and CSS, 4th Edition

The CSS for floating an image and clearing the last paragraph img { float: left; margin-top: 15px; margin-bottom: 10px; } #last { clear: left; } © 2018, Mike Murach & Associates, Inc. Murach's HTML and CSS, 4th Edition

The HTML in a web browser © 2018, Mike Murach & Associates, Inc. Murach's HTML and CSS, 4th Edition

A page with figure and figcaption elements © 2018, Mike Murach & Associates, Inc. Murach's HTML and CSS, 4th Edition

The HTML for the figure and figcaption elements <article> <h1>Fossil Threads in the Web of Life</h1> <figure> <img src="images/sampson_dinosaur.jpg" alt="Scott Sampson"> <figcaption>Scott Sampson and friend </figcaption> </figure> <p>...</p> </article> © 2018, Mike Murach & Associates, Inc. Murach's HTML and CSS, 4th Edition

The CSS for the figure and figcaption elements float: left; margin-right: 1.5em; } figcaption { display: block; font-weight: bold; padding-top: .25em; margin-bottom: 1em; border-bottom: 1px solid black; } © 2018, Mike Murach & Associates, Inc. Murach's HTML and CSS, 4th Edition

Elements for adding multiple picture resources img Attributes of the source element media srcset type © 2018, Mike Murach & Associates, Inc. Murach's HTML and CSS, 4th Edition

Displaying an image based on screen size <picture> <source media="(min-width: 960px)" srcset="images/mountains01.png"> <source media="(min-width: 768px)" srcset="images/mountains02.png"> <source media="(min-width: 460px)" srcset="images/mountains03.png"> <img src="images/mountains04.png" alt=""> </picture> © 2018, Mike Murach & Associates, Inc. Murach's HTML and CSS, 4th Edition

Displaying an image in an alternative format <picture> <source type="image/webp" srcset="images/mountains04.webp"> <img src="img/mountains04.png" alt=""> </picture> © 2018, Mike Murach & Associates, Inc. Murach's HTML and CSS, 4th Edition

This image has been rolled over because the mouse is hovering over it © 2018, Mike Murach & Associates, Inc. Murach's HTML and CSS, 4th Edition

The HTML and CSS for an image rollover <body> <h1>Ram Tap Combined Test</h1> <p id="image1"></p> </body> The CSS for the image rollover #image1 { background-image: url("h1.jpg"); width: 434px; height: 312px; } #image1:hover { background-image: url("h2.jpg"); © 2018, Mike Murach & Associates, Inc. Murach's HTML and CSS, 4th Edition

An image in a web browser with hotspots created by an image map © 2018, Mike Murach & Associates, Inc. Murach's HTML and CSS, 4th Edition

The HTML for the image and image map <img src="images/web_books.jpg" alt="PHP/MySQL and JavaScript/jQuery books" usemap="#books"> <map name="books"> <area href="php_mysql.html" shape="poly" alt="PHP/MySQL book" title="PHP/MySQL" coords="0,30,115,0,133,67,109,156,39,174"> <area href="javascript_jquery.html" alt="JavaScript/jQuery book" title="JavaScript/jQuery" coords="145,21,261,52,222,195,107,165"> </map> © 2018, Mike Murach & Associates, Inc. Murach's HTML and CSS, 4th Edition

Murach's HTML and CSS, 4th Edition An image editor © 2018, Mike Murach & Associates, Inc. Murach's HTML and CSS, 4th Edition

Typical editing operations Change the size, image type, or quality of an image. Control the animation of an animated GIF file. Save an image with transparency or a matte. Get the coordinates for an image map. © 2018, Mike Murach & Associates, Inc. Murach's HTML and CSS, 4th Edition

An image without transparency and with transparency and a matte © 2018, Mike Murach & Associates, Inc. Murach's HTML and CSS, 4th Edition

Creative Commons license conditions for images and icons Attribution Share Alike Non-Commercial No Derivative Works © 2018, Mike Murach & Associates, Inc. Murach's HTML and CSS, 4th Edition

Popular icon libraries Font Awesome Glyphicons Glyphish Material Icons Flaticon © 2018, Mike Murach & Associates, Inc. Murach's HTML and CSS, 4th Edition

HTML that uses 3 Font Awesome icons <h2>We want to hear from you</h2> <ul> <li><i class="fas fa-globe fa-lg"></i> <strong>Web:</strong> www.murach.com</li> <li><i class="fas fa-phone-square fa-lg"></i> <strong>Phone:</strong> 1-800-221-5528</li> <li><i class="fas fa-envelope-square fa-lg"></i> <strong>Email:</strong> sales@murach.com</li> </ul> The icons in a web browser © 2018, Mike Murach & Associates, Inc. Murach's HTML and CSS, 4th Edition

A web page with a favicon The link element that links to the favicon <link rel="shortcut icon" href="images/favicon.ico"> © 2018, Mike Murach & Associates, Inc. Murach's HTML and CSS, 4th Edition

Popular programs and tools for creating favicons Axialis Icon Workshop Font Awesome Photoshop plugin IrfanView FavIcon from Pics © 2018, Mike Murach & Associates, Inc. Murach's HTML and CSS, 4th Edition

How to work with Scalable Vector Graphics Common attributes of the <svg> element height width x y Child elements for creating various shapes rect circle ellipse line polyline polygon path text How to create a red rectangle with a black border <svg> <rect width="300" height="100" fill="red" stroke="black" /> </svg> © 2018, Mike Murach & Associates, Inc. Murach's HTML and CSS, 4th Edition

The Murach logo as an SVG element <svg viewBox="0 0 247.83 76.96"> <rect class="cls-1" width="80" height="76.96"/> <path class="cls-2" d="M28.19,18.36H18.13s3.29.09,3.29,4.33V52l10.53- 3.33V22.47C31.95,19.88,30.58,18.37,28.19,18.36Z"/> d="M40.33,21.9H30.26s3.29.08,3.29,4.32V55.52l10.53- 3.33V26C44.09,23.43,42.72,21.91,40.33,21.9Z"/> d="M52.42,25.53H42.36s3.29.08,3.29,4.32V59.14l10.53- 3.33V29.64C56.18,27.05,54.81,25.54,52.42,25.53Z"/> </svg> The logo © 2018, Mike Murach & Associates, Inc. Murach's HTML and CSS, 4th Edition

Short 11-1 Do an image rollover with CSS © 2018, Mike Murach & Associates, Inc. Murach's HTML and CSS, 4th Edition