CSS Sprites. What are sprites? In the early days of video games, memory for graphics was very low. So to make things load quickly and make graphics look.

Slides:



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

Chapter 1: Introduction. Contents Whats New in Dreamweaver CS4? The Dreamweaver CS4 Interface Setting Up a Site Creating a Web Page Adding Text to Your.
DREAMWEAVER Welcome to our website!
HTML Tags and Their Functions
Cascading Style Sheets
Chapter 3 – Designing your web pages Dr. Stephanos Mavromoustakos.
Very quick intro HTML and CSS. Sample html A Web Title.
Principles of Web Design 5 th Edition Chapter Nine Site Navigation.
SM5312 week 11: CSS Menus & Navigation Bars1 An Introduction to Cascading Style Sheets CSS Menus and Navigation Bars Nick Foxall.
Advance CSS (Menu and Layout) Miftahul Huda. CSS Navigation MENU It's truly remarkable what can be achieved through CSS, especially with navigation menus.
Navigation Bars Level 2 Extended Certificate Unit B12 Doing Business Online.
Web Pages and Style Sheets Bert Wachsmuth. HTML versus XHTML XHTML is a stricter version of HTML: HTML + stricter rules = XHTML. XHTML Rule violations:
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.
Today’s objectives Site performance Padding, Margins, Borders
With Alex Conger – President of Webmajik.com FrontPage 2002 Level I (Intro & Training) FrontPage 2002 Level I (Intro & Training)
Review of last session The Weebly Dashboard The Weebly Dashboard Controls your account and your sites Controls your account and your sites From here you.
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.
TUTORIAL 8: Enhancing a Web Site with Advanced CSS
Designing a Classroom Web Site Using NVU Beginning Level.
HTML Tags. Objectives Know the commonly used HTML tags Create a simple webpage using the HTML tags that will be discussed.
Introduction to Nvu Jing Fu. What is nVu? Free web design and development tool WYSIWYG (/wiziwig/) software Other similar tools: Dreamweaver, Googlepages.
IT Website Development Welcome!. Welcome to Unit 7! Optimizing Images and creating photo albums in Dreamweaver There are no textbook readings for.
Creating A Simple Web Page. Step 1- Open Dreamweaver & Create A New Page (File New) and blank.
Advanced CSS - Page Layout. Advanced CSS  Compound Selectors:  Is a Dreamweaver term, not a CSS term.  Describes more advanced types of selectors such.
JQuery Page Slider. Our goal is to get to the functionality of the Panic Coda web site.Panic Coda web site.
Copyright © Texas Education Agency, All rights reserved. 1 Web Technologies Website Development with Dreamweaver.
Using Dreamweaver. Slide 1 Dreamweaver has 2 screens that do different things The Document window where you create your WebPages The Site window where.
Web Page Basics XHTML & CSS 1. Planning Decide on topic or research the topic given to you. Decide on your colour scheme. Use
Website Research By Sophie Hiscock. Fan Marvel Website You know this website is Marvel because of the characters from the comics are in the body, which.
Unit E. Image Measurements The size of an image can be measured 2 ways: Dimensions: the height and width, measured in pixels. File Size: measured in Kilobytes.
Using Netscape to Design Basic, Yet Beautiful Web Pages! With Designs by Dan EIL 301, spring 2000.
Basic Responsive Design Techniques. Let’s take a look at this basic layout. It has a header and two columns of text, in a box that is centered on the.
.  Entertain  Inform  Educate  Blogs  Sell  Date  Gamble  Religion.
Intro to Dreamweaver Web Design Section 7-1 Part or all of this lesson was adapted from the University of Washington’s “Web Design & Development I” Course.
Today’s objectives  Assignment 1  Padding, Margins, Borders  Fluid Layout page  Building accessible Table  Element size with padding and border 
 Word doc for you to download › Link at the beginning of class › 10 Questions › Answers to be added inline  Post to Sakai when completed › No resubmits.
Review of last session Add text to your website Add text to your website Title Title Paragraph Paragraph Title and paragraph Title and paragraph Add photographs.
Moodle with Style Integrating new technologies to empower learning and transform leadership.
Chapter 2 Web Page Design Mr. Gironda. Elements of a Web Page These are things that most web pages use.
Level 1 Tutorial Project How to put a movie player on your Weebly website using an HTML code.
IT Introduction to Website Development Welcome!
 To begin you first need to sign up to Weebly by going to or alternatively and we will create an account.
