April 15, 201214 yr So I was a bit bored after watching the F1 today, and I was on the Sky Sports website and thought to myself, this website is incredibly image intensive, and rightly so, so much of it visually must be a royal pain to create any other way. Images just make sense for it. But I decided to have a go anyway, at reproducing the headlines on their F1 page, using purely only CSS. There is unfortunately a bug, which I can't seem to find a fix for yet, see if you can spot it. I have only tested this in Chrome too so I don't really care if it breaks in IE if I'm honest. It probably will. And maybe you should have a go too, see if you can do better! My attempt: http://jsfiddle.net/brightonmike/PDeaZ/3/ The headlines are on this page: http://www1.skysports.com/formula1/ Just a bit of fun but I think I did ok! Not quite the same but damn close...wondering if I could use psuedo-elements to reduce markup. If you do have a go, the condition is that at no point must you use an image. No images! Edited April 15, 201214 yr by brightonmike
April 15, 201214 yr Sundays aren't good for me - I've got my kids, or that's exactly the sort of thing I might have done. Maybe we both need to get out more...
April 16, 201214 yr I think i was on #wdf Sunday morning haha. Make that three of us that need to get out more!
April 16, 201214 yr I like the idea of challenges could we perhaps make it a more regular thing? Even for people fairly new to it like me, I think it would be a great way to learn more from you guys and have to do things better
April 16, 201214 yr Author I agree. I'm thinking of doing a fortnightly challenge via WDF. There's nothing stopping anyone trying this one though! Still nobody has pointed out the bug or suggested a fix...
April 17, 201214 yr Author You should give it a go no matter what it is! The above one is not too difficult, it is just using CSS3 techniques to style a header. Give it a go! You can achieve it using gradients, CSS transforms, border-radius, text-shadow, box-shadow.
April 17, 201214 yr Author OMGZ I can't believe you made that guy's face in CSS! You know, technically, I think you probably could. 1px square divs, thousands of them. Each with a different background colour. Would be extremely messy however! And take ages to colour pick the picture etc. Or, base 64! I just couldn't resist. Edited April 17, 201214 yr by brightonmike
April 17, 201214 yr Or, base 64! That's insane - and not in the 'hip' American kind of way Pity the pic wasn't of David Coulthard - one big square pixel would have done most of his face Edited April 17, 201214 yr by oakleaves
April 17, 201214 yr Author You know the interesting thing is, the base64 encode of that image is 36kb. The original image is nearly 90kb. That's a decent file size saving right there.
April 17, 201214 yr You know, technically, I think you probably could. 1px square divs, thousands of them. Each with a different background colour. Would be extremely messy however! And take ages to colour pick the picture etc. Or, base 64! I just couldn't resist. Now that sounds like something I could get in to. CSS mosaics!
April 17, 201214 yr Author Imagine if you had a picture made up of 1px divs. You could do all sorts of weird things with the hover effects, making it morph into other pictures, or change shape/size. Someone needs to write a script to generate the divs and pick the colours from the pictures....I wonder if that's possible.
April 17, 201214 yr Writing a script to do it is beyond me but I'm going to have a go at creating a simple image when I get home from the dentist.
April 17, 201214 yr Using these sort of techniques to render images (obviously not including website structure which seems to be the way forward) at this point in time, is only for people who are not too worried about cross-browser compatibility.
April 17, 201214 yr Author Using these sort of techniques to render images (obviously not including website structure which seems to be the way forward) at this point in time, is only for people who are not too worried about cross-browser compatibility. You're right in a way, even between FF and Chrome there are discrepancies. But I was surprised at how well it degraded in IE8, it basically just became two square headlines, and there was even still gradients because my code uses the filter property. For now, sure, I wouldn't use these yet. But I think it's great to have a play around, and once IE8 fully dies out I think we will be able to start using these techniques more widespread. We hope!
Create an account or sign in to comment