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 CS4
Illustration by

Creating a liquid CSS-based layout


From:

Creating a First Web Site with Dreamweaver CS4

with Paul Trani

Video: Creating a liquid CSS-based layout

CSS based layouts are also extremely flexible, allowing for a lot of creative control that you might want to be consider including what's called a liquid layout. And that's what I want to do here. Currently this layout is more of the fixed layout. That means if I'm scaling the browser, my content is at a fixed position and doesn't scale with the browser and what I want to happen is I want this content to always be centered in the browser regardless of the size of the browser.

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 CS4
2h 41m Beginner Sep 16, 2009

Viewers: in countries Watching now:

Creating a First Web Site with Dreamweaver CS4 shows the basics of doing just that—building a first web site. Adobe Certified Instructor Paul Trani walks through the important steps of creating a web site from concept to publishing, using Dreamweaver CS4. He teaches how to create basic web pages, add text and image content, use Cascading Style Sheets for design and layout, create a photo gallery, and even check the final site for browser compatibility. He also demonstrates how to create a contact form to encourage viewer feedback on the site. Exercise files accompany the course.

Topics include:
  • Exploring the Dreamweaver workspace for first-time users
  • Linking to external web pages and sites
  • Improving the presentation of text and images on the site
  • Building a layout using Cascading Style Sheets
  • Making navigation reusable across multiple pages
  • Displaying content using the Accordion widget
  • Creating a contact form and sending data from it
  • Making the final site search engine-friendly
Subjects:
Web Web Design Projects
Software:
Dreamweaver
Author:
Paul Trani

Creating a liquid CSS-based layout

CSS based layouts are also extremely flexible, allowing for a lot of creative control that you might want to be consider including what's called a liquid layout. And that's what I want to do here. Currently this layout is more of the fixed layout. That means if I'm scaling the browser, my content is at a fixed position and doesn't scale with the browser and what I want to happen is I want this content to always be centered in the browser regardless of the size of the browser.

So, not only center the content but also I want this content to scale based on the size of the browser. So if I have the browser smaller, I want all of this content to be centered and then scaled down to about 70% of the browser. So that's the size of the Box that I want. If you scale down the browser or scale it up, it always going to take about 70% of the browser size. So again centering and then scaling is what I'm going to work on. So I'm going to close this browser and go into Dreamweaver.

And from here what I want to do is I need to center all of this content, I need to make sure it's centered. So all of this body content, I need to center. So I'm going to go to my CSS Styles panel, I'm going to go down to body, and I'm going to double-click on the body element. And from the Category area I'm going to choose Block. From here I'm going to change the Text-align to center. So that's going to center all of the body content.

In fact if I select OK, you will see sure enough it centers everything. So that's looking pretty good so far but I do have an issue with this paragraph text, which I need to fix. I would really like it to be kind sort of left aligned as opposed to centered. So that means I need to add it because if I look in my CSS Styles panel, there is no paragraph style, there is no P style. So that's what I need to add. So I'm go to my CSS Styles panel and down at the base of the panel, you will notice this little New CSS Rule icon.

You can just click on it. And that will bring up this New CSS Rule dialog box. So what I need to do is I need to redefine the p tag. So I'm going to Tag which is me just redefining an HTML element. And since my cursor was already in the paragraph area it automatically populates that with p. So this selector name will apply your rule to all of the p elements, which is just fine. That's cool. I'm going to select OK, and sure enough I get the opportunity to define this CSS Rule and really I'm going to go down to Block and for Text-align, I'm going to go ahead and left align it. I select OK.

It left aligns all of that text. This commonly might happen. It might shift other things because say for instance if you take this nav, I would really want this nav to be centered. But it shifted it to the left and it's because this is in a P tag. So I can remove any of that formatting I want using my Properties panel. I'm going to go to Format. You can see it has the p tag or the Paragraph style applied to it. Well, I can always change that to None and it's going to center that nav. Perfect! Now everything is centered, in place.

It's looking pretty good. But what I want to do now is focus on this Box. This content box is what I need to change now, so I'm go to Properties and I'm going to change the content element. In my CSS Styles panel, I'm going to go to content and I'm going to double-click on it. And for this Rule definition I'm going to modify two areas. I'm going to focus on the Box area and then we'll work on Positioning. For the Box area, I need to not necessarily have the Width 700 pixels but I want this to be a percentage.

So I'm going to type in 70 and then change pixels to %. So it's going to be 70%, the Width of the browser. But I also need to modify the Margin area. I don't want it to necessarily scale from the Top to the Bottom, so I need to un-check Same for all. But in the Margin area I want to change the Top to 0 and the Bottom to 0. So I don't want there to be any Margin at the top or at the bottom. But what I do need to modify is I need to make sure the Margin, which is the space between the Box and the browser.

I need this Margin area to always be automatically adjusting. So what I need to type in this Right input text field is auto, so it's going to automatically adjust depending on the Width of the browser. Same thing for the left side, I'm going to type in auto there. And in effect this is going to be roughly 15%, and this is going to be 15%. And then the other 70% is actually the content box. So that's looking pretty good, in fact I'll click Apply, and it does change it a little bit.

But I still need to modify one other area. So I'm going to go to Category, down to Positioning, and in here you can see that the Width does says 70%. But the Position says absolute, which is totally unnecessary. So I can actually remove that, just like that. In fact there is some other positioning elements that I can remove as well because I don't need this absolute positioning. I'm going to remove most of those fields, click Apply, and then we can see it center of the content. It's looking good so far, so I'm going to select OK.

And I'm going to go to File, and save this page. Then I'm go to File, and preview this in the browser. And here is the moment of truth. It does the center of the content, oh yes. It not only centers the content but it scales it. So it's always 70% of the browser. The left and right sides are both about 15%. And really it's working well. Regardless of what's sort of size monitor you are on, you are going to be able to read this content.

So again, CSS is a really effective way and a real flexible way to create a layout and modify a layout depending on what you are going for with your website.

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


Expand all | Collapse all
please wait ...
Q: After creating the website as instructed in the tutorial, and uploading the site to the internet, the website does not seem to work for every browser. How can one make sure that the website will work for all browsers?
A: An important step when creating a website is to check for browser compatibility. To do so in Dreamweaver, go to Window > Results > Browser Compatibility. Click the Play icon in the left corner then go to Settings and target the browsers you¹re after. Then hit the Play button to run it and check the page that’s open. If there’s an issue, best-case scenario, it should show you what the issue is and link out to a solution. Worst case is that it’s a pretty unique issue, in which case further troubleshooting would be needed.

Q: The background image is tiling, instead of being one large image. How is this corrected in Dreamweaver?
A: This can be corrected by using a larger image, something around 1024x768 that will fill up most of the monitor space. The issue is that the background image is just too small. Note that tiling of the background image can be turned off in the CSS Panel, but that would only result in a single small image. So it’s better to just use a larger image for the background.
Q: When trying to import SWF content, I get a message: “This file is outside the root folder of site ‘xxxxx’ and may not be accessible when you publish the site.” What is causing this?
A: Make sure your SWF file (and all files you put on a page) are located in your local site. Basically make sure you set up a local site in the site panel. It will ask where to put your local site on your computer. Just make sure you SWF is in that folder and you won’t get that error.
 
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 CS4.

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.