<body><script type="text/javascript"> function setAttributeOnload(object, attribute, val) { if(window.addEventListener) { window.addEventListener('load', function(){ object[attribute] = val; }, false); } else { window.attachEvent('onload', function(){ object[attribute] = val; }); } } </script> <div id="navbar-iframe-container"></div> <script type="text/javascript" src="https://apis.google.com/js/platform.js"></script> <script type="text/javascript"> gapi.load("gapi.iframes:gapi.iframes.style.bubble", function() { if (gapi.iframes && gapi.iframes.getContext) { gapi.iframes.getContext().openChild({ url: 'https://www.blogger.com/navbar.g?targetBlogID\x3d12701251\x26blogName\x3dErik+the+Half+a+Bee\x26publishMode\x3dPUBLISH_MODE_BLOGSPOT\x26navbarType\x3dTAN\x26layoutType\x3dCLASSIC\x26searchRoot\x3dhttps://erikumenhofer.blogspot.com/search\x26blogLocale\x3den\x26v\x3d2\x26homepageUrl\x3dhttp://erikumenhofer.blogspot.com/\x26vt\x3d3271029393528449060', where: document.getElementById("navbar-iframe-container"), id: "navbar-iframe", messageHandlersFilter: gapi.iframes.CROSS_ORIGIN_IFRAMES_FILTER, messageHandlers: { 'blogger-ping': function() {} } }); } }); </script>

Erik The Half a Bee

Photo Sharing and Video Hosting at Photobucket

I am a part time nerd, part time chef and full time whiner. Did I type whiner? I meant winner...no wait, I whine a lot. I've worked in High Tech and Television and a few places in between. I've eaten fire roasted snakes and hand fulls of peeps (not in the same sitting of course). I'd like to share my experiences, so read on.

Stupid CSS Tricks

Running around the web I've been collecting some nice little CSS tricks that can be applied to various applications. Let me know if you think they are cool. Try each out, they can be applied to anything you can think of.

Some of the information was gathered from these site which offer amazing insights into the world of CSS. If you can think of it, you can do it in CSS.

Zen Garden: CSS Resources
A List Apart: CSS
A List Apart: Typography

Transparent Images and Objects:

#item {
filter:alpha(opacity=50);
// This is for IE to handle it

-moz-opacity:0.5;
// This is for older mozillas/netscapes

opacity: 0.5;
// This is for Safari and Firefox types
}


Drop Shadows on text and images:
.img-shadow {
float:left;
background: url(shadowAlpha.png)
no-repeat bottom right !important;
background: url(shadow.gif)
no-repeat bottom right;
margin: 10px 0 0 10px !important;
margin: 10px 0 0 5px;
}



You see here, we're making a shadow image under it,
and a then an alpha and making it priority with !important.

.img-shadow img {
display: block;
position: relative;
background-color: #fff;
border: 1px solid #a9a9a9;
margin: -6px 6px 6px -6px;
padding: 4px;
}


Finally we move it -6 pixels to offset it and reveal the under shadow. Here's some code for simple shadow text. No under images used.

#example {
font-family: Verdana;
font-size: 1.6em;
font-weight: bold;
color: #c60;
}
div[id=example] {
// Without the ID, you'll set all div's
color: #000 !important;
}
#example:after {
content: 'Web-Graphics';
color: #c60;
display: block;
text-indent: -0.1ex;
margin-top: -1.3em;
}

This is kind of neat, can be used to replace form buttons. As you can see below you are just adjusting the size of the borders to mimic a button. On hover it looks as if you've pushed it in. It's a neat trick. I pulled this from Craigslist.org.

a.flag:link, a.flag:visited, a.flag:hover {
font: small-caption;
padding: 1px;
background-color: #f5f5f5;
color: #000;
text-decoration: none;
}
a.flag:link, a.flag:visited {
border-top: 1px solid #cecece;
border-bottom: 2px solid #8a8a8a;
border-left: 1px solid #cecece;
border-right: 2px solid #8a8a8a;
}
a.flag:hover {
border-bottom: 1px solid #cecece;
border-top: 2px solid #8a8a8a;
border-right: 1px solid #cecece;
border-left: 2px solid #8a8a8a;
}


Acknowledgments: Andreas and Domedia. They provided some of the code used here. Click on each for more info on each subject.

You can leave your response or bookmark this post to del.icio.us by using the links below.
Comment | Bookmark | Go to end