Categories
Interests

Rollover dynamic text with CSS

Ok, technically it’s not dynamic because you have to enter the text in the html so it’s not “created on the fly”.  This is still a cool feature if you wanted a list of terms and have the definition pop up on the page as the visitor rolls over the definition.  And the best part of this it’s pure CSS, no javascript.  Once again, this is dynamic so it scales to the size of the page and it has been tested and works on IE, Chrome, Safari, and Firefox on a Win7 box.  Your mileage may vary.

Without further ado, here’s the HTML and CSS as well as a link to a working example.

Categories
Professional

Pure CSS two column page

I’ve been working on a web page that I want a left hand menu column on with the content being on the right.  Pretty easy right?  Well, yeah, unless you want a background color in the left hand column and you want it to extend all the way down to the footer, especially if the right hand column is longer than the left.  Well I did some web searching and what I came up with was the suggestion of putting an image as a background to create a virtual image… which is great if you want a fixed width column.  So after doing some looking I found a way to do it with CSS.  Now I by no means claim to be the originator, but I didn’t find this solution by searching google.

The results of the code below can be seen here (http://www.servergoon.com/samples/2column.html) , and yes, I purposefully used Red Green and Blue just so the concept would stand out a bit more.  The CSS attached to the html page is minimal to achieve what I wanted, please feel free to take it and use it as you may.  I’ve tested this on Chrome, Safari, Opera, Firefox and IE on a Win7 machine.  As always, your mileage may vary.

The code for the web page is :

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Untitled Document</title>
<link href="style.css" rel="stylesheet" type="text/css" />
</head>

<body>
<div class="header"> header </div>
<div class="content">
  <div class="contentLeft">
<ul><li>item1</li><li>item2</li><li>item3</li></ul>
 </div>
  <div>
  <p>Est purus in enim amet. In placerat integer in, platea porttitor, pulvinar elit aliquam nunc est, dapibus a aliquam odio amet. Elementum, urna magna sit? Placerat, sociis tristique ac hac! Pid aliquam aenean ac augue? In turpis aliquet amet, nunc massa etiam sit pid dapibus, lundium lectus augue. Sed a arcu et? Enim tortor sagittis? Augue? Sit scelerisque, duis eu, facilisis phasellus nisi elit porttitor, nascetur duis et augue purus tincidunt etiam. Dictumst sit in pulvinar phasellus, turpis, montes est, a ultrices nec tortor, rhoncus quis magnis? Nunc enim ut turpis pulvinar, duis dis non, elementum, augue dictumst in magna dis odio non et enim? Etiam! In purus parturient ridiculus. Nisi integer? Dis pulvinar proin turpis sed a a urna.</p>

<p>Porttitor dapibus purus? Aenean etiam? Turpis urna porta hac? Nunc amet, scelerisque? Vel in, ac? Habitasse pulvinar, natoque diam, ultricies nec scelerisque aliquam, pulvinar turpis, non! Tincidunt. Platea elit, mauris ac porta adipiscing! Nisi dignissim, proin auctor risus nec dapibus porttitor velit cras! Ridiculus? Odio integer lorem diam porttitor odio platea et tortor elementum! A, aliquam cras tincidunt in? Tincidunt duis, ut dapibus lectus et scelerisque, parturient urna, a massa ac, nunc cras turpis, aliquam, mus porttitor? Magna parturient phasellus in ac, est natoque tortor non. Adipiscing! Turpis ultricies, placerat turpis cum turpis adipiscing turpis. Elit turpis in integer? Pulvinar, est, odio aliquam tincidunt! Adipiscing dignissim, dignissim? Magnis auctor, a porta, lorem in mattis! Scelerisque phasellus rhoncus! Lundium tempor.</p>
</div>
</div>
<div> footer </div>
</body>
</html>

The css for the page is :

@charset "utf-8";
/* CSS Document */

.header {
	background-color:#00F;
	width:100%;
}
.content {
	width:100%;
	background-color:#FFF;
	clear:both;
	overflow:hidden;
}

.contentLeft{
	width:25%;
	margin-bottom:-999px;
	padding-bottom:999px;
	border-right:solid #000 1px;
	float:left;
	background-color:#0F0;

}
.contentRight{
	width:74%;
	float:right;
}
.footer{
	background-color:#F00;
	width:100%;
}

I hope you find this useful. It seem the key is the margin-bottom and padding-bottom in conjunction with the overflow:hidden of the containing folder.

–Server Goon

Categories
Interests

Road Rage part 2

First off, wow, been a while since I posted anything!  And second, told you there would be another post about road rage (see previous post).

Just for the record, I’m not a perfect driver, sometimes I do *ahem* stupid things.  Having said that, I feel it’s fair to comment on other drives and what stupid things they do.

It all started out rather fun, my brother and I was taking a motorcycle trip to see an Aunt and then we were going to put a few more miles and states on the bike (so far I’m ahead with 11 states under my “motorcycle” belt, at some point I hope to have all 50).  The first day’s itinerary was to get to my Aunt’s and I would like to say it was without incident, but that would be a lie.  It’s also a story for another day because what I’m talking about today happened on day 2 of our 3 day trip.

We were in Illinois on Route 1 when it happened.  Route 1 for the most part is a two lane highway with sections that are four lanes.  The particular stretch at the start was a four lane highway through a town with a speed limit of 35.  My brother and I were traveling at about 50MPH and keeping up with the flow of traffic.  That’s when I noticed a guy coming up behind pretty fast in an burnt orange mustang.  The lane to the right was clear but he stayed right behind my brother and I.  I decided to be nice and moved over to the right lane at which point he sped up to right behind my brother and started honking the horn.  When my brother moved over I heard the engine rev and he took off like a speed racer only to slam on the brakes to avoid hitting the car that we were following.  I immediately thought to myself “what a jackass”.

As we traveled through several smaller towns the guy was never more than two or three cars ahead.  We eventually got to a stretch of two lane road and ended up behind the same Mustang.  It seemed like it was hundreds of miles, but it was probably only 20 or 30 that we followed this guy.  The whole time he was weaving left and right, speeding up and slowing down while following the Chevy truck that was in front of him.  At one point, he even had his right hand turn signal on for probably five miles.  I told my brother at one point (probably at one of the crossroads with a stop sign) that the guy was just looking for someone to race because there were plenty of opportunities for this guy to pass, but he stayed behind the truck and continued to drive erratically.

Finally I told my brother “we have to stop and let this guy get away or pass him, I can’t stand this much longer”.  So, the next good clearing where my brother could see clearly (it was very hot day and the heat from the road was creating an hazy heat wave affect) my brother pulls and passes.  He then pulls back in between the Mustang and the truck because he sees a car coming towards us (his original intention was to pass both).  I follow my brother’s lead and pull out, as I get even with the Mustang, I hear him kick it down and speed up.  (Did I mention the word jackass before?)  Well, that just sets me off because it proved I was right about this guy just wanting to race.  He probably bought the Mustang to compensate.  At any rate, Mustang or no, my brother’s in front of him and my bike is no wimp.  As I kick it down a gear I flip the guy off passing him and my brother and pull back in line behind the truck.

I’m sure you can guess what happened next right?  Yeah, he’s revving the engine and good to go so he pulls out and guns past us.  I see him coming and flip him the bird the whole way past.  As he’s going past he’s staring at me and flipping me off as well.  So he goes past us (remember the car?) and goes past the truck diving back into the right lane almost clipping the front of the truck and I’m sure giving the folks in the oncoming car a fright.

Regardless, he’s gone and I’m happy to sit behind the truck cruising at 55 because now I don’t have to deal with an unstable erratic driver in front of me.  It made the rest of the trip seem so peaceful!

The amazing thing about this is that I usually feel guilty about doing “stupid” things, like flipping off that guy in the car.  Really, it wasn’t necessary and I’m sure it didn’t help the situation any.  However, this time I didn’t feel the least bit of guilt.  This guy was an idiot at best and how he was driving was creating a hazardous situation.

Stay safe, stay sane and keep the rubber side down.

–ServerGoon