New Feature: Playlist Center! Pick a topic and let our playlists guide the way—like a learning mixtape.

Start learning with our library of video tutorials taught by experts. Get started

Creating a First Web Site with Dreamweaver CS6
Illustration by

Making CSS more flexible


From:

Creating a First Web Site with Dreamweaver CS6

with Paul Trani

Video: Making CSS more flexible

Just like you want your web page to be flexible and fit different screens, different sizes, you also need your CSS, or your cascading style sheets, to be as flexible as possible. And luckily, CSS does just that because it enables the separation of the content from the design. And the CSS styles can be internal or external, so this is great. You can have that separation be, say, at the top of an HTML page--still internal to that HTML page--or it can actually be a separate page entirely and they're just linked together.

Watch this entire course now—plus get access to every course in the library. Each course includes high-quality videos taught by expert instructors.

Become a member
please wait ...
Creating a First Web Site with Dreamweaver CS6
2h 48m Beginner Aug 30, 2012

Viewers: in countries Watching now:

Join author Paul Trani as he shows how to create a web site step by step with Adobe Dreamweaver CS6, one of the industry's leading web authoring tools. But not just any web site. A responsive HTML5 web site that works across multiple browsers and devices, complete with rich imagery and text, a robust portfolio, video content, and even a contact form. This course covers how to use web standards such as HTML5 for structure and Cascading Style Sheets (CSS) to control colors, fonts, navigation, and more. The course also demonstrates how to test across multiple browsers and devices and upload your new site to the web.

Topics include:
  • Understanding basic web principles
  • Adding content to a web page
  • Linking to web sites and email addresses
  • Styling content with CSS
  • Creating a layout that fits multiple browsers and devices
  • Building an HTML5 layout
  • Inserting images and video
  • Adding a menu bar
  • Creating a contact form
  • Integrating a Twitter feed
  • Uploading and testing a web site
Subjects:
Web Web Design
Software:
Dreamweaver
Author:
Paul Trani

Making CSS more flexible

Just like you want your web page to be flexible and fit different screens, different sizes, you also need your CSS, or your cascading style sheets, to be as flexible as possible. And luckily, CSS does just that because it enables the separation of the content from the design. And the CSS styles can be internal or external, so this is great. You can have that separation be, say, at the top of an HTML page--still internal to that HTML page--or it can actually be a separate page entirely and they're just linked together.

So, this is obviously great because you can have multiple pages that use that one style sheet, and that CSS will affect all of those pages. Makes it easy to update, everything will be consistent, the file size will be smaller since you're just referring to that one file. So, let's take a look at how we do that, even moving some CSS from one web page out of it to a separate CSS file. Here I am in Dreamweaver, and I want my CSS and quite frankly all of my code to be as flexible as the layout.

And currently, if I take a look at my CSS, well, I'm wondering where does this CSS live? How is it set up? Well, if I right-click and go to code, I can see the CSS right in here. Well, where is it? It's actually inside of my HTML page. It's all embedded. So, if I happen to need to make multiple pages, they're all going to have those same CSS styles in each and every HTML page.

When really what I need to do is take all the CSS and put it in an external style sheet, and that happens to be what's going on here is there's an external style sheet from when I used a web font. So, that's what this is right here, that stylesheet.css is this style sheet. So what I can do is I can take all of these CSS styles just Shift-select them, do a right-click, and I can move the CSS Rules.

When I do that, note that it's automatically selected that CSS style sheet right here, and note if you didn't import any sort of web font, you can create a new style sheet from scratch. But in this case, since I already have one, I'll just point to it and select OK. Oh! What just happened? Oh! It indented everything. Says, hey! You know, I am part of this CSS now. So I can open that up. In fact, if I take a look at my code, I can see it's all moved. It's no longer in my HTML.

In fact, it's inside of this CSS. And check this out, it's linkable right here. So, I can click on stylesheet.css. This is nice! As I go into Code View, I can see all of my code nice and neat just like that. So, that looks pretty good. I'm going to save this document, and that's one thing you'll have to be aware of is you're going to want to start saving all your related files, because as you make changes in here, you want to make sure that it reflected in the source code.

But one thing I've noticed in here is, well, to be honest with you, I'm not crazy about where this stylesheet exists. It's within this Font folder. That's where the stylesheet.css is. And a good practice is to have it in a separate CSS folder. So, if I take a look at this specific folder, I can go ahead and move it, in fact, rename that folder. So, let me do that now. Here I am, here is my Font folder, and I'm going to just rename this to CSS just like that.

