Fluid Design

Kat Giles & Tammy Gray

Quick Overview:

What is XHTML?

Quick Overview:

What is CSS?

Quick Overview:

Separation of Style & Content

Design Styles Overview

Static Design

Design Styles Overview

Fluid Design

Fluid Design Overview

Why is Fluid Design important?

Fluid Design Overview

When should you use fluid design?

Designing Fluid Sites

Screen resolution

Designing Fluid Sites

DIVS

Designing Fluid Sites

Units of measurement

Designing Fluid Sites

Units of measurement

Designing Fluid Sites

Images

Step by Step

Step by Step

Step by Step

Step by Step

Sliding Doors

A web design technique that applies principles of fluid design to the use of images on a site.

Sliding Doors

Introduction

Currently, CSS only allows one background image to be applied to each HTML element. This is a cause for designers to use static images for site design. Sliding doors utilizes the aspect of CSS that allows layers to "slide" over each other allowing images to be fluid.

Sliding Doors

Benefits

Sliding Doors

How it is a part of fluid design

Fluid design already causes layers to expand and collapse. Sliding Doors is an application of fluidity to images.

Sliding Doors - How to:

Going back to the static site, we have images for our menu and border, but in our fluid site, we have CSS styled tabs and border. In order for us to use an image menu or border on our fluid site, we will need to cut up the image and use sliding doors.

Sliding Doors - How to:

So, the first step would be to cut up your images for the new design. We've already taken care of that for you, so we can move to the actual coding.

We'll work on the menu first then we'll work on the border.

Sliding Doors - How to: Menu

For the menu, we will not have to edit the HTML, only the CSS.

We're going to float our menu list items and add a background that's attached to the top right of the li element.

Sliding Doors - How to: Menu

#menu {
float: left;
width: 100%;
background-color: transparent;
}

Sliding Doors - How to: Menu

#menu ul {
list-style: none;
}

Sliding Doors - How to: Menu

#menu ul li {
float: left;
background-image: url(../images/tabright.jpg) no-repeat right top;
background-position: top right;
background-repeat: no-repeat;
margin-right: 4px;
}

Sliding Doors - How to: Menu

#content_container {
clear: both;
background: #9cc;
border:1px solid black;
width: 100%;
}

Sliding Doors - How to: Menu

Now, we're going to go ahead and change the a element to contain the left part of the image. We'll also float these left, add display, and change the padding a little.

Sliding Doors - How to: Menu

#menu ul li a {
float: left;
display: block;
background-image: url(../images/tableft.jpg);
background-position: top left;
background-repeat: no-repeat;
padding: 5px 10px 1px 8px;
color: #000;
text-decoration: none;
}

Sliding Doors - How to: Menu

#menu ul li a:hover {
float: left;
display: block;
background-image: url(../images/tableft.jpg);
background-position: top left;
background-repeat: no-repeat;
padding: 5px 10px 1px 8px;
color: #fff;
}

Sliding Doors - How to: Border

For our border to work, we need a div for each of the 8 image slices. We'll put one of these slices on the container div, but the rest will have their own. So, we have left, right, bottom for the sides (top is the container div). Then we have topleft, topright, bottomleft, and bottomright for the corners. The corners come after the sides so they will slide over the lower layers and be positioned properly.

Sliding Doors - How to: Border

After the line that says <div id="container"> and before <div id="content">, we are going to add these lines:

<div id="right"><div id="left"><div id="bottom">
<div id="topleft"><div id="bottomright">
<div id="bottomleft"><div id="topright">

Sliding Doors - How to: Border

So, we'll have this:

<div id="container">
<div id="right"><div id="left"><div id="bottom">
<div id="topleft"><div id="bottomright">
<div id="bottomleft"><div id="topright">
<div id="content">

Sliding Doors - How to: Border

Then, after

<div id="footer">
<p>Presenters: Kat Giles &amp; Tammy Gray.</p>
</div>
</div>

And before

</div>
</body>
</html>

Sliding Doors - How to: Border

We will add:

</div></div></div></div>
</div></div></div>

Sliding Doors - How to: Border

So, we'll have this:

<div id="footer">
<p>Presenters: Kat Giles &amp; Tammy Gray.</p>
</div>
</div>
</div></div></div></div>
</div></div></div>
</div>
</body>
</html>

Sliding Doors - How to: Border

For the CSS, all we need to do is add one line for each div: a background element, but we are going to change some padding to make it look nice.

To the container div we will add:
background-image: url(../images/border_top.gif);
background-position: top left;
background-repeat: repeat-x;

and remove the border.

Sliding Doors - How to: Border

#container {
margin: 20px auto 0 auto;
width: 90%;
background: #8ccce6; background-image: url(../images/border_top.gif);
background-position: top left;
background-repeat: repeat-x;
}

Sliding Doors - How to: Border

Now, content's left margin will change from 10px to 20px:

#content {
padding: 7px 0 0 0;
margin-left: 20px;
width: 90%;
}

Sliding Doors - How to: Border

Also, footer's padding will change from 5px to 7px:

#footer {
clear: both;
padding: 7px;
text-align: center;
}

Sliding Doors - How to: Border

Now, we'll just add the new divs that we created in our HTML and add a background property with the corresponding image.

Sliding Doors - How to: Border

#right {
background-image: url(../images/border_right.gif);
background-position: top right;
background-repeat: repeat-y;
}
#left {
background-image: url(../images/border_left.gif);
background-position: top left;
background-repeat: repeat-y;
}

Sliding Doors - How to: Border

#bottom {
background-image: url(../images/border_bottom.gif);
background-position: bottom left;
background-repeat: repeat-x;
}

Sliding Doors - How to: Border

#topright {
background-image: url(../images/topright.gif);
background-position: top right;
background-repeat: no-repeat;
}
#topleft {
background-image: url(../images/topleft.gif);
background-position: top left;
background-repeat: no-repeat;
}

Sliding Doors - How to: Border

#bottomleft {
background-image: url(../images/bottomleft.gif);
background-position: bottom left;
background-repeat: no-repeat;
}
#bottomright {
background-image: url(../images/bottomright.gif);
background-position: bottom right;
background-repeat: no-repeat;
}