Feb
24
2010
ilz

So often I’ll be working on a website that somebody else coded and have to strip out junk styling. There are a lot of different ways to accomplish the same thing with CSS, but so many people have no idea how much time they are wasting by coding something in a “hacky” manner.
Example.
I was working on a site the other day and noticed that every single paragraph in the main content area of every page of the site had a class of “first-paragraph” on it. So I looked in the external sheet and saw that this was simply to remove the top margin on the first paragraph on every page. Ok, so that method worked..great. Except that manually adding a class to every paragraph tag is such a waste of time. Check out the demo where I show an example of targeting the first paragraph in a content area without adding any classes or IDs paragraph tag in the XHTML. Then keep reading to see how to properly code the example above.
View Demo
Continue reading
no comments | tags: CSS | posted in CSS, Code Snippets
Dec
26
2009
ilz

Popups suck.
The good thing is you don’t see that many of them any more. That’s because browsers recognize that they suck and are most likely spam or ads and so they block the popups. The old way of creating a popup was to force open a new browser window over the current browser window. So this is what browsers block. But what if you actually have a need to use a popup window for something useful and not spammy? This happened to me the other day. A client wanted a popup window on their homepage to wish everyone a Merry Christmas.
Knowing I couldn’t use the old popup method, I went searching. I knew it’d be easy enough to use CSS to put a floating div over the content of the site, which creates a popup effect. The problem was how do you close the popup once it’s open? Javascript would be needed for this. Check out the demo I setup which shows how the CSS popup can be set to open on pageload or by clicking on a link; and then how Javascript allows you to have a “close” button that shuts or hides the popup. Then continue reading for the code and downloadable files.
View Demo
Continue reading
2 comments | tags: CSS, Javascript, Pop Up, Popup | posted in CSS, Code Snippets, Downloads, Web Design
Dec
12
2009
ilz

I create a couple of forms a week for client’s websites. Usually they’re very similar in content. First Name, Last Name, Address, Phone Number, Email, Comments, etc. Of course I like to use a little CSS to style these forms up to match the rest of the site. I find myself copying the same basic styles over from the last form I created, and then editing the background colors and borders of the inputs, buttons, etc. I decided it was time to put these base styles online so they would be easy to grab on any project. And of course hopefully this will help other designers realize how simple the process is, and why there should never be an un-styled form on a website.
Check out the demos to see how by changing a couple of CSS rules you can create a completely different looking form to match your website. Then continue reading to see how the CSS code works for this. When viewing the demo forms, try typing in the fields to see how the background color of the fields can be changed, as can the color of the text in the field. Also, try to roll your mouse over the buttons to see how they can have rollover effects put on them.
View Demo 1
View Demo 2
View Demo 3
Continue reading
1 comment | posted in CSS, Code Snippets
Dec
9
2009
ilz

Recently I was setting up CSS styles for a navigation. One thing I do a lot is change the cursor type with CSS for the link of the current page. So if you are on the About page and you roll over the About link, your cursor will be the default arrow, not the hand pointing the finger which indicates a link. Sure it’s still a link, but I feel this helps distinguish the page you are currently on a little bit further than just changing the color of the current page link.
As I was doing this styling I realized that there are actually quite a number of different cursor types that can be set with the CSS cursor property. Keep reading to see the examples and code for each.
Continue reading
no comments | posted in CSS, Code Snippets
Dec
8
2009
ilz

In a previous post I showed possibly the easiest way to embed a Twitter feed on your website. This brought up a couple of questions from some users.
1. Can you make a background behind individual Tweets?
2. Can you put the date on it’s own separate line?
As the case goes with a lot of things these days jQuery to the rescue! Check out the demo to see both of these things in action, and then continue reading to see how to accomplish these things with jQuery and download the source files.
View Demo Continue reading
1 comment | tags: CSS, Javascript, JQuery, Twit | posted in CSS, Code Snippets, Downloads, JQuery, Javascript
Dec
6
2009
ilz

Recently I was put in charge of creating a product slider for a client’s website. There would be four products shown at a time, with one new product being revealed each time as the slider moved from the right to the left. I figured there was a jQuery slider out there that I could manipulate for this, and after a little hunting I found one.
The actual slider and website I created it for isn’t live yet. I used the base slider I created and used a few Apple images to show the general idea in the demo. So check out the demo, and then keep reading to see the details.
View Demo
Continue reading
1 comment | posted in CSS, Downloads, JQuery, Javascript
Nov
23
2009
ilz

I showed in a previous post how to use text-shadow with CSS3. Now it’s time to move on to something that’s just about as exciting, using Box-Shadow with CSS3. Throw it on a div, on a table, on an image.. anything goes! Of course it doesn’t work in every browser, but then again not much I talk about on this site does!
Check out the demo to see some examples and then keep reading to find out how to use Box-Shadow.
View Demo
Continue reading
8 comments | tags: Box-Shadow, CSS, CSS3 | posted in CSS, Code Snippets, Web Design
Nov
16
2009
ilz