It doesn't bother me that there are some web fonts in here. It's perfectly fine. I just want to be really clear that these are my CSS files--will all exist right in the CSS folder. So I've changed it there. Well, what's going to happen if I go back into Dreamweaver and go to Design View? If I take a look at it, turn off this Live View, even turn it back on, you can see that I don't see it initially, and that's because I need to change this to CSS just like that. All right! There we have it.

I'm going to save all, or I can save all related files. But I'm saving everything. My style sheet is now in a CSS folder. If I go to Design View, everything looks good in Design View, and everything looks good in Live View. Another thing I want to point out as I take a peek at this CSS is that Dreamweaver was aware of the fact that there were images that were linked. So, when I moved all these styles into the style sheet, it knew to change the path to that JPEG.

So it actually has to go out a folder and then back into that Images folder. Let me show you what that looks like. It will go out a folder--so that's what those two dots are--go out a folder and then go into that Images folder to find that Background Home, okay? So that's how that works. I like how Dreamweaver is intelligent on knowing where items are, we can see that everything looks seamless and works seamless, and now what I can do is I can reuse this CSS across multiple pages.

Find answers to the most frequently asked questions about Creating a First Web Site with Dreamweaver CS6.


Expand all | Collapse all
please wait ...
Q: Where do I learn more about how to make a website?
A: Discover more on this topic by visiting how to make a website on lynda.com.
 
Share a link to this course

What are exercise files?

Exercise files are the same files the author uses in the course. Save time by downloading the author's files instead of setting up your own files, and learn by following along with the instructor.

Can I take this course without the exercise files?

Yes! If you decide you would like the exercise files later, you can upgrade to a premium account any time.

Become a member Download sample files See plans and pricing

Please wait... please wait ...
Upgrade to get access to exercise files.

Exercise files video

How to use exercise files.

Learn by watching, listening, and doing, Exercise files are the same files the author uses in the course, so you can download them and follow along Premium memberships include access to all exercise files in the library.
Upgrade now


Exercise files

Exercise files video

How to use exercise files.

For additional information on downloading and using exercise files, watch our instructional video or read the instructions in the FAQ.

This course includes free exercise files, so you can practice while you watch the course. To access all the exercise files in our library, become a Premium Member.

join now Upgrade now

Are you sure you want to mark all the videos in this course as unwatched?

This will not affect your course history, your reports, or your certificates of completion for this course.


Mark all as unwatched Cancel

Congratulations

You have completed Creating a First Web Site with Dreamweaver CS6.

Return to your organization's learning portal to continue training, or close this page.


OK
Become a member to add this course to a playlist

Join today and get unlimited access to the entire library of video courses—and create as many playlists as you like.

Get started

Already a member?

Become a member to like this course.

Join today and get unlimited access to the entire library of video courses.

Get started

Already a member?

Exercise files

Learn by watching, listening, and doing! Exercise files are the same files the author uses in the course, so you can download them and follow along. Exercise files are available with all Premium memberships. Learn more

Get started

Already a Premium member?

Exercise files video

How to use exercise files.

Ask a question

Thanks for contacting us.
You’ll hear from our Customer Service team within 24 hours.

Please enter the text shown below:

The classic layout automatically defaults to the latest Flash Player.

To choose a different player, hold the cursor over your name at the top right of any lynda.com page and choose Site preferencesfrom the dropdown menu.

Continue to classic layout Stay on new layout
Exercise files

Access exercise files from a button right under the course name.

Mark videos as unwatched

Remove icons showing you already watched videos if you want to start over.

Control your viewing experience

Make the video wide, narrow, full-screen, or pop the player out of the page into its own window.

Interactive transcripts

Click on text in the transcript to jump to that spot in the video. As the video plays, the relevant spot in the transcript will be highlighted.

Are you sure you want to delete this note?

No

Notes cannot be added for locked videos.

Thanks for signing up.

We’ll send you a confirmation email shortly.


Sign up and receive emails about lynda.com and our online training library:

Here’s our privacy policy with more details about how we handle your information.

Keep up with news, tips, and latest courses with emails from lynda.com.

Sign up and receive emails about lynda.com and our online training library:

Here’s our privacy policy with more details about how we handle your information.

   
submit Lightbox submit clicked
Terms and conditions of use

We've updated our terms and conditions (now called terms of service).Go
Review and accept our updated terms of service.