How to hide entire blocks of code from GOOD BEHAVING browsers.
Now that most web coders / designers are putting advanced effort into writing decent compliant code for their sites, there are a variety of ‘fixes’ that have to be employed to cure problems in old bad behaving browsers such as IE6 and below.
MANY ‘get arounds’ involve miles of Javascript code which is completely useless as well as resource-hogging when many users block javascript completely for security purposes. The reasons that people hold onto old and ancient technology such as IE6 is due to a completely misled belief that it is more stable than the upgrade and more secure. The MAIN problem is IE6 and where I agree that IE7 is not ‘all that’, it is now usable and closer to compliance and good security than IE6 is!
At the end of the day – IE6 insistent users are STUBBORN, so although it pains any decent coder to work with and doubles the billing time on a clients web development sometimes, we have to try to work with it.
SAVE HOURS OF CSS HELL. If your visitor insists on ancient technology and blocking Javascript, then they have to EXPECT not being privvy to some modern compliant effects and functions. Example: users of programs such as ‘NoSCRIPT’ have no idea what ‘Digg’ and ‘Delicious’ are because they never see it and cannot even add RSS feeds to thier Facebook account…. similarly, whateverhover and other Javascript menu hacks designed purely for IE6 and old browsers become completely pointless.
So, you have a nice pure CSS styles functional section such as an active menu that
a) Requires ZERO Javascript Whatsoever
b) Is SUPER fast
c) Super clean and clear
d) Loved by Web crawler robots etc
BUT it won’t behave for stubborn stick in the mud’s like IE6, the likes, and below users.
The benefits of non dependant and compliant code is far too good to not use.
YET you have code that old browsers CAN work with that does the same functions yet still not javascript etc dependant (though may not be as nice)…. yet you don’t want BOTH to show up on the same page.
Keep two versions and STAY Javascript Free.
1) Hide the GOOD STUFF from old browsers
Your two lumps of code ‘GOODstuff’ and ‘ALTstuff’ will be defined in <div> tags.
eg
<div id=”GOODstuff”> all the HTML in here</div>
<div id=”ALTstuff”>repeat of the HTML in here</div>
In your relevant style sheet hide GOODstuff from old browsers
#GOODstuff {display:none}
html>body #GOODstuff {display:block}
Anything within the GOODstuff div tags including relevant styling will be hidden from old browsers but shows in Good behaving browsers.
2. Hide ALT STUFF from good browsers
#ALTstuff {display:block}
html>body #ALTstuff {display:none;}
Basically, Good browsers will follow the html>body to NOT display the ALT code div contents.
Filed under: CSS,Code,XHTML ... Comments (0)
Subscribe in a Reader or by Email
In line with Symsys’ continually bright and cheerful identity, our vehicles are very distinctive.
If you see one of us driving around I think that you would find us extremely hard to miss. Of course, once you are driving something like this, the days of any ‘fun’ in the car goes,
but the pride we have in the design and the company we run is reward enough.
The car shown in the images, already stood out but we thought we would go the ‘whole hog’ just like we love to do for our customers.
All the design work, mock up vehicle images etc. were done in-house by Symsys, using very high quality digital images along with some intricate vector graphics.
If you are looking for design for Corporate identity, Graphic Design or advertising in any format, or for any purpose, then contact Symsys on 09 813 0043. Find out more about us via our main website www.symsysit.com. We are based in West Auckland NZ but also very accustomed to working remotely on projects to serve you wherever you are.
Hopefully you should see us driving around Auckland and the surrounding areas and like the title of the post says, their’s no mistaking us and hopefully there’s no missing us either.
Filed under: Symsys ... Comments (0)
Subscribe in a Reader or by Email
This is a flexible HORIZONTAL HOVER menu that WORKS in IE 7 and Maxthon 2
… with NO Javascript Hacks. It is 100% W3C Compliant for XHTML STRICT and CSS.
More to the point – No Whatever:hover.htc Required NO SuckerFish or SuckerTree additions
NO [IF IE]…. Required Naturally, if you WANT to support the ancient browser technology then use the Java addons mentioned – but I thought everone was crying out to refuse supporting it anymore (talking about IE6 and older that doesnt recognise hover, onclick ..) On that note, the CSS side menu on the main site works on IE6 and displays it’s formatting correctly … that is for another post though.
I am hoping that this code will be of valuable use to a fellow ‘Webby’ out there. Isn’t it great when you get the thing looking JUST how you want it… and then a few days later, you check it is supposedly ‘bugs ironed out version’ Internet Explorer 7 and the world drops on your head.
Microsoft live in ‘opposite world’ …. because in opposite world when you say display inline / and say make my menu horizontal … you mean’t Vertical —- NOT!!!
And so, after a LOT of trials, tribulations, and pain from banging my head on the desk, I got this working and hope to save someone elses pain in the process.
So what about IE6 you ask.
IE6 just doesnt show the thing at all ) which suits me, in fact that’s GREAT! -It doesnt show any errors to your visitor… but it would be a good idea to give a bog alternate nav or PREFERABLY encourage anyone on IE6 / IE ancient based to come out of the dark ages, into the 21st Century – and UPGRADE!- preferably NOT to IE anything including anything based on it such as Maxthon. It has YET to be successfully described why some think IE6 is safter to use that other browser.
Checked and working “Okilidokily” IN:
Firefox 2, Google Chrome, Avant, Opera 9, Netscape Navigator 9, Flock 1.2. Tested on Firefox on Linux. Safari 3 on PC. It WORKS in – IE 7 and Maxthon 2 !!
The Code
Right then…. The XHTML code is as bog as bog can be with a simple UL / LI (Unordered List / List) Menu listing. The basic model is as follows:
XHTML
<div id=”topnav”>
<ul class=”nav”>
<li><a href=”#”>TITLE A</a>
<ul>
<li><a href=”/pagelink.php”>Subtitle 1</a></li>
<li><a href=”/pagelink.php”>Subtitle 2</a></li>
<li><a href=”/pagelink.php”>Subtitle 3</a></li>
<li><a href=”/pagelink.php”>Subtitle 4</a></li>
</ul>
</li>
<li><a href=”#”>TITLE B</a>
<ul>
<li><a href=”/pagelink.php”>Subtitle 1</a></li>
<li><a href=”/pagelink.php”>Subtitle 2</a></li>
<li><a href=”/pagelink.php”>Subtitle 3</a></li>
<li><a href=”/pagelink.php”>Subtitle 4</a></li>
</ul>
</li>
</ul>
Of course you can put links on the titles instead of ‘#’. The point is – it HAS to be a link – even if it is null (#)
Now for the CSS. First I have put in the absolute stripped down CSS ‘as is’ and the ACTUAL Symsys menu Style colours, sizes, paddings and margins. You will see that the result is quite unbloated, short and sweet.
After this, I will put the humongous annotated sheet so you know what does WHAT, and where to change to your custom style.
CSS – TRIMMED
#topnav {display:none;}
html>body #topnav {display:block;}
#topnav {position:absolute; margin-left:300px; margin-left:115px; top:159px; font-size:0; text-align:left;}
*—–Yes NEED margin in twice——*/
.nav li{display:inline;}
.nav li ul{padding-top:2px;}
ul.nav { margin-top:5px;}
ul.nav, .nav ul{margin:0; padding:0; cursor:default; list-style-type:none;}
ul.nav>li{display:table-cell; padding:1px; width:120px; float:left;}
ul.nav li>ul{display:none;}
ul.nav li:hover>ul{display:block;}
.nav ul li a{display:block; padding: 2px 4px 2px 4px;}
.nav li a {color:#fff; padding-left:4px;}
.nav ul li a{background-color:#EAEAEA; color:#000; width:112px; margin-top:1px;}
ul.nav li:hover {background-color:#28a3c5;}
.nav ul li a:hover{background-color:#fc0; color:#000;}
ul.nav li:active,
.nav ul li a:active{background-color:#44C21F; color:#FFF;}
.nav a{font:bold 12px Arial, Helvetica, sans-serif; text-decoration:none;}
Yes, that was IT. And now for the maybe excessively annotated version. I will apologise if some things are not too clear to you personally but hopefully you will find it easy to follow.
CSS – EXPLAINED
#topnav {display:none;}
html>body #topnav {display:block;}/*—– These 2 lines Hide from IE6 and older ALTOGETHER——*/
#topnav {
position:absolute;/*—–place exactly where I WANT it to appear——*/
margin-left:300px;
*—–usual IE Fix of following position:absolute with Position: relative will not work
Re-adjust the margin to correct IE Invented placement. Big headed MS will read the FIRST instance of a repeat element as THEIRS and ignore any repeat element afterwards…(sounds typically fitting for that company lol). All the other browsers that follow code convention properly will see the first, then see the second and update/use that instead——*/
margin-left: 115px;
top: 159px;
/*width:9999px;—makes no difference —-*/
font-size: 0; /*—–fix menu placement – all browsers unified——*/
text-align:left; /*—–If you want menu Items Centered then change it——*/
}
.nav li{
display:inline; /*no difference in all other browsers but REQUIRED for IE (7)*/
}
.nav li ul{
padding-top: 2px; /*padding at top (UNDER heading) of the entire submenus ONLY–*/
/* padding-bottom:5px; OPTINAL padding at bottom of the entire submenus ONLY – or use MARGIN – Does Not matter – get the SAME result in all browsers–*/
}
ul.nav { margin-top: 5px;}
/*display:table;—makes no difference inline, table, whatever—-*/
/*position:relative;—makes no difference —-*/
ul.nav,
.nav ul{
margin: 0;
padding: 0;
cursor: default;
list-style-type: none; /*—gets rid of horrid bullet points and associated indents—-*/
} /*display: inline;no difference in ANY browser–*/
ul.nav>li{
display: table-cell;/*—needs to be ‘TABLE-CELL’ or screws up ALL Menus – This ALSO hide the entire menu from ancient browsers (nice one) —-*/
/*display: inline;–screws up ALL Menus all do an IE and put subsequents AND Subs underneath–*/
/*position:relative;—makes no difference —-*/
padding: 1px ; /* This effectively puts 1px border extended around submenupopup – optional – make anything you want – will effect overall width of menu so may have to reduce widths unanimously to compensate—-*/
width:120px; /*Specified width of menu Tabs–*/
float:left; /*IE (7) ONLY diff – doesnt plonk subsequent and subs underneath on hover -*/
}
ul.nav li>ul{
display: none; /*obviously – don’t show submenu normally—-*/
/*position:relative;—makes no difference —-*/
}
ul.nav li:hover>ul{
display : block;/*obviously – show submenu only when the mouse is over it—*/
/*position:relative; Makes stuff all difference –*/
}
.nav ul li a{
display: block;
padding: 2px 4px 2px 4px;/*padding around submenu links order- top right bottom left (clockwise) */
/*border-top: 1px solid #000; optional entries – of course, my example has border extended aound it already making a bottom line*/
}
.nav li a { color:#000;/*** Menu Title color only!!!!! ***/
padding-left:4px;}/*** Left and right padding effective ONLY for menu titles here – probably best to match padding of submenu items as above***/
/* padding-top:9999px;}** this may appear to be a silly entry BUT in all browsers apart from IE (7) it creates an invisible hotspot extending in this case 9999px above the menu title TEXT width. Cool trick – handy if you want it – nuke it if you dont. Take it out of comment to try***/
.nav ul li a{
background-color: #EAEAEA;/*** bg col of entire submenu***/
color: #000;/*** text col of entire submenu***/
width: 112px;/*fixes sub width Firefox*/ /* width minus padding (both sides) of sub items to compensate eg if 4 – same width as header cell 120 – (2×4 left right padding)= 112—-*/
margin-top: 1px;} /*put this in IF you WANT a gop between each submenu item – the background of extended top item background will show behind***/
ul.nav li:hover {
background-color: #28a3c5;} /*** Only open menu header and matching extended border around who menu/submenu if opted for) ***/
.nav ul li a:hover{
background-color: #fc0;
color: #000; /*** text col and bg col of submenu individual li items on hover – mine are kept black – you can choose different***/
}
ul.nav li:active,
.nav ul li a:active{
background-color: #44C21F;/*** text col and bg col of submenu individual li items on Click / active***/
color: #FFF;
}/*** Browser differences – on click the title item will also change bg col including any visable background between menu item blocks. (not title txt col aswell) This is in Chrome Firefox Opera Netscape Flock- but not in IE – See notes for versions tested**Of course, you can always just remove ul.nav li:active,*/
.nav a{
font:bold 12px Arial, Helvetica, sans-serif;
text-decoration: none;
}
Further Comments
IE7 and Maxthon 2 – on load, it millisend hops to the right then puts it where it should – not really an issue just typically lame coding by Microsoft (Hey, I use XP Pro, have done for years and although it does get bogged down I am happy enough with it – I outright refuse to entertain vista or the upcoming Windows 7 though)
Minimal layout glitch on Opera 9 – all good – though does put a visable padding above the title items by about 2px – shoving it all down a tad ( and no, it is nothing to do with the 2px padding under the title header being applied. Let me know if you fix this “pwetty pweeeease”.
Learning CSS and VALID code…. The rule of thumb is, if youre not having any trouble in IE, then theres something wrong with your code – youre not doing it right–
Filed under: CSS,Code,XHTML ... Comments (2)
Subscribe in a Reader or by Email
Debian (Lenny) Linux – Beta2
Forget taking the Linux world or even the AIX systems world by storm, Lenny is revolutionary and is going to be (Yes that’s right I’m asserting that it WILL be, not saying I think it will be) one of the singular most important distribution releases of Linux as a whole, EVER!
Let’s start out with the improvements over Debians previous release, Debian 4.0 Etch. Well we now have a very clear menu once the Live CD boots up, it’s unbelievably easy for new users and power users alike to choose which installation procedure they would like to follow. If you’re a completely new user to Linux, you can take the Lenny CD, put it in your drive, select the Graphical Installer as opposed to the options for experts, or simply text based, Then follow a few very simple instructions, click a few buttons and presto, you’ve got a fully installed, totally usable and perfectly working system. It really has never been easier, and I’m talking easier than Ubuntu here, now that’s saying something.
There is also another fundamental difference in Lennys installer options, you can choose an expert installation, WITH a graphical interface, this is brilliant. Just because I’m a power user and an I.T. engineer doesn’t mean I want to spend my life looking at text based installers, just to prove I’m a power user. I can now choose the expert installer, giving me the options I need to configure my system, exactly the way I want it, whilst still feeling that I am choosing this option as a power user, and that I have control over how my system will be installed. An option you don’t get with some other distributions like Ubuntu, and yet I can look at a relatively attractive (Although slightly too pink for my liking) installer at the same time. The expert installer is almost as detailed as following a Gentoo Installation Document, identifying all the really intricate parts of the installation, right down to asking if it should look for PCMCIA devices or not (Pre-empting the possibility that you may be using a laptop). For a graphical installer, I think I can safely say this is the most in depth you could get it, without risking the users options screwing up the installation with conflicts. Which if memory serves me correctly, Gentoo once did back in 2005 and I fell out with their installer from that moment onwards.
During the expert installation we did, we had an option to use a mirror to supplement the software already on our CD, this is an option we usually choose, if it’s given, with all distros, because it allows us less problems (usually) once the installation is finished, because it’s using the absolute, most up to date software out there and requires a lot less effort to get a fully working system. The downside to this however, is that the installation does take a lot longer while it downloads the software required and is very dependent on your connection speed to the internet.
On to the more important parts of the review. Debian Lenny comes with several installation CD options, a KDE CD, a Gnome CD or an XFCE CD. Since it’s our favorite desktop environment, we chose the KDE install CD, however I love the fact that you have the options available for those users who prefer Gnome or XFCE and want to install it from the first minute of installation, instead of having to install a Gnome desktop, then later once the system is up-to date enough, installing KDE or XFCE as well, which can cause clutter in the menus, excess baggage of programs you don’t want or need, etc. This again really shows how much effort and thought has gone into the Lenny release.
After the first reboot, I found a very much fully working operating system, there were still a few updates required, I had to manually upgrade the kernel so that I could install the VirtualBox drivers and enable seamless mode, but it’s not as if it’s as difficult as it used to be with having to completely re-compile the kernel, so no harm in that. Not great for new users but most new users won’t be using Virtualbox to install Lenny. Possibly the full release of Lenny (Remember this review is based on Beta2 and not a full release) may be a little more intuitive and automatically install the latest kernel during the inevitable apt-get update, apt-get upgrade, apt-get dist-upgrade, after an installation, which we all have to perform usually with every distro we install.
A couple of updates, reboots and a virtualbox kernel module compilation later, (Not as difficult as that sounds in all honesty, some more apt-gets and a little research if needed into the packages available and how to issue the right commands if you’ve never done it before) and we’re up and running, but wait, installation of the VBox kernel module and drivers has caused an issue with the resolution, it’s defaulting to 1280×768. So I start looking for the control center, only to realize, Lenny still uses the default KDE one, just as etch did. Now although that’s fine for power users who know where everything is already, that’s not the case for new users. In this particular instance for example I wanted to change my screen resolution, so you start opening up the menus, as shown in the screenshot, and you eventually find the display settings under “Peripherals”. Now this hasn’t changed from Etch and there are other distributions that do this as well. But in terms of Lenny for new users this is a real let down to me. I would expect a distribution that is this polished everywhere else, and had this much development put into it, and is this easy to use for all the other things it includes, to have the control center side of things sorted out by now.
Kubuntu, OpenSUSE, Mandriva and several other distros, have a customised control center, which for new users is much much easier to navigate if they want to change simple settings like the resolution, or keyboard settings. Lenny is still lacking the “noob proof” setup here. However from a power user point of view it’s incredible, the control center has just about every setting you could want it to have, plus a few you don’t really need. Short of things which still require command line hacking in EVERY distribution out there, the abilities of the control center in Lenny FAR out weigh those of the distributions which have made it easier to navigate for newer users.
Unfortunately the display configuration is still quite limited as well with the VBox drivers and I had to go back to command line hacking to give my new system a resolution above 1280×768. This is no reflection on Lenny however, as I was in a VirtualBox VM and did not have the NVidia or ATi drivers installed that I inevitably would have, were it on a real system, giving me better configuration tools to configure my display with. This being a virtualbox installation is also the reason we didn’t get to play with any of Lennys really cool new toys on the wireless front.
It’s worth a mention that Lenny, once installed, comes with a full compliment of programs, both fun, professional and functional. I honestly don’t think you could find a Linux distribution that came this well equipped out of the box.
Summary
I can definitely say that Lenny is a big step forward in terms of desktop computing, I haven’t tried out the server installation for Lenny just yet, but you can count on me doing so as I always use Debian for my servers
. I’m exceptionally happy to see that the KDE release of Lenny is geared around KDE3.5.9 and not KDE4.1, I think choosing the more stable, better known and tried & tested Desktop Environment was the way to go. They’ve ended up with a better product than the distributions who are already incorporating KDE4.1 into their default setup. Don’t get me wrong here, KDE4.1 is a great product, and is getting better all the time, but I still don’t think it’s really all that ready for new users who are booting Linux for the first time. Mandriva did a good job with KDE4.1 in their 2009.0 release, but it was nowhere near as powerful as the Lenny installation is and if KDE4.1 is your default desktop you may well need another desktop installed as well, to configure things that KDE4.1 can’t handle yet, I think Debian made the right choice here.
Overall I think Debian have surpassed themselves with this release, I was extremely happy to see the much needed new features, such as the graphical installer, the option to install Grub2.0 (Which I did and was very impressed with) and overall just how well the system installs itself. Well done Debian, I can’t wait for the full release of Lenny. If I hadn’t JUST migrated everything from my Kubuntu 8.04 x86 installation to my Kubuntu 8.04 X64 installation, ready for the Intrepid Ibex (8.10) release, I’d be installing Lenny on my desktop right now instead of writing this review. As it is, I’ll have to resist the temptation for now in order to assure I have a fully working system and am not just “playing around with my system”.
For an Operating System release this would be amazing, for a Beta2 release, this is excellence!
Filed under: Linux Reviews ... Comments (1)
Subscribe in a Reader or by Email