Remember the old days when the only way to create a shadow on text was to make it an image? That’s good for search engines..right? Oh sure, just use some image replacement and then the search engines can read it. Not so easy for text edits in the future. Or for changing the color of the text or the background behind the text.
Fastforward to CSS3. Now we can define a shadow behind live text on a website. Wiggity whaaat? That’s right, simply with some good old CSS. Of course you’ll need to use a real browser, as of any other cool CSS technique, but I won’t even begin to go into that topic. So why is this so great?
- Search engines can read the text
- Easily change the color of the text
- Easily change the color, size, or blur of the shadow
- Easily change the background color or image behind the text
- Your friends will be like totally impressed
An example of this is the title to every article on this lil website of mine. Do you see the shadow behind the title “Using Text-Shadow with CSS3“? If you don’t for the love of god.. DOWNLOAD FIREFOX! Check out the demo for some more examples of text-shadow created with CSS3, and then continue reading to learn how to write the CSS.
View Demo
Continue reading
1 comment | tags: CSS, CSS3, Text-Shadow | posted in CSS, Code Snippets
Oct
29
2009
ilz

Ya.. I said “Web 2.0“.. what?
Well if you’re still here after that, here’s the deal. I was reading an interesting tutorial about creating a button similar to the one found on the Campaign Monitor website. I actually went ahead and created the button, I always love seeing the approach other designers take at creating things in Photoshop.
Well after I created it I figured I may as well put the PSD file up here for anyone that wants to use it. I’ll give the CSS code to add it to your website as a CSS sprite also. Now I need to give credit where credit is due. The CSS code, and the tutorial of how to make the button are from Jacob Gube over at Six Revisions. Check out that link if you want the step by step of how to make this button.
I’m really putting it up here so I’ll have easy access to the PSD file in the future so I can download it no-matter where I am, make a few color adjustments, copy the CSS code, and have a new button for whatever I’m working on that day. Check out the demo to see the button in action, and feel free to download the PSD file of my version of the button. Keep reading for the CSS code.
View Demo
Download PSD File
Continue reading
no comments | tags: CSS, Downloads, Freebies, Photoshop, Web 2.0 | posted in CSS, Code Snippets, Downloads, Freebies, Web Design
Oct
26
2009
ilz

Here’s another interesting thing you can do with your CSS to style your website. We’ve all selected text from a webpage with our cursor before right? But most likely you never put any thought into what the default background color of the text was when you were selecting it. That is unless the website has a blue background and you can’t see what you’re selecting because the default background color of text on selection is blue, causing it to blend in.
Lets get right to the example I set up so you can see what I’m talking about. Not only can you control the background color of the text when you select it with your cursor, but you can also change the color of the text itself on select.
View Demo
Continue reading
no comments | tags: CSS, Text Selection | posted in CSS, Code Snippets, Web Design
Oct
19
2009
ilz

Using an unordered list is a simple and easy to style method of creating a navigation bar. Now with CSS3 and round corners created by the browser, it’s even easier to make a nice and clean nav. I introduced CSS3’s border-radius in a previous post, located here.
Check out the example I created, and then keep reading to find out how to create the above nav with nothing more than some CSS.
View Demo
Continue reading
no comments | tags: CSS, CSS3 | posted in CSS, Tutorials, Web Design
Oct
4
2009
ilz
If you’ve designed websites before you know what a pain making rounded corners on a box can be. You can make an image of a box with rounded corners in Photoshop and use it as a background-image on a div. The problem with this is that the content can’t ever become wider or longer, or it would be outside the box.
You can make separate images for the top rounded corners, the middle content section, and the bottom rounded corners. With this method you make the middle background image repeat on the y-axis as the content grows longer, which forces the box to grow and the bottom rounded corners to expand.
That’s a much better option, but still takes some time to create the images and set up the box. And of course if you want to change the color of the box or border you need to create new images.
And then there was CSS3. One of the most exciting things of the new CSS3 spec is “border-radius”. What this means is that you can define the radius of any of the corners of a box, creating rounded corners. This is of course the ultimate, since the colors of the box and borders can be changed; and the box can grow wider and longer as content is expanded or enlarged. As with the other CSS3 features, all browsers don’t support this yet. So at this time it’s best to use it in situations where it helps visually, but doesn’t destroy the design if it doesn’t work in a browser. For example, check out the top of my twitter page in Internet Explorer (which doesn’t support border-radius), and Firefox (which does).


Continue reading
4 comments | posted in CSS, Code Snippets, Web Design
Sep
27
2009
ilz
Recently released was a book by Dan Cederholm called Web Standards Solutions, The Markup and Style Handbook. This is the follow-up to an earlier version of the book. This brings up two questions.
1. Do you need this book if you have neither version?
2. If you do have the first version is it worth purchasing the new version?
Keep reading to find out.

Continue reading
no comments | tags: CSS, Semantic, Web Design, Web Standards, Web Standards Solutions, XHTML | posted in Book Review, CSS, Web Design
Recent Comments