John Hunt's web log | Open source, Linux, Developer tips, Beer, Whatever

Archive for February 2008

Just a handy one for the IE6 png support:
for i in `ls`; do x=`basename $i .png`; convert $i $x.gif; done

, , , ,

No doubt it’s been done elsewhere, but I spent quite a while trying to get this one working. Basically I wanted a horizontal css menu with decent markup and no hacks. I also wanted to have nice icons for each item correctly vertically aligned. On top of that I wanted the whole thing to be fluid so it would look right at any text size. Unfortunately because of IE6’s lack of support for :hover on anything but links I needed to use containing spans for the text on each list item (doh!) I guess you could use javascript or something instead, but that’d be really horrid!

After a lot of hair pulling, I finally got it to work:
Menu

#navigation ul {
  margin:               0;
  padding:              0;
  background-color:     #eee;
  height:               2em;
  border-bottom:        1px solid #888;
}

#navigation li {
  float:                left;
  list-style-type:      none;
  border-right:         1px solid #888;
}

#navigation a {
  float:                left;
  margin:               0;
  background-repeat:    no-repeat;
  background-position:  5px 50%;
  text-decoration:      none;
  color:                #333;
}

#navigation .inner {
  padding:              0 .4em 0 26px;  /* Adjust based on the width of icon + 10px */
  display:              inline;
  line-height:          2em;
  vertical-align:       middle;
}

#navigation .contacts {
  background-image: url(/crm/resources/icons/contacts.png)
}

#navigation .activities {
  background-image: url(/crm/resources/icons/activities.png)
}

#navigation .reports {
  background-image: url(/crm/resources/icons/reports.png)
}

#navigation .utilities {
  background-image: url(/crm/resources/icons/utilities.png)
}

#navigation a:hover {
  background-color:         #fff;
}

And here’s the HTML:

<div id="navigation">
<ul>
  <li><a href="" class="contacts"><span class="inner">Contacts</span></a></li>
<li><a href="" class="activities"><span class="inner">Activities</span></a></li>
<li><a href="" class="reports"><span class="inner">Reports</span></a></li>
<li><a href="" class="utilities"><span class="inner">Utilities</span></a></li></ul>
</div>

*I got my icons from the fantastic FamFamFam web site. This guy gives away loads of great icons for free. You might want to convert them to transparent gifs though as obviously IE6- won’t handle the transparency in the PNGs.

I’m no css expert, so if you can see anything silly in the css/markup or know of some way of improving this, please drop me a comment!

, , , , , , , , ,

Feb/08

14

Cron gotcha

While pondering why my backup scripts weren’t working in /etc/cron.daily, I remembered that run-parts (the thing that runs stuff in that directory) doesn’t like running scripts with a .sh, or indeed probably any extension on them.

Handy to remember that one!

, , , ,

Feb/08

4

VirtualBox 1.5x

Looks like the guys over at Innotek have been busy, probably old news to most but I just realised they’ve released version 1.5 of Virtualbox last year.

Among a whole bunch of bug fixes and other improvements it seems they’ve added one cool feature that will make working with those windows only programs much easier – seamless window integration with your host OS (I think that’s linux only, but I might be wrong). I’ve not tried it out yet, but as far as I can tell you can have windows application windows displayed properly and running at full steam with all the rest of your windows – very much like running some kind of cool (sort of) hybrid OS!!! I thought it was exciting anyway.

To explain what I mean further, I found this rather strange video on youtube:

Once I get that new pc, I’ll give it a go!


Update:
It works, but it goes very strange if you have ‘desktop effects’/compiz turned on. Which is annoying! Nevermind!!! I’m sure it’ll be sorted out fairly soon.

, , , ,

Find it!

Theme Design by devolux.nh2.me