Week 3: CSS Positioning

With a little CSS, your xHTML pages will become mysterious shapeshifters! Like the styles on CSS Zen Garden, our pages will magically transform with a sleight of hand and some well-thought out code. Let’s begin!

Some More Selectors

Class – a custom selector that can be applied to other elements. It uses a “.” before the class name in the stylesheet.

.homepage { font-family:Arial; }

ID - Similar to a class in that it is a custom selector, but used in a different way. It is typically used only once in a document for something that is unique, wheras class can be used for a range of similar elements.

#container { margin:10px; }

Pseudo-class – used to specify a particular state of certain selectors (Ex. a:link, a:hover, a:active, a:visited)

a:hover { text-decoration: underline; }

Fact: LISTS ARE AWESOME.

Not only can you use lists in the body of a document to organize your work experience, hobbies, etc, but you can also use lists to create menus. They can run up and down, left to right, be with or without icons, etc. Let’s see how:

Making them inline:

li {
display: inline;
list-style:circle;
list-style-image: “http://www.url.com/image/list_image.jpg”;
}

CSS layout: The Box Model

box-model

Margin - Clears an area around the border. The margin does not have a background color, and it is completely transparent

  • margin: 10px 20px 30px 40px; (top 10px, right 20px, bottom 30px, left 40px)
  • margin: 10px 20px 30px; (top 10px, right left 20px, bottom 30px)
  • margin: 10px 20px; (top bottom 10px, right left 20px)
  • margin: 10px; (all 10px)

Border - A border that lies around the padding and content. The border is affected by the background color of the box

Padding – Clears an area around the content. The padding is affected by the background color of the box

Content – The content of the box, where text and images appear

Width – Add up the content + padding , border, and margins on both sides.

Visibility - hidden/visible;

Z-Index – Controls the way that the layers are stacked. Higher z-index means the further up the layer will be

Positioning:

  • Relative – The box is positioned relative to where it would normally be.
  • Absolute – The box is positioned in relationship to the window.
  • Float  - Allows block-level elements to sit next to each other, but takes them out of the normal document flow.
  • Clear – Clears the floated items so the document flow can continue.

Paper Prototype

Exercise:

Remake the following layouts

layout1

layout2

Assignment

  1. Download the layout below and recreate it using the CSS that we learned in class. Read the chapter from CSS Mastery (photocopied handout) for useful tips. Upload it with an external css file onto your pratt server.
  2. Read Ch. 4-6 in Don’t Make Me Think.
  3. Read the article on A List Apart on Paper Prototypes.
  4. Find a design/art portfolio site and break it down using a paper prototype.
  5. Change it to suit your own portfolio site.

layout_homework

2 Comments »

  1. [...] See the blog post from last class for more details [...]

  2. Jobana says:

    Hello, here is the link for the homework given last week. I had trouble positioning the ul and li tags under the “work” section. I will try to figure out how to position unordered and ordered lists on the W3Schools website, but in case I don’t figure it out, do you think we can go over this a little bit during class? Thanks.

    Below is the link to my html and css documents.

    http://mysite.pratt.edu/~jsoto3/homework/weekthree/

RSS feed for comments on this post. / TrackBack URI

Leave a Reply

Week 14: Work it!

Almost there! YOU CAN DO IT. I believe in you!!!!

To help you out on your final flash adventures, here are the examples for the day:
Random Animation
Here are some new flash examples.
Sound with Pause
Input Text

Video

The best way to add video for right now is to import the video through the File>Import> Import to Stage menu into an FLV player (top option in the window that opens). You can then convert this video to a moviclip and target as you would other movieclips.

Preloader

Take a look at the example. Basically, I’ve set it up so that it stops on the first frame and keeps checking to see if the whole movie has been loaded (# of bytes). If it has, it plays. Otherwise, it changes the text and the size of the bar. Make sure to simulate download when checking the preloader.

Loader

This is for loading other swf files and jpgs. It’s really handy because then you can build parts separately and add them as needed. It saves on download time, and is great when working in teams.

Sound: Play and Pause

Here, we add some code to our previous simple_sound file in order to keep track of where the song was when we pause it, and then play it in that spot again.

For next week:

We will start at the beginning of class, so have everything ready to go. Test it out, practice a simple presentation of the project, and think of it as an opportunity to practice presenting yourself to an audience. Good luck! I’m looking forward to seeing everyone’s hard work.

Week 13: The Home Stretch!

OMGOMGOMG! Only 2 more classes before the final! Let’s use our time wisely. I’ll run through examples that might be helpful for your final. You ask me questions. Let’s go!

Details »

Week 12: Frame Control, Variables

Check back over the blog post for Week 11, and review the files in the link. To start you thinking about other things that you can do with Actionscript, download this file, and run the examples. See if you can understand how they are programmed.
Details »

Week 11: Actionscript

We’ll take our first look at Actionscript today and talk about our final projects.
Details »

Week 10: Flash

Let’s continue Flash today with Tweens!
Details »

Week 9: Flash!

Flash was always my first love. It combines time-based image editing format with programming and multimedia capabilities! It is a great way to add fluid animation and interaction to your design, and it frees you from the grid constraints of xhtml/css.

Details »

Week 8: Javascript & JQuery

Welcome back! Hope you a restful break and enjoyed the lovely weather. Let’s jump back into things with look at the basic structure of Javascript and JQuery!
Details »

Week 7: Portfolio Presentation and Javascript

Today, you’ll present your portfolio websites and we’ll learn a little Javascript.
Details »

Weeks 5 & 6: Portfolio Lab

We’ll continue working with HTML and CSS today, exploring tables, menus, and images. You’ll begin turning your portfolio designs into live websites!

Details »

Weeks 4: Advanced CSS/Images

Today, we’ll review CSS positioning and explore some tricks with images. We’ll also learn how to use tables and make sitemaps.

Details »