Archive for the ‘tutorials’ Category

Tutorial: Same Height Columns

Sunday, January 10th, 2010

So this is a mini tutorial that will help you (I hope) to achieve the dreaded CSS thingy in just… 10 lines of CSS. And to make it more fun, I’ll use some techniques that will help you to achieve things that most people is afraid of: same height columns!

So, you can see the sample at here

The sample has a header, a 3 columns body and a footer. If you want more or less columns, simply add/delete the column as you want it (and be sure to change the width for each column). In 99% of cases, you won’t want anything more complicated like this.

Are you seeing it? Cool. The html code for the page (without all the lipsum stuff) is as simple as this:

Code:


<div style="text-align: left;" dir="ltr">&lt;!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"&gt;
&lt;html&gt;&lt;head&gt;
&lt;title&gt;Page Title&lt;/title&gt;
&lt;meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" /&gt;
&lt;link rel="stylesheet" type="text/css" href="style.css" /&gt;
&lt;/head&gt;
&lt;body&gt;
&lt;div id="container"&gt;

  &lt;div id="header"&gt;&lt;h1&gt;This is the Header&lt;/h1&gt;&lt;/div&gt;

&lt;!--*************************************START LEFT COLUMN ***********************************************--&gt;

    &lt;div id="leftcol"&gt;&lt;h2&gt;The left column&lt;/h2&gt;&lt;p&gt;And the text for the left column&lt;/p&gt;&lt;/div&gt;

&lt;!--*************************************END LEFT COLUMN ***********************************************--&gt;

&lt;!--*************************************START CENTER COLUMN ***********************************************--&gt;

      &lt;div id="midcol"&gt;&lt;h2&gt;The middle column&lt;/h2&gt;&lt;p&gt;And some text for the center column&lt;/p&gt;

      &lt;/div&gt;

&lt;!--*************************************END CENTER COLUMN ***********************************************--&gt;

&lt;!--*************************************START RIGHT COLUMN ***********************************************--&gt;

    &lt;div id="rightcol"&gt;&lt;h2&gt;The right column&lt;/h2&gt;&lt;p&gt;And then again, some text for the right column&lt;/p&gt;

&lt;/div&gt;

&lt;!--*************************************END RIGHT COLUMN ***********************************************--&gt;

&lt;hr style="display:block; height:0.1em; clear:both; visibility:hidden;" /&gt;
&lt;div id="footer"&gt;Footer&lt;/div&gt;

&lt;/div&gt;
&lt;!--*************************************END MAIN CONTAINER ***********************************************--&gt;
&lt;/body&gt;
&lt;/html&gt;</div>

let’s analyze this: first of all, there’s something that jumps to the view at first sight: COMMENTS! . Yes, they jump to the view because I wanted that and because that’s what comments are for: to help you visualize everything at first glimpse. USE COMMENTS, LOVE COMMENTS, EMBRACE COMMENTS. If you think the 2kb they may add to a page are a bandwidth problem, well… you’re in the wrong business.

Then you have the header (with h1 tag) the cols (named in a way you’ll recognize what they are at first sight) and a footer. You’ll also see some “strange” code, and styled HR, but don’t worry, I’ll go to it later.

Once you have your html, you need to start define elements. I’ll make it sweet and simple: using px instead of ems or percentage, this one uses a container with 960px width, side columns are half of what the main column width is. Here goes the CSS code:

Code:


<div style="text-align: left;" dir="ltr">* {margin:0px; padding:0px;}
body{background:#def5f9; font-family:verdana, helvetica, sans-serif; font-size:0.8em}

#container{position:relative; width:900px; background:#f9f9f9; border:1px solid #900; margin:auto auto; padding: 10px 5px; overflow:hidden; text-align:center; z-index:1;}

#header{width:890px; background:#333; margin:auto auto; padding:16px; margin:-16px; margin-bottom:10px;}
#header h1{color:#fff; text-align:left;}

#leftcol{width:240px; float:left; background:#f6d4d4; padding: 10px 5px; margin:0px 5px; padding-bottom:4000px; margin-bottom:-4000px; }
#midcol{width:360px; float:left; background:#a3f9d8; padding: 10px 5px; margin:0px 5px; padding-bottom:4000px; margin-bottom:-4000px; text-align:left;}
#midcol p{margin-bottom:10px;}
#rightcol{ width:240px; float:left; background:#fa0; padding: 10px 5px; overflow:hidden; margin:0px 5px; padding-bottom:4000px; margin-bottom:-4000px;}

#footer{position:relative; width:890px; background:#333; margin:auto auto; padding:16px; margin:-16px; margin-bottom:10px; height:100px; clear:both; z-index:20; margin-bottom:-20px; margin-top:30px; color:#fff;}</div>

let’s go line by line (or 2 at most)

Code:


<div style="text-align: left;" dir="ltr">* {margin:0px; padding:0px;}
body{background:#def5f9; font-family:verdana, helvetica, sans-serif; font-size:0.8em}</div>

Nothing strange here, just defining the colors and font and reseting all margins and paddings

Code:


<div style="text-align: left;" dir="ltr">#container{position:relative; width:900px; background:#f9f9f9; border:1px solid #900; margin:auto auto; padding: 10px 5px; overflow:hidden; text-align:center; z-index:1;}</div>

now, we add some flavor. Everything is quite straight, but we’ll use position:relative, z-index:1 and overflow:hidden. You won’t normally need them most of the times, but we need it for the 100% height columns and the footer.

Code:


<div style="text-align: left;" dir="ltr">#header{width:890px; background:#333; margin:auto auto; padding:16px; margin:-16px; margin-bottom:10px;}
#header h1{color:#fff; text-align:left;}</div>

The header uses another of my tricks: padding:16px; margin:-16px; This makes sure the width is 100% overriding any margin or padding I may add to the container box. Tricky but effective.

LET’S GO WITH THE COLUMNS!!!!

Code:


<div style="text-align: left;" dir="ltr">#leftcol{width:240px; float:left; background:#f6d4d4; padding: 10px 5px; margin:0px 5px; padding-bottom:4000px; margin-bottom:-4000px; }
#midcol{width:360px; float:left; background:#a3f9d8; padding: 10px 5px; margin:0px 5px; padding-bottom:4000px; margin-bottom:-4000px; text-align:left;}
#rightcol{ width:240px; float:left; background:#fa0; padding: 10px 5px; margin:0px 5px; padding-bottom:4000px; margin-bottom:-4000px;}</div>

The columns are extremely simple in their layout, but you’ll see those 4000px values and will ask yourself WTF! . That’s another of my tricks. By applying a huge padding value to the column and then a huge negative margin, the overflow:hidden we used in the container makes sure all columns are 100% height. Neat, huh? Everything else is just styling (width, bg, color, whatever)

and finally, the footer:

Code:


<div style="text-align: left;" dir="ltr">#footer{position:relative; width:890px; background:#333; margin:auto auto; padding:16px; margin:-16px; margin-bottom:10px; height:100px; clear:both; z-index:20; margin-bottom:-20px; margin-top:30px; color:#fff;}</div>

Here, the overflow:hidden I used in the container box, makes its work again and avoids anything goes “out of the box”. The only special thing I had to keep in mind is to add a z-index higher than the container, or it would be below the columns.

Finally, the misterious HR thing: I use that to add a little space when going wild with positive/negative values and clearing all floats. Dirty, but lovely.

And that’s it! The “impossible to make” in just 10 lines of CSS code. Now you can add divs inside the existing divs or whatever, try new things, experiment and learn!


Tutorial: Mobile tips and tricks

Sunday, January 10th, 2010
Tutorial: Mobile Web Design

Unless you live under a rock in another planet with no intelligent life, you must be aware by now that Mobile Content is the “next big thing”. There’s a lot to say about this conception, personally I find it very difficult to understand. While computer and TV screens are going bigger and bigger and then even bigger, mobile content is going a million steps back. Then again, many people, especially younger people mesmerized by “coolness” likes this way of content delivery, and there’s money to be made off. So… time for some Mobile issues.

First of all, if your site is well done, you won’t need many changes. When I say well done, I mean proper XHTML with both HTML and CSS validating. If you went with a cheap designer that provided some half made product… well, now you have to pay again for a whole new content delivery tour. If your designer used tables… well, whole new tour. If your designer can’t make proper CSS (even if validating), well… whole new tour. Take it as a learning, pay twice for the ‘cheapo’ (hopefully cheap) and continue reading.

Design for Mobile is a whole new different thing. it’s easy and simple but it has to be made TO THE “A”. Content organization and logical flow is key, and so is CSS. As you may imagine, there are not much options with mobile design since its screen doesn’t allow it. However, you can be as complex as you want. And…. fail. Mobile design is about simplicity, in essence it’s like 94/95′s design, only that without the tables.

Once you have a logical structure (you can draw it on paper or make a graph flow for visual help), you can apply the CSS. Personally, I’d use 3 or 4 style sheets and offer them as options. Since my html has to be PERFECT and I’ll use DIVs, I can change everything in a snap via CSS, hence your mobile customers will be able to choose whatever they like.

An idea for organization would be something like this:

the size of this screen is the one you should aim for since it’s the most common: 240×320. However, you can serve different style sheets and detect screen sizes or be smart and use liquid layouts. The choice is yours.

As you may see, this very basic design uses logical semantyc XHTML. It’s simple and to the point, yet it uses some content display that allows you to maximize content delivery using as little space as possible

Another thing to note: Don’t rely on fonts! NEVER! Most mobile devices won’t include any of the fonts you usually will rely on, like Times, Verdana and such. The user has to install them.

For devices using Windows Mobile, it’s a great idea to offer the fonts you want to display in your site so the user can download them.

Obviously, you can use something as Facelift, Flir, AnyFont, whatever, but it’s always a nice idea to deliver the regular fonts for your site as well.

So now we need to display content.

In adult business, you’ll want to display photos and videos rather than text. How to do it AND DO IT WELL is a very tricky question. Personally, I’d use any kind of tool based on JQuery or Prototype to build AJAX apps, but you can do it with php or simply with HTML. The better you do that, the better you’ll do with your mobile site. As a tip, think about this: most people doesn’t have an Iphone, yet everybody loves it. So… why not serve your site emulating Iphone? It’s relatively easy for someone that knows what is he/she doing, and your members will love the slick modern design

Finally, something so basic that it’s borderline ridiculous yet many people doesn’t do: add a bookmark link.

Of course there’s a lot more to mobile content delivery, but for now, I hope this helps to any one willing to enter this competitive market


Tutorial: Creating Rounded Corners with Pure CSS

Sunday, January 10th, 2010
Image taken from w3.org

For those looking for rounded corners for their designs, there’s a lot of techniques throughout the ages, so to say. At first, web designers started with tables, and the only resource was to make several cells to contain rounded corners images. Pretty hideous but it does the trick.

Now, with CSS you can make rounded corners by using only CSS and no images. You may ask yourself “what is this wacko talking about?” since there’s no rounded corners properties in CSS nor CSS2. So the wacko gives you a warm welcome to the kingdom of… CSS3!

Before going further, CSS3 isn’t “oficially” alive, however, a bunch of the new CSS3 properties are available in most browsers, so it’s quite safe to use them (we’ll go further on how to display CSS sheets depending on browsers).

One of the most sough after properties for web designers is the rounded corners property, since it’s one of the main components of so called web 2.0 design (as we’re at it, after 20+ years as a designer, I still have no idea what web 2.0 design is)

So, without further ado, let’s start with the tutorial: 60


Tutorial: Creating Smoke

Sunday, January 10th, 2010
final-smoke

One of the things I saw many people fails at in Photoshop is to create convincing cigarette smoke. It’s just a matter of observation, so it’s really simple when you think about it. Most people thinks about smoke like fluffy clouds. That’s OK… for fluffy clouds. They’re made of steam, while smoke is a very different thing, and cigarette smoke has its particularities. I won’t enter on the physics behind it, but let’s say that cigarette smoke is made of threads of smoke rather than clouds of smoke. And it’s white, almost 100% white.

So without further ado, let’s enter the tutorial

Creating cigarette smoke Photoshop tutorial

First, let’s open a photo with someone smoking. For this example, I took a pic of Lindsay Lohan which also needs some work, so I’ll create the smoke, manipulate it to look as letters and work on enhancing the picture, all in the same tutorial. You can’t complaint, huh? ;)

This is my picture, feel free to choose any other you like

Now that we have the pic to work with, let’s start by the very basic:
1- Open the document
2- Press Ctrl+J to duplicate the background so you have a backup just in case
3- Name the new layer as you like

Creating the smoke
1- Press D to set your foreground and background colors to black and white
2- Create a new layer. Name it smoke
3- From the cigarette, draw an inverted triangle with the lasso tool
4- Go to Filter > Render > Clouds
5- Press Ctrl+F until you get around 70% of white and 30% of black

by now you should have something like this:

6- with the lasso area still selected, make sure you have black set as foreground color and go to Select > Color Range. Make sure you have these values: Select: Sample Colors / Fuzziness: 200 and the Selection ratio checked. Press OK and it will select a little area of your smoke. Delete it (press Del) and you’re done with this step.

7- Press Ctrl+D to deselect everything

8- Now duplicate the layer using Ctrl+J

9- Go to Filters > Distort > Wave and use the following on any one of the layers (click on the image if you don’t see the values):

10 – Select the other layer and change values slightly. From top to bottom I’ve used 5 – 10 – 137 – 15 – 20

11 – You’ll probably need to arrange the layers, maybe flip them horizontally, do it as you see it fits

12 – now set the blending options to Hard Light 100% for the lower layer and Linear Dodge 45% for the upper smoke layer (or play with the blending options as you like). If you need it, adjust curves on any of the layers to make it look as you want.

13 – That’s it! This is what I ended with so far (click to enlarge):

let’s add some pizzaz! This photo needs some retouch, so we’ll do a very fast but nice retouch in a few steps

Fast Photo Retouch

1 – Press Ctrl+A to select everything, then Ctrl+Shift+C to copy all layers combined. Then Ctrl+V to paste it (as you may notice, I use mostly keyword macros, it makes your work really fast, so be sure to learn them!)

2 – Now go to Filters > Blur > Surface Blur . Use the following values: Radius 7 / Threshold: 23 (it may be different for larger or smaller images so those are just guideline values)

3 – Set that layer to Hard Light and 60% (or adjust as desired, those are the values I used)

4 – Duplicate the layer using Ctrl+J

5 – Set the blending options to Screen 45% (or adjust as desired, those are the values I used)

6 – If you need it, create an adjustment layer on top of all layers. You can do so by going to the layers window and you can find it at the bottom. Click on that semi-circle you see with the red arrow and you’ll see a menu. Select Curves and adjust as needed

7 – Done!

Playing with this Photoshop Tutorial

Now I’m sure you can think on many ideas and usages for what you learned in this tutorial. I did something like the following by using a curvy font letter by letter, rasterized it and from there did the same steps I told you previously. It may look like a lot of work but if you learned the key macros, it’s a 3-4 minutes work, check it out!

Hope you liked it, please comment and make as many questions as you want. If you link to this tutorial, give me a shout :)




Page 2 of 212
design portfolio
view more
blog, latest rants, blabbling, marketing

We use the latest technology and design trends to create successful sites with a strong marketing development that helps us give you a product that not only looks good, but it converts better than any other design choice (data based on 3rd party stats). Our speciality were always paysites, but now we develop high end solutions, CMS, TMS, blogs, etc. Using AJAX/AHAH, JQuery, Flash and other media tools, we can provide your site with THAT SPECIAL TOUCH!

Click the button below to know more about what we do or check out our adult website design portfolio!

view more

Categories

Recent entries

Keywords

Archives

Copyright 2008 - FDSign – Adult Design - All Rights Reserved - Design by FDSign