Principles of Web Design 6 th Edition Chapter 9 – Site Navigation.
Web Design Part I. Click Menu Site to create a new site root.
Updated on: September 4, 2010 CIS67 Foundations for Creating Web Pages Professor Al Fichera.
Dawn Pedersen Art Institute. What Are CSS Sprites? Back in the day, sprites were the images in games that swapped one little image for another in a specific.
11/12/2015 Box Model Reed Crouch. 11/12/2015  HTML elements can be considered as boxes. In CSS, the term "box model" is used when referring to layout.
The Basics of Microsoft Word Getting Started and Formatting your paper.
Week 2: Building a Simple Website IMC 320 Web Publishing Spring 2011.
Introduction to CSS Layout
Introducing Dreamweaver. Dreamweaver The web development application used to create web pages Part of the Adobe creative suite.
CIT 256 CSS Intro & Dreamweaver Built-in Layouts Dr. Beryl Hoffman.
CONTROLLING Page layout
Positioning Objects with CSS and Tables
1 Preparation for site Create a folder in MyDocuments: beavercheese. Create a subfolder, images Classes, career, DW beginner Download.
CSS IS A LANGUAGE DESIGNED TO TARGET HTML ELEMENTS AND NODES BY TYPE, CLASS, ID AND VALUE, AND CHANGE THEIR VALUES CSS – change how your HTML looks and.
Tutorial #1 Using HTML to Create Web Pages. HTML, XHTML, and CSS HTML – HyperText Markup Language The tags the browser uses to define the content of the.
 Add one element at a time  If it doesn’t do what you want, › Delete it › DON’T just keep piling on more items.
Chapter 4 and 5. Objectives Introduce markup: elements and attributes How browsers interpret HTML documents Basic structure of HTML document What do style.
This screen may be skipped altogether if the user chooses a report from the server and clicks Ad Hoc or Edit or whatever. Also, the next screen would ordinarily.
Unit 15 – Web Authoring Web Authoring Project.
Introduction to CSS Layout
Weebly Elements, Continued
Weebly Elements, Continued
CSS Layouts: Positioning and Navbars
Creating a Baseline Grid
Fixed Positioning.
Controlling Layout with Style Sheets
Putting An Image on Your Web Page
Multipage Sites.
Presentation transcript:

CSS Sprites

What are sprites? In the early days of video games, memory for graphics was very low. So to make things load quickly and make graphics look like they were moving, several graphics were included in one image file. You could show only a portion of the image on the screen at any time. These were called sprites. Why use sprites in web design? Two reasons: first, since only one image is loaded, there is zero wait time to get the alternate image. Secondly, it requires only one trip to the web server, which will help optimize the loading speed of the web site.

There are lots of places where you can imagine using sprites. Bill Mead’s website, has a lot of icons and motion effects. This site uses Moodle, an open source content management system for education. You might imagine all these icons are part of a sprite, but I was surprised to see that they are not! Each is a separate little image. What if we wanted to use these icons for another site, but wanted to make a sprite?

I downloaded a folder of icons from the server that is used by the theme for all of these icons on the site. There were 58 of them in the folder. You can imagine building a Photoshop file with all of these icons, spaced properly, and keeping track of all the positions for 58 icons would be a LOT of work. Thankfully, there are some FREE tools that will reduce the amount of work a huge amount. Download the zipped icons. You can unzip them to look at them if you want, but we will actually want the zipped file.

Next, we will visit this site: You can experiment with all of the various settings later. For right now follow along with these settings: First, choose the folder with all of our icons in it. Notice there is a maximum size of 1MB (now, but 0.5 when this screenshot was grabbed). That will be important for some situations.

I am going to leave all the other settings as default with the exception of these two. I am going to uncheck Wrap columns to fix Opera bug for now (in the Sprite Output Options section) I am also going to uncheck Display width and height in the CSS Output Options. Then click the button at the bottom of the page.

The page will reload and pop up at the top will be this box. Go ahead and download the sprite image, and also select and copy all the rules in the dialog box above. Your CSS and Image have been created for you! Now we just have to figure out how to use it!

On your desktop (or in your download folder) you will have this image with all your icons inside of it. Put it in a folder on your desktop and then start up Dreamweaver, make a new HTML file and save that into the folder as well. Lets just add a simple unordered list onto the html file.

Add some style tags before the tag closes. Go ahead and paste in all the styles created by the sprite generator. The sprite generator site has this reminder. So go ahead and copy this rule and put it in your CSS.

We are currently not using a container div, so I just changed it to ul li. Also, that file name is stupid. It will take me about ten minutes to forget what that is referring to, so I am going to change it to mysprites.png Don't forget to change the name of the actual graphic file as well.

Lets add a few more rules. At the top of my stylesheet I add my basic reset rule to get rid of any extraneous margins and padding. Add a rule for the UL that will set some specific margins for the whole block and remove the bullets. Finally, we add to the rule for ul li. Just add some padding on the left, set the line height and some margin on the bottom.

If you test the file now, you will notice you get the first icon in the sprite every time. How do we get the correct icon for each list item? Easy! we just use the classes generated by the sprite generator. By putting the correct class on each list item, we can display the correct icon.

Here are these four done. Notice you can set the margin between the list items to whatever you want and they will display properly. Here I set the width of the UL to 200px and made the text wrap. There is 25px between list items. Here is another tutorial that does this in a similar way with paragraphs: