TUTORIAL: Using seamless tiles with CSS: Part One
Wow… it’s been a while since I have revisited using seamless tiles, and for those of you looking for a sequel to my “Basics of creating seamless tiles” tutorial, I apologize for the delay.
In writing this, I realized just how much it takes to describe how to do it right, so I decided to break it into a 2 part tutorial.
What we are going to do with these tutorials is combine a seamless tile with a little bit of CSS to create the core of a site template with low bandwidth (because we are using the same image over and over) but high impact. I use pure CSS (no tables for layout) for all of the web work that I do, as there are tons of reasons why. Cleaner code, faster loading, and proper loading of the page in blocks down the screen. There are rumors that it even improves search ranks, as the engines dont have to parse through extra <table> <td> and <tr> tags to get to the content, but from what my SEO colleagues tell me, this is totally unfounded.
If you’d like to do some reading up on using pure CSS for layout, head over here: GLISH or W3SCHOOLS
Okay… so you’ve got your seamless tile that we created in the previous tutorial, right? I’ve got mine!
As this is just going to be another basic seamless tile tutorial to give you an idea of what can be done, we are going to keep things simple. What we are after is a strip of rusted metal overlapping a background of rusted metal centered in the screen, with a dropshadow for depth. This strip will expand to fit whatever content you choose to put in it, yet it will look like one large image.
To achieve this correctly, we’ll need to create the “rails” for the left and right sides of the center strip, which contain the drop shadow to create depth. First, we’ll need to start with the seamless tile in photoshop, and somewhat replicate what CSS does using an image as a background tile.
- Open the tile, double click on ‘background’ in the layer palette, and make it an actual layer.
- Go to IMAGE>>CANVAS SIZE and adjust this to 760px wide.
(the typical ‘live’ area for a browser window) - Duplicate that layer directly left and right of the original, matching up the edges, thus creating a screenful of the texture.
- Drag guides in 20px from the left and right. (or more, if you want a wider shadow effect)
- Create a new layer called ’shadows’, and place a black to white blend inside those outer guided areas. Then set this layer’s properties to linear burn, and opacity to 40%+/-.
(linear burn creates a more realistic drop shadow than multiply, IMHO) - Lastly, what we want to use is the photoshop “slice” feature, which only makes publishing easier. Click on the slice tool in the Tools palette, and drag a ’slice’ area out for each of the shadowed areas, outlined by the guides. The slice tool should ’snap’ right to the guides, ensuring you have the whole 20px wide areas. (make sure the slices are the whole height of your tile)
- Now that the slices are created, select the ’slice select’ tool in the Tools palette. (click and hold the slice tool in the Tools palette, and you will see a knife with an arrow) With the ’slice select’ tool, double click on each of the left and right ’slice’ areas you defined, naming each. I used ‘leftside’ and ‘rightside’ for mine.
- If you haven’t done so already – SAVE!
Now all we have to do is save the files to use in your page. Hopefully, you already have a folder created for this project to keep things tidy. Use FILE>>SAVE FOR WEB to bring up the web image preview. I have mentioned this before, but I have found this is the best method for saving files for the internet, as it strips out much of the ‘bloat’ you get with “SAVE AS” and picking the jpg option, thus resulting in smaller files.
By default, the ’slice select’ tool will be activated. All we want here is that left and right side, so, while holding the shift key down, select the left and right slices. Then set the options to the right to JPEG and about 40-60 quality. (varies depending on the detail in your tile) Once you have the quality adjusted to where its acceptable in the preview, hit SAVE.
Again, hopefully you already have a folder created for this project, which is where you want to save (be sure to put your original seamless tile in there as well, to keep it tidy) In the save dialog, select ‘IMAGES ONLY’ and ‘SELECTED SLICES’, as this is all we need. Leave ‘SETTINGS’ at the default, unless you want more control over the naming. The center and background areas will be filled in via CSS in a minute.
Got it? Good…
now for part two with the CSS. >>PART TWO



August 6th, 2007 at 7:48 pm
OK… I stumbled upon your website while researching about WordPress. You had an article about this site and your css skills. I love this website and the other blog sites you have created. I have created flash sites but not yet any blogs. I have a great idea for a blog that I would like to pursue, but I have no idea on how to start one other than it looks like WordPress is a nice tool and I need a hosting package that supports PHP and MySQL. May I ask the tools you use to host and create your blogs. Any information i greatly appreciate and I would just like to say again that your blogs look great!
August 6th, 2007 at 10:02 pm
Bryce,
First off, thank you for the compliments. It’s always rewarding to hear that the work is appreciated…
But as to your question, the only tools I use to develop the sites are of course the Wordpress core package, Hyperedit (a mac based text editor w/ live php viewing), Photoshop and sometimes Illustrator to lay the initial design out. Wordpress’s template/theme system is awesome, and really easy to pickup, so much as you know html and pure CSS layout to start. (hit http://www.glish.com/css for some basics on using CSS for layout) Then there are the Wordpress plugins, which dramatically expand the package, although occasionally they have comflicts with each other, but thats rare.
And yes, a basic PHP/mySQL hosting package is a must. Personally, I prefer Linux over Windoze for PHP, as it just works better, and you dont have to modify any core code as a workaround for how Win handles php. (as you sometimes do on a windoze box) Godaddy has hosting plans starting at $3.95/mo, which includes 10 mySQL databases and a ton of emails.
But feel free to hit me up on these articles if you have any questions, or you can sometimes find me over on the Yahoo Web Design:1 chat room under macaddict001. I hope these tips and tricks have helped, along with the tutorials on my site…
-Todd
aka Mac