Saturday, January 3, 2015
Explaining CSS Selectors Part II
See last weeks post for part one of Explaining CSS Selectors.
Attribute Selectors
Attribute selectors allow you to target a group of items on a page by matching a particular attribute. This opens up a whole new method of selecting your targets. Unfortunately attribute selectors are not supported in IE6 (which is why they’re not very commonly used), and IE7’s support is a bit buggy at times, however with IE8 out today, hopefully support for these selectors will be greatly increased and we can finally get away from being held back by supporting IE6 users.
Attribute selectors can be used in a number of ways. You start with either a HTML selector or the universal selector (*) followed by the attribute selector within square brackets ie.
[sourcecode language=”css”]img[alt] { border: 2px solid red; }
img[rel=”external”] { border: 2px solid blue; }
img[alt~=”photo”] { border: 2px solid green; }
p[lang|=”en”] { color: red; }[/sourcecode]
Pseudo-classes
Pseudo-classes allow you to target even more specific elements on the page. We’ve seen some of these before however I’ll cover them all below.
:first-child
The first-child pseudo-class matches an element that is the first child element of another element. For example, to target the first list item in a list you could use
[sourcecode language=”css”]ul li:first-child { margin-left: 20px }[/sourcecode]
:link
Allows you to specify the properties for an unvisited anchor link eg.
[sourcecode language=”css”]a:link { colour: blue; }[/sourcecode]
:visited
Allows you to specify the properties for a visited anchor link.
Dynamic pseudo-classes
There are 3 dynamic pseudo-classes that are usually activated by a user on the page. The 3 selectors are
:hover Activates when the user hovers their pointer over an element on the page eg. a link :focus Activates when the element has focus :active Applies when the element has been activatedNext week I’ll cover the last of the selectors, the pseudo-elements, and also give some every day examples of using these more advanced selectors.
Read more »
Monday, December 1, 2014
I was watching stuff on DMT.” Kevin Bridges is explaining what he was up to last night. It should be
Kevin Bridges. Photograph: Graeme Robertson for The Guide
“I was watching stuff on DMT.” Kevin Bridges is explaining what he was up to last night. It should be stressed that he was not actually under the influence of the ridiculously powerful hallucinogenic, rather learning about it on YouTube, but anyway: “I was just watching some people experiment with it. Apparently the human body produces DMT; when you die and when you’re born as well. It’s that light at the end of the tunnel thing. All mammals produce it, it says you can extract it from cows. And that’s life as a comedian.”
As Bridges offers up this cocktail of facts, I’m not sure whether he means that life as a comedian consists largely of watching videos in hotel rooms, or whether it’s one big psychedelic experience. Both could apply to this 28-year-old Scot. One of the biggest comics in the country, he’s gone from being a pasty-faced prodigy who apparently arrived fully formed at the age of 22 to a star (admittedly still pasty-faced) who can both sell out arenas and earn kudos from comedy cognoscenti. He’s on BBC1, he’s on Radio 4 with his mate Frankie Boyle, and he’s also on YouTube engaging a younger generation with the politics of the Scottish referendum. All in all, a bit of a trip.
One of the three most famous people from Clydebank (Duncan Bannatyne and Marti Pellow being the others, as if you needed reminding), Bridges is the son of a home help and a night porter, a legitimate working-class voice in an industry that can often seem overrun by posh kids. He’s also a Scot who’s stayed out of London (“The only people I know in London are people from work, that’s it”) and a performer for whom stand-up still comes first (“I don’t want to neglect my be all and end all, end up like Rocky V when he’s doing all the press stuff and Union Cane just comes in and knocks him out”). He’s also making a bid for the Christmas book market by writing his autobiography at 28, but I’m inclined not to hold that against him.
Bridges already had five years on the circuit under his belt when, in 2009, he got a late call to perform on Michael McIntyre’s Comedy Roadshow. His five-minute set was watched by 5 million people and Bridges went from being the biggest new name in Glasgow to the biggest new name in the UK. His first solo show at the Edinburgh festival followed shortly after; it was in a tiny room and sold out in minutes (I was there one night and heckled under the moniker of Trevor Danger. It’s fair to say I was eviscerated by the host). “I’d been working building a following, I’d played all the clubs,” says Bridges of that time. “Then immediately I’m the guy off the telly. I found it difficult making that transition.”
Not that you’d have noticed. By the next summer he was playing to crowds of 3,000 and had a live DVD, the holy grail for many a career comedian. He got TV presenting gigs, panel shows and then his own BBC1 show What’s The Story…, an unusual concept that found Bridges travelling the world to see if the stuff he’d invented for his routines was backed up by reality (one bit about US house parties had Bridges invent a character called Chad Hogan, so What’s The Story had him meeting a Chad Hogan in Logan, Utah). Whether or not it was the most scintillating piece of TV ever created, it showed just how many people identified with Bridges’s material.
In person, you wouldn’t look at Bridges and think he was a star; today he’s dressed in grey leisurewear and is half-slumped in his chair. But that’s kind of the point. His informality, combined with an affable, conversational style and the appearance that he is spinning material simply from the details of everyday life, give the impression that Bridges is a “natural”. When he stands on stage, it’s as if he’s chatting in the queue for the bus. The reality, of course, is that he’s performing heavily refined, rehearsed material. The relaxed charm is the result of intensive effort.
It’s clear that Bridges has spent a lot of time pondering the craft of the comedian. Starting out, he wasn’t sure what to do with his left hand while holding the mic in his right and so drew attention to it in his routine. He worried about his material not being accessible enough – “Your biggest fear is, how do I make a 60-year-old laugh?” – and so turned short passages of Scots-English translation into a part of his act. He learned to laugh at his own material onstage as a simple way of reinforcing the joke. “I look back at the Comedy Roadshow performance, my big break, and I hate it because I don’t look relaxed,” he says now. “To make it look easier and easier is the challenge. The harder I’ve worked at that, the more natural it’s been.”
Often observational, occasionally polemical, Bridges isn’t sure how he’d describe his humour, except to say that it’s not surreal. “Anybody can go in and say: ‘Can you imagine a duck on a skateboard?’ Honestly, I prefer real. I’m the same with everything, the same with movies. I’ve never seen The Lord Of The Rings, it didn’t happen for me. I love Dead Man’s Shoes, though; that’s a real film.”
Recently, Bridges took on another real thing: the Scottish referendum campaign. A one-off What’s The Story saw him weighing up the pros and cons of the independence argument, while a stand-up show – Live At The Referendum – was screened by the BBC the night before the vote. His material – about English people having to learn Scottish in the event of a Yes, or the Scots adopting a new currency called the smackerooni – may have been determinedly non-partisan, but now that the vote is done it’s clear what he thinks about the outcome.
“I voted Yes and I’m happy to say that,” he says. “At the beginning I was quick to dismiss the whole thing as Braveheart nationalism but when you start reading a bit more, about the amount of money being spent on ridiculous shit while there are food banks and families in poverty, it just becomes a joke. My dad had rheumatoid arthritis and had to retire at 52. My mum was the sole earner. When my dad was told he couldn’t work any more, he felt emasculated. You see programmes like Benefits Street, though, and it gets people turning on their own. It’s easy to say: ‘I’m out here working and he’s just sitting there spending his giro on booze.’ But there isn’t a show about Amazon or these tax-dodging corporations that are fleecing the country much more than a guy who’s pretending to have a sore back so he can eat Quavers and watch Storage Wars all day.”
A vote for independence, he says, would have been a step away from all that. “I think we have traditional socialist values, in Glasgow anyway,” he says. “I’m very disillusioned. I find it hard to even look at them, at George Osborne, they live on a different planet, man. And to them it’s just a game. It’s their careers, it’s not their lives. I live in a nice part of Glasgow but I live one mile away from a food bank. I pay my tax, I don’t have any working-class guilt about making money, but why should there be a food bank one mile away from me for people who are working? It’s not just ‘the poor’, it’s people who are in jobs. It’s mental, mindblowing.”
Bridges himself is in a good place. He’s given up drinking – “for seven months!” – and doesn’t gamble any more either (a recent serialisation of Bridges’s book in the Sun concentrated on his habit of bingeing in casinos). He’s even taken up cycling and changed his diet. “That’s another thing that annoys me, because people bang on about the obesity epidemic but you try and buy healthy food and it’s so fucking expensive.” Bridges and his friends grew up on chocolate milk and pizza crunch but now he says they all look younger than they did at school because they’ve got better information. “You go on to Netflix and you can see about 15 documentaries on monosodium glutamate and all these chemicals you’ve never heard of until recently.” Never mind the politics, what’s the story with Kevin Bridges and his chemical videos?
We Need To Talk About… Kevin Bridges is out now on Penguin
Theo22211Read more »