Call us

Make a simple diagonal page background using photoshop and css

Tutorials 24 comments

I have noticed that a lot of visitors are coming here from Google after searching for this tutorial, so, here you go.

1. Open Photoshop and a blank transparent canvas of say 20×20 pixels. Now, zoom right in to about 1200% and select black on your palette and the pencil size 1. Draw a diagonal line from corner to corner (tip : click the first corner, let go and place your pointer on the other corner. Hold “shift” and click again. A straight diagonal line will appear)

Now do the same one pixel either side of the line you have just drawn, so you have a thicker diagonal line.

Do the same again, and then again until you end up with this:

diagonal-1.gif

Now we have to add two little bits in the other corners like the image below.

diagonal-2.gif

Hold “Ctrl” and press “A” to select the whole canvas. Now click “Edit” - “Define Pattern” and call it whatever you like. You can now close that canvas, we have finished with it.

Now, here’s what I do. Open a new canvas say 500×500 with a background colour of whatever you want the background colour of your page to be. I chose blue (#2E3192).

Now add a new layer and select the Paint Bucket tool, select the “Fill” option to “Pattern” and click the little drop down arrow next to it and find your newly added pattern and click on it. Now place the paintbucket inside your canvas and click.

You’ll probably think the lines are too dark, but simply changing the opacity of that layer to something like 20% or 30% will do the trick.

Now, merge your visible layers (click the arrow in the top right of the laters bit and choose “Merge Visible”).

Now drag a guide 20px from the top of the canvas, and another 20px from the left edge and using the rectangle marquee select the top left corner using the guides. Click “Ctrl” and “C” to copy, then “Ctrl” and “N” for a new layer. Click “ok” then “Ctrl” and “V” to paste onto the new layer. You should now have the same as the image below:

diagonal-3.gif

Save this as a .gif and call it something like body-bg.gif so you know what it is.

All you need to do now, is in your CSS file for your website, add the following:

body {
background-image: url(”images/body-bg.gif”);
}

This will now tile your little 20×20 gif all over the page giving the diagonal stripes!!

You can experiment and change the canvas size and draw thicker or thinner lines to achieve different sized lines.

Have a go!

Learn advanced css techniques with CSS Mastery:

CSS Mastery: Advanced Web Standards Solutions

Related Posts

24 Responses to “Make a simple diagonal page background using photoshop and css”

  1. 63 ‘How to’ Posts to Add Spice to Your Day - Group Writing Project Day 1 Says:

    [...] Make a simple diagonal page background using photoshop and css by Ben [...]

  2. Maris Says:

    Nice tutorial, I think it is very helpful for many web designers who start to learn things how to do this and that.
    Thanks!

  3. Ben Says:

    Thanks Maris, it’s surprisingly hard to put into instructions what us web designers take for granted and do every day!

  4. Mama Duck Says:

    Great tutorial & way to interest those visitors! Our list is up as well if you’d like to check it out!!

  5. Matt Says:

    Nice tutorial! I have wanted to do that with a few websites. I kind got the jist of the CSS by looking at some examples of other sites. I like how you show the steps to put the graphic together. My How To is up if you want to check it out.

  6. Ben Says:

    Thanks Matt, my aim is to post more tutorials like this for beginner web designers over the coming weeks / months etc.

  7. Northern Girl Says:

    Hey - thanks for the ‘how to.’ I’ll have to try it, now.

    (Found your post through ProBlogger)

  8. Ben Says:

    Thanks, glad you found it useful

  9. Jersey Girl Says:

    simple and to the point…like that!

  10. Ben Says:

    It’s the only way really :)

  11. Working at Home on the Internet Says:

    [...] 1.? Make a simple diagonal page background using photoshop and css? by Ben [...]

  12. Kristonia Ink! » Full List of ProBlogger How To Contest Submissions Says:

    [...] Make a simple diagonal page background using photoshop and css by Ben [...]

  13. Change your thoughts » Blog Archive » How to posts - loads of them Says:

    [...] Make a simple diagonal page background using photoshop and css by Ben [...]

  14. Ask blushgirl - Romance Advice, Tips and Dating Site Reviews » Blog Archive » Day 1 of the Problogger How-To Articles Submissions Says:

    [...] Make a simple diagonal page background using photoshop and css by Ben [...]

  15. Questallia » Problogger’s ‘How to’ Group Writing Project List Says:

    [...] Make a simple diagonal page background using photoshop and css by Ben [...]

  16. Mark Choon » The Biggest, really humongous, ‘How To’ list ever assembled in 4 days! Says:

    [...] Make a simple diagonal page background using photoshop and css by Ben [...]

  17. Top Of Mind » Blog Archive » How to.. Contest Says:

    [...] Make a simple diagonal page background using photoshop and css by Ben [...]

  18. Chewing Pencils: Helping you make money from drawing cartoons! Says:

    [...] Make a simple diagonal page background using photoshop and css by Ben [...]

  19. Mark Says:

    Hi Ben,

    Nice little trick :)

  20. CJCM and IT » Blog Archive » Problogger’s Group Writing Project Says:

    [...] Make a simple diagonal page background using photoshop and css by Ben [...]

  21. The Scott English Show - » More How To’s then you Could Poke a Stick Says:

    [...] Make a simple diagonal page background using photoshop and css by Ben [...]

  22. Fabio Fidanza Says:

    Take a look at http://www.stripegenerator.com
    You can create stripes background in a snap!

  23. » Make a simple diagonal page background - version 2 Web Design and Development Blog: a journey into elegant web design and best practices Says:

    [...] on from my previous tutorial on how to create the diagonal stripe background, Fabio posted an excellent website that does all the hard work for you. All you need to do is move [...]

  24. » How to create a tiled background for your web page Says:

    [...] covered creating a tiled diagonal background in another post, but this one is even [...]

Leave a Comment