Archive for the ‘CSS’ Category

The Poor Man’s CSS3 Button

Friday, September 3rd, 2010
The Poor Man’s CSS3 Button

I call them Pez

I received a tweet the other day about these cool CSS3 buttons called BonBon Buttons. The site says they are named after the French word for candy, but after looking at them, they look like Pez to me. Hmmm…that is what I will call mine…Pez! Regardless they are very pretty. Even better, the creator of them lists where it won’t work. He was just tooling around one day and made these buttons. Well, I decided to do the “poor man’s version” of those. And unlike the BonBon buttons, my Pez button will work in IE6 as long as you use CSS PIE, with the exception of text-shadow, and the radial gradient. Those two properties don’t add all that much, and even without them they look good in IE.

(more…)

CSS Positioning – Relative and Absolute

Thursday, September 2nd, 2010
CSS Positioning – Relative and Absolute

It takes all types

There are four types of positioning: static, fixed, relative, and absolute. Static is the default position state which means it isn’t positioned. It goes where it normally would on the page. Fixed is positioned relative to the browser window, and won’t move even if the window is scrolled. Relative positioning allows you to use the top, right, bottom, and left CSS properties to position an element relative to where it would appear in the document. Absolute is the tricky one, because it is basically removed from the document, and placed EXACTLY where you want it to go.

A note on :relative

If you position something relative, and then use top and left to shift it over, don’t expect everything below it to shift as well. It still occupies the space in the document normally, you are just shifting it from its initial placement.

(more…)

CSS3 – Just When You Thought You Knew It All

Thursday, August 26th, 2010
CSS3 – Just When You Thought You Knew It All

You can do that?

So I read an article today that I thought was going to suck. Nope, I was wrong. While I knew most of it, there was one thing that popped out at me today. See? Learnin’ all the time! CSS3 has some cool stuff that is easier to do than opening up Photoshop and creating an image for it. If you got my tweet today, which most of my subscribers didn’t because you don’t follow me on twitter (FOLLOW ME!), then you have an inkling of what I am talking about.

(more…)

IE6’s hasLayout and its margin issue

Wednesday, August 11th, 2010
IE6’s hasLayout and its margin issue

IE6 has bugs…let’s kill them

Everyone know how to fix the the double margin IE6 puts on an element that has a left/right margin on it, without using a hack? If not, it’s an easy one…set display to inline. That’s all it takes. Have you ever run into the 3px margin gap though? This took some hunting for me to find out how to fix it. If you have any idea of what I’m talking about, you will know how infuriating it is. A co-worker and I ran into this problem months ago, figured out how to fix it, and forgot about it. The problem came back, and we drew a blank. Basically, we are using a component that says “Hey, if a flash banner is present, use it, otherwise, use this image over here instead.” Well, when it puts the image in, it doesn’t give it a height or a width. Why would that be a problem? Because it doesn’t have ‘Layout’ according to IE.

What does ‘hasLayout’ mean?

I’ll give you the definition that I got from here: “Layout” is an IE/Win proprietary concept that determines how elements draw and bound their content…”.

I would like to be able to explain why this happens, but the link above does a better job of it than I ever could. I just want you aware of what happens. To better illustrate this, take a look at the link below in IE6.

Click here for demo (again, look at it in IE6 – you won’t see it in any other browser).

(more…)

CSS Wish List – Div Shapes

Wednesday, August 4th, 2010
CSS Wish List – Div Shapes

Effects are cool, but come on, it could do more

Note: Comments have been disabled on this article due to an INSANE amount of spam ping comments. Must have been my title or something.

We can all agree that CSS3 added some really cool stuff. Linear gradients alone made it worthwhile for me. Add in border-radius, box/text-shadow, transitions (available in FF 4 if you didn’t know yet) and whatever else I’m forgetting to mention, and you have a pretty good upgrade to CSS. Today though, while working on a site, I was frustrated by something that CSS can’t do. I Google’d the hell out of it, and I couldn’t even get the right topic to come up. It made me stop and think that, ya all those cool effects are great, but there are some things I would like it to do beyond that.

Plotting Div Points

I didn’t think of it until today. I work within a custom content management system that feeds default content into specific sections on the site. I want the main content block, I call a specific ‘id’ on a div, and boom, it throws in some default content pertaining to whatever market I am building for. The problem though, is I can’t put a div/image/whatever into that content block, until after the site is ordered. Not a problem if I am building a custom site, because I have the ability to change that content. If I am building a template site though, I don’t have that ability because it has to fit any number of clients. What I needed today, was to wrap text around another div. See the image below and you will see what I mean.

CSS Demands image

NOTE: I think I am going to build this and sell the template here, so if you are interested, contact me!

(more…)