Join Chris Converse for an in-depth discussion in this video Creating and linking HTML and CSS files, part of Creating an Interactive Photo Gallery with jQuery and Dreamweaver.
Now, we'll need to create an HTML file and a CSS file and hook the two together. Let's start by going to Dreamweaver, choose File > New > HTML. Let's choose XHTML 1.0 Transitional, so this will work all the way back in XP and as far back as IE 7 for some of the techniques we're going to use. With this brand-new file, let's choose File > Save, make sure we're in the myGallery directory. We'll call this index.html. Click Save.
Create a new file, CSS, click Create. Let's choose File > Save. Let's save this into the includes directory. We'll call this gallery.css. Click Save. Now, let's come over and select the index file. Inside of Dreamweaver, we're going to attach the style sheet into this document. We're going to choose Format menu > CSS Styles > Attach Style Sheet. Click Browse > myGallery > includes > gallery.css Then click Choose. Then say OK.
We now have our CSS file looked into our HTML file. Let's choose File > Save All. Now with our HTML and CSS file in place, in the next movie we're going to refer back to our sketch and we're going to start creating some CSS rules that are going to help us recreate our layout in HTML.
Download a copy of the finished web site here.
- Preparing gallery photos using Adobe Bridge
- Adding and linking thumbnail images
- Creating the layout in HTML and CSS
- Downloading and adding jQuery to the project
- Creating preview images from anchor links
- Implementing the preload functionality
- Building a customized lightbox with the Fancybox plug-in
- Styling the zoom and contact links
Skill Level Intermediate
Q: The finished state of the interactive photo gallery in this course shows a clickable preview. When you click on the preview image, or on the view larger icon, a larger lightbox image appears. Chris's example has a close button and border surronding the large image, but mine doesn't. Did I miss a step?
Q: This course was updated in April, 2013. What changed?
A: Since the release of this course, Internet Explorer 9 and 10 have been released, and sometimes these browsers do not activate interactive HTML content. To remedy this problem, the author has added a movie to Chapter 10 that will show you how to:
- Update the HTML to HTML5
- Update the version of jQuery
- Use the Google html5shiv to keep compatibility with Internet Explorer 7 & 8