Posts Tagged ‘css’

I promised a test case for my latest problem and here it is: Gecko’s stubborn legend.

A few things worth noting:

  1. In reality the yellow background will be a gradiant background image within each box, so I can’t just apply the background to the form.

  2. Opera starts out displaying the upper form as FireFox does. The addition of position: relative (with no top, left, etc.) to the styles for legend magically changes that.

  3. IE7 breaks the * html hack so some further work will be needed to align the legend horizontally without breaking things in any other browser.

  4. Gecko doesn’t seem to apply float or display (except display: none;) to legend elements at all.

Very True Mood: busy
Tags:

Current problem is with getting FireFox to display a page properly. It’s connected to my old friends fieldsets and legends and this time IE and Opera are co-operating but FireFox isn’t.

More later when I’ve made some simplified test cases.

Very True Mood: (pissed off) pissed off
Tags:

Continuing from my last post, I discovered that both IE7 and IE6 were behaving badly and that I needed to feed different CSS to these browsers than to Opera, Firefox, etc.

But IE7 has rendered most of the CSS hacks useless. The normal solution is to use Conditional Comments to include an additional stylesheet. But that wasn’t an option as I wasn’t prepared to get into the whole hassle of learning how to change the Live Journal HTML.

I thought I had a solution. Use the IE specific CSS expressions (basically small pieces of JavaScript embedded inside CSS properties) to feed different values to IE.

top: 2px;
top:  expression(26 + "px");

It’s nasty, it’s not valid CSS, it will no doubt break in some browser or other, but it seemed to work when testing locally.

Live Journal wouldn’t have any of it, their CSSproxy said:

/* suspect CSS: potential scripting: expression */

So for now, I’m using the Owen Hack:

div.title { top: 26px; }
head:first-child+body div.title {top: 2px;}

Which may or may not get broken as IE continues to improve Which doesn’t work in IE7 because between whenever I last checked and the current beta they improved its support for the more exotic selectors without fixing the many bugs in its handling of basic things like floats and margins. :-(

Very True Mood: (annoyed) annoyed
Tags:

There’s a mirror of this blog on Live Journal (Or for LJ readers – there’s a mirror of this blog off Live Journal).

This evening I decided to make the LJ mirror look more like the real thing. I took a look at the LJ templating and styleing system (and the related documentation, or lack of) and decided that life was just too short. So I picked a style that looked somewhat like what I wanted (Flexible Squares) and then wrote a stylesheet to do the rest.

Some of the things that came out of this exercise are quite interesting and may be folded back into the main site design.

But, and there was bound to be a but, IE isn’t playing ball. There’s stonking huge gap between the title and subtitle in IE (at least in IE7b2, I’ll check IE6 at work tomorrow). Bugger.

Very True Mood: (tired) tired
Tags:

This morning I got on the wrong train. I have never done that on the way to work before, and I’ve only done it twice on the way home (and drink was definitely involved in one of those cases). So I was heading towards Victoria rather than London Bridge, and having a plain return season ticket rather than a travelcard I couldn’t jump off at Balham and hop on the Northern Line. So I jumped off at Balham and waited for the next train to London Bridge, which was late and even if it hadn’t been late would have gone back through West Norwood half an hour after I left.


My web server has been up and down, but mostly down, all day. I think that one of this weekend’s jobs will include taking a complete backup of everything.


For some reason I bought another issue of .net magazine. This one comes with a free CSS reference poster. The credits for which read:

Reprinted courtesy of the W3C
www.w3schools.com

The poster is indeed a version of the w3schools CSS chart which explains why it’s not very good, ‘cos w3schools aren’t very good. w3schools are also nothing whatsoever to do with the W3C. Whoops.

Very True Mood: (grumpy) grumpy
Tags:

In an ongoing Usenet thread I’m coming very close to asking someone “what do you mean by semantics?”

But even though I now strongly suspect that the person in question might well mean something completely different than the rest of us I’m resisting the urge to use the above phrase.

This thread has also thrown up the challenge of colouring the squares of a chessboard with CSS, with the artificial constraint of only setting a class on the main table element.

This wasn’t too difficult to do but if you look at the source code you’ll see why people have variously described it as “Very clever!”, “quite entertaining” and more commonly “gross”.

Following a suggestion from Alan Flavell I managed to halve the amount of code but really I’d like to see CSS 3 nth-child selectors because then the massive blocks of adjacent selectors would be reduced to just a few lines. Here’s a demo of the CSS3 technique to check new browser versions against.

Very True Mood: (grumpy) grumpy
Tags:

This Wednesday is the First Annual CSS Naked Day when web sites should be displayed in their naked glory, bare of all stylesheets. Unless the author has anything to hide (such as, gasp, non-semantic HTML perhaps?).

Very True Things will be a very naked thing on the 5th. (At least the main version of the site will be, the Live Journal mirror will still be fully clothed).

Very True Mood: geeky
Tags:

Via a newsgroup post:

A stylesheet used on a MicroSoft web site: http://connect.microsoft.com/Styles/GeneralStyles.css. And just in case they edit it, the first few lines read -

/* fix for the IE 1px-off margin error */
* html .StupidIEMarginHack
{
margin-right: 1px;
}

* html .StupidIEWidthHack
{
width: 100%;
}

Even MicroSoft’s own web developers are fed up with IE‘s CSS shortcomings.

Very True Mood: (cheerful) cheerful
Tags:

The browser with the rather unwieldy name of Internet Explorer 7: Beta 2 Preview – released on March 20th is, as the name hints, here and the usual suspects are talking about it.

This release is feature locked as far as site rendering is concerned. So time to start checking your CSS, etc. I’m happy to see that the problems with the book covers in the side bar are fixed, and as conditional comments are also working now I can hide the covers from older IE versions and show them to IE7. (But remember, if you have multiple copies of IE installed they will all use the version number of the ‘main’ copy. So check your conditional comments are working on separate test machines or use browser cam.)

One bug that’s still outstanding is that links with display:block in some case only respond to mouse hovers and clicks on the text and in other cases respond to hovers and clicks anywhere in the block. I think the deciding factor is float related but I need to create some test cases to check. Unless anyone can point me towards someone who’s already done the work?

Very True Mood: (optimistic) optimistic
Tags:

I’ve added a couple of plugins to the blog to display music and books that I’m enjoying at the moment. Over there, on the sidebar, down a bit, below the categories and links. (Scrobbles and Now Reading plugins created by Rob Miller.)

Depending on which browser you use you may notice one of two things – FireFox users will notice that both of the new sections suffer from the random single-pixel transparent lines that crop up here and there on the sidebar. Still no clue what causes this. [Update] – FireFox 1.5 fixes this problem, I must update my home version.

And IE users won’t see any cover pics for the books. That’s ‘cos, even in IE7b2, the display was totally screwed up. Too late on a Sunday to dissect the CSS (and let’s face it with IE there’s not much chance of a happy ending anyway), so I gave up and applied an IE only stylesheet to hide the images. Blah. [Update] – Mac IE doesn’t use conditional comments and hence shows the images, incorrectly, but really, Mac IE?

[Update] – As Paul points out in the comments Safari is inserting a large chunk of empty space under each book. According to browser cam this happens in Safari 1.2, 1.3 and 2.0 but not in Konqueror 4.3.

Very True Mood: indescribable
Tags: