Bummer! This is just a preview. You need to be signed in with a Pro account to view the entire video.
Start a free Basic trial
to watch this video
Why CSS Was Invented
45:51 with HÃ¥kon Wium LieIn the beginning, web pages didn't say anything about fonts, colours or layout. Cascading Style Sheets (CSS) was invented to change this, and today all web pages use CSS. How did this come about? What tools do we find in the CSS toolbox, and why? Which should be added in the future?
-
0:00
[MUSIC]
-
0:13
Thank you.
-
0:16
Thank you everyone.
-
0:16
It's good to be here.
-
0:18
You look remarkably alert this morning.
-
0:21
Sometimes it's hard to give the first talk of the day but
-
0:23
thanks to the generous supply of caffeine out there.
-
0:27
I think we'll be fine for the next 40 minutes.
-
0:29
I'm gonna show you some pictures.
-
0:30
I'm gonna tell you my story.
-
0:31
I'm gonna tell you a little about the origins of CSS.
-
0:34
I think sometimes it's important to understand why things were invented.
-
0:37
So when you work those long hours at night hacking CSS code perhaps or
-
0:43
to wondering why is it like this and not like that and things.
-
0:47
Maybe some of this will help you and maybe not.
-
0:49
But my focus isn't really backwards looking.
-
0:51
I'm also going to be looking to the future, see what are the stuff we miss.
-
0:55
What's the stuff we're gonna do?
-
0:56
I mean after all the web isn't that old, right?
-
0:59
So talking about the history of this stuff,
-
1:01
it's barely out of its teenage years.
-
1:04
So, we can look a bit back, but we should also look forward, I think we have
-
1:08
the longer history, the longer timeline in front of us than looking backward.
-
1:14
So my last question to you will be, how long is this web thing going to last?
-
1:20
That's my last slide.
-
1:21
In between there, I am going to be breaking the law.
-
1:24
So you have been warned.
-
1:25
I will be breaking the law onstage today.
-
1:30
My story starts here.
-
1:31
This is from CERN.
-
1:33
It's a physics laboratory in Switzerland, on the border of Switzerland and
-
1:38
France, actually, and it's dug underneath the ground,
-
1:43
where you find this remarkable machine.
-
1:46
It's the world's biggest machine, actually.
-
1:48
And what we're looking at here is one of the detectors for
-
1:52
seeing when these small particles, it's part of a particle accelerator.
-
1:58
When these collided at high speed they sometimes emit these things and
-
2:01
I can't really explain it to you because I'm not a physicist.
-
2:04
That's not why I was at Cern.
-
2:06
But I can still be amazed by the scale of this and
-
2:10
you can see the guy standing in front here.
-
2:13
And this is underneath the ground in an otherwise very picturesque area of Europe.
-
2:20
You see the cows grazing in the fields there.
-
2:22
Not knowing what lies underneath them.
-
2:25
And in the background you have the Dura mountains.
-
2:27
And if I'd turned the camera I would have seen the Alps.
-
2:30
It's very beautiful there.
-
2:33
If you go inside the CERN offices,
-
2:36
this is the corridor where the web was invented actually.
-
2:40
It's not quite as picturesque.
-
2:41
This was built in the 50's after the war and
-
2:44
building aesthetics wasn't very high on the list.
-
2:47
But it's a very organized community.
-
2:49
And I think this also shows, you know, what are the worlds you're dealing with?
-
2:53
The real world has beautiful pictures.
-
2:55
The worlds we're creating are somewhat more structured,
-
2:58
somewhat more organized, and can we make this thing work together?
-
3:02
And the guy who sat down to try to solve that problem is of course
-
3:08
I came to work with him in 1994.
-
3:12
We shared office for some time then.
-
3:16
An amazing time, the web was still young.
-
3:18
We could do things.
-
3:20
Here's a picture from the from just outside that corridor where
-
3:25
again I don't know much about physics.
-
3:27
I don't know what goes through those pipes there but I do know that the computer
-
3:31
we installed in the corner there was the first public web terminal.
-
3:37
It was a sub work station, we put it up there for everyone to use, so
-
3:40
that the students, those that didn't have their own computers to install Mosaic or
-
3:44
some other browser on, that they could still sample this web thing.
-
3:49
And here's our marketing campaign.
-
3:51
World Wide Web,you click and we do the rest and I think we can conclude
-
3:57
here that it wasn't really the maketing that made the web succeed.
-
4:02
We could have done better but in the end it probably didn't matter.
-
4:07
What was important was that we had a sound technical foundation.
-
4:11
And this was made available to everyone for free.
-
4:16
And that's one of the great things about Tim and
-
4:18
CERN that they were actually making open standards out of what they did.
-
4:23
Think about this.
-
4:26
When you work those long hours and you stare at browsers that don't work,
-
4:30
it could have been a whole lot worse.
-
4:32
This thing could have been owned by one company.
-
4:34
It could have been France Telecom that had the minitel, it could have been Microsoft.
-
4:39
It could've been one private owner of this thing instead we have,
-
4:42
a web which is slightly disorganized,you know,
-
4:46
there's a lot rubbish out there, but there's also a wonderful place that
-
4:51
reflects humanity, as it should be and it's free for everyone to use.
-
4:56
Of course, those who started making websites early on,
-
5:00
they basically borrowed tags, borrowed documents from others.
-
5:05
And one of the first thing they got to see,
-
5:06
when they looked at the source code was this, things like this.
-
5:09
A small HTML element there, starting with a headline, H1.
-
5:14
Then comes the headline itself, and then comes the end tag,
-
5:18
which is almost the same as the start tag, except it has the slash.
-
5:21
I can explain that to you in 30 seconds, and
-
5:23
that's all it takes, basically, to get the grips, get the starting point of HTML.
-
5:28
It's very, very simple.
-
5:32
It has semantics, though.
-
5:34
It doesn't say anything about the presentation.
-
5:37
It says something about the semantics of the element.
-
5:41
That the headline is a headline.
-
5:42
It says something about the role of that.
-
5:44
And that means we can present that HTML element on a screen or
-
5:48
in a speech synthesizer.
-
5:51
In many different ways.
-
5:52
It's not tied to a PC screen or a phone screen.
-
5:55
It's universal.
-
5:57
And as I mentioned the fact that it's an open standard is also very,
-
6:00
very, very important.
-
6:03
So using those first HTML tags, we could write web pages like this one.
-
6:08
This is a screenshot from an early browser.
-
6:11
Mosaic I think I already mentioned, anyone use Mosaic in the room?
-
6:15
Yeah there are some, not many.
-
6:18
Thank you. [LAUGH] Those were the days.
-
6:20
It was released in January 1993.
-
6:23
And it sort of, this was the first time we were able to actually demonstrate what
-
6:27
the web could do.
-
6:28
Because this you could install on people's PCs and
-
6:31
web stations and they would get up in running in a couple of minutes.
-
6:36
And people started putting out documents on those early web servers.
-
6:42
Here is one example, using a semi random screen shot.
-
6:45
It was incredible, you had this document, then you had these things and
-
6:50
underlines and then you could click and you would get somewhere else, maybe up to
-
6:54
another computer in another country, in America even.
-
7:01
Suddenly you were there.
-
7:02
It was just fantastic so there was sort of a euphoria amongst the you know,
-
7:09
in the scientific community in the early internet days there.
-
7:13
Of course that attracted other people and it attracted designers and when
-
7:16
the designers came in they said okay, this is pretty cool, but the font is terrible.
-
7:21
And the color, the gray background, can't have a gray background!
-
7:23
I want a white background.
-
7:25
And I want 20 point Helvetica red,
-
7:27
and they couldn't get that, because HTML only gave them semantics.
-
7:33
It only gave them the rules of the element, and not the presentation.
-
7:38
Aesthetics of course is truly, truly important.
-
7:41
Our minds,
-
7:42
our visual system, is much more geared towards looking at beautiful landscapes,
-
7:46
like this one, than it is to looking at very structured, scientific data.
-
7:51
And I think if the web were to succeed
-
7:56
in the bigger world I thought we need something else.
-
8:01
We needed sort of a bridge between those two worlds.
-
8:03
So then came CSS along.
-
8:06
This was the beginning.
-
8:07
We wanted people to use HTML.
-
8:09
But we also wanted to allow them to say something about font size and colors and
-
8:13
typography and layout and margins on the side and shadows and such.
-
8:18
Because otherwise they wouldn't use HTML.
-
8:21
I think if you hadn't been able to develop CSS and give designers that tool chest,
-
8:28
that tool box they craved for, they would have maybe gone to somewhere else.
-
8:33
Maybe HTML would have turned into a page description language,
-
8:36
more like PostScript or PDF.
-
8:39
Or maybe it would turned into a fax machine.
-
8:43
I mean, people started making pictures out of their documents, because if you take
-
8:48
a picture, then of course you can control every pixel in there.
-
8:51
So you could get the fonts you need, the colors you needed.
-
8:54
So people started making those one image pages.
-
8:59
You see some of them around still.
-
9:01
Not so much, thank goodness.
-
9:03
But, you saw sort of, yeah,
-
9:05
we're gonna turn this thing into a picture swapping device, a giant fax machine.
-
9:10
We could have ended up with the web being a.
-
9:13
You still remember fax machines, do you?
-
9:15
Yeah, yeah?
-
9:16
I'm not going to ask if you used them.
-
9:18
But yes, you know what I mean.
-
9:19
So instead we wanted no, we want to keep HTML around and
-
9:24
to do so we need to give people the design choices they need.
-
9:27
So the primary reason for
-
9:29
doing CSS wasn't really to do cool presentation it was to save HTML.
-
9:34
We wanted to,
-
9:35
to make sure that we had a text-based semantic-based language underneath there.
-
9:42
Not that the presentation isn't interesting I think it's very interesting
-
9:46
and you know, looking at the way CSS has developed, I'm fairly happy.
-
9:52
There is a few things that should have been done differently.
-
9:54
We're gonna go through some of them.
-
9:56
So just to wrap up on the code side here.
-
10:01
CSS and HTML, they're sort of like brothers or cousins,
-
10:05
where they live next to each other.
-
10:07
You have the HTML element on top there, and
-
10:10
you have a little bit of CSS code underneath.
-
10:12
And the selector, the h1, the common h1 there ties them together so
-
10:17
that we make sure that the headline comes out 14 pixel red.
-
10:21
Can you read that code?
-
10:22
Is everyone here familiar with that kind of code?
-
10:25
Yeah, I see nods.
-
10:26
Yeah.
-
10:27
And if you're not, you can learn it in 30 seconds.
-
10:29
As I said, it's easy stuff.
-
10:31
So, let's go through some of the properties.
-
10:34
Okay, so, we start out with some text.
-
10:36
And then, we set the font size.
-
10:38
And you can see the code up here.
-
10:40
And this is of course, very basic.
-
10:41
We can set the font style to italic.
-
10:44
We can set font family, we can set the color of the background.
-
10:47
And we can even set the border around it.
-
10:51
I mean, this looks very simple now and of course it is.
-
10:54
But, in 1996, this was pretty hot.
-
10:58
Setting backgrounds and borders, wow.
-
11:02
Colors and borders, incredible stuff.
-
11:08
We added these things, and we had discussions.
-
11:10
What to add, and what to not add.
-
11:12
This was one of the more ambitious properties that got in early,
-
11:18
but it wasn't really used, because it wasn't implemented in browsers.
-
11:22
IE4 did not have it, so people could not use it.
-
11:26
And therefore, it was left unused.
-
11:29
It is ambitious in the sense that it tries to
-
11:33
do something that people used Photoshop for.
-
11:36
So, getting these shadow effects is easy in Photoshop,
-
11:42
but that requires you to make an image of text, which we don't want.
-
11:44
That's the starting point.
-
11:45
We don't want to make images out of text.
-
11:49
That's bad for many reasons.
-
11:51
It's for compression, it's bigger, you can't index it.
-
11:55
We couldn't have had a Google if it was all images.
-
11:58
And you can't read out loud in a speech synthesizer.
-
12:03
So, we wanted people to to do shadow effects without
-
12:08
doing Photoshop, or other image manipulation programs.
-
12:11
So, we added this small property, text-shadows, and it's quite easy.
-
12:15
You set a offset, x and y offset, and
-
12:17
you say what the color should be, of the shadow.
-
12:22
And then you could add a little more.
-
12:23
You add a third parameter.
-
12:26
And you give it a slightly more risky color there.
-
12:32
But then you get these Gaussian blurs.
-
12:35
So, it's not obvious.
-
12:37
The syntax here isn't obvious.
-
12:38
You actually had to consult the spec or
-
12:40
read it from somebody else who wrote up on this.
-
12:43
What is the third Number here?
-
12:48
And what is this RGB code, this hash?
-
12:51
That's not something you can just understand for yourself.
-
12:57
On the other hand, it's not that hard either.
-
12:59
Once you've written one of these, you pretty much get it.
-
13:03
And you can continue to make more of a advanced text-shadow effect.
-
13:08
Here's one where we actually set the color of the element itself to be white,
-
13:11
to be the same as the background.
-
13:12
And we just give the shadow a color.
-
13:15
So you get this spray paint effect.
-
13:19
Again, the motivation is, don't make images out of text.
-
13:23
Then CSS3 comes along,
-
13:24
and this is one of the things we added in CSS3, border-radius.
-
13:30
It was actually proposed earlier on.
-
13:34
I was very much against adding border-radius.
-
13:37
I thought, you could only do so much in one spec.
-
13:40
You can only advance the world that much.
-
13:42
So I thought, border-radius we shouldn't put in because nobody really wanted to do
-
13:46
border-radius anymore, do they?
-
13:47
I mean this was really a 70s design thing and
-
13:50
we have gone beyond that point now, haven't we?
-
13:54
Yeah, do we really wanna do that kind of stuff?
-
13:57
Well, it turns out a lot of people want to do border-radius stuff.
-
14:01
So, border-radius got in and now I am pretty happy about it.
-
14:07
First, its very easy to use.
-
14:08
Again, its starting point is very simple.
-
14:10
You can understand it immediately.
-
14:12
Here you set the border-radius of all four corners to 40 pixels and
-
14:17
then you can add some more effects by adding.
-
14:22
>> It's not an obvious syntax maybe, but
-
14:24
if you're told that here's the horizontal radius and here's the vertical radius,
-
14:29
then you can make these things and here by adding a slash.
-
14:34
Again, not obvious, but still easy.
-
14:36
You can set different bordering radiuses in different corners of the element.
-
14:40
And this is just visual fluff.
-
14:47
It's not important.
-
14:49
Google won't do anything differently with
-
14:52
your document whether it has this border-radius or this one.
-
14:56
But for the human eye, this is very important.
-
14:58
It changes the perception totally.
-
15:00
And designers want these kind of things.
-
15:02
They set these kind of things to get that kind of effect they want,
-
15:06
to get that kind of visual language they want.
-
15:08
They need tools like this.
-
15:12
Then we have CSS3 transitions.
-
15:15
Which was a way of doing things in CSS that
-
15:20
was probably beyond what we were thinking from the beginning.
-
15:23
But it sort of naturally fit in, and
-
15:25
it allows you to do things in three lines that you would otherwise have to write
-
15:29
JavaScript 100 lines, maybe, or write a library of JavaScript to import.
-
15:34
You can do animations in JavaScript.
-
15:36
And we saw a lot of people wanting to do animations and struggling with JavaScript.
-
15:41
I mean, programming is hard.
-
15:43
Programming can only be done by a few select people, really.
-
15:48
So we thought, let's put it in CSS and see what we can do.
-
15:53
And here we see an image element pointing to an SVG element.
-
15:58
You get that src= and then you have the two properties set.
-
16:02
One is the transition, 1s, one second.
-
16:06
And the other one is to transform it.
-
16:08
And if I hover over that, and that was me breaking the law.
-
16:12
Did you see that?
-
16:14
No, you didn't catch that?
-
16:15
Okay, so in Norwegian, this is the coat of arms in Norway.
-
16:18
And according to Norwegian law,
-
16:20
the lion must always be placed at the top of the document which it is and straight.
-
16:26
So, having him spin around is not legal actually.
-
16:29
>> [LAUGH] >> So, it's very powerful.
-
16:33
You can write CSS code to break the law.
-
16:35
[LAUGH] I'm very happy with that.
-
16:39
And also, I think it is quite easy to understand the code here.
-
16:41
If you wanted to change this, for example, if you want it to go faster or slower, you
-
16:45
would have immediately understood that you just need to change that one parameter.
-
16:48
You don't have to go into a JavaScript thing.
-
16:50
I am not trying to diss JavaScript.
-
16:53
JavaScript is very important.
-
16:55
It's sort of important in a sense that it's one of the foundations of the web.
-
16:59
But it should only be used when you really, really need to.
-
17:03
We should try to find better ways to do it, easier ways to do it.
-
17:06
And this I think is an easier way to do it.
-
17:08
You would immediately understand how to make it longer or shorter, or
-
17:13
how to rotate it in a different direction.
-
17:15
If you wanted it to spin the other way, I'm sure all of you would have known that
-
17:19
you, let's try changing that minus into a plus.
-
17:22
Then things would have gone the other way.
-
17:25
So, it's pretty easy stuff.
-
17:27
You can do a lot of stuff with it.
-
17:29
And we are constantly looking for more stuff to put in.
-
17:33
I must say, though, that the stuff we are putting in,
-
17:37
the stuff that gets into the specifications, it goes slower now
-
17:42
than it did in the 90s because it's a more complex world.
-
17:47
We need to make sure everything works together.
-
17:49
We need to test everything and
-
17:51
we also need to make sure that it runs on the mobile phone at 60 frames per second.
-
17:56
And if you add complex stuff then that takes more time, typically.
-
18:01
So, things are a bit slower today.
-
18:05
Anyway, one of the things that did get in was web fonts.
-
18:09
For awhile in the 90s we sorta were stuck with these fonts.
-
18:14
Ten or so fonts that Microsoft generously donated to, to the web.
-
18:21
They donated it in the sense that you could use these on Windows, but
-
18:25
also on the Mac and on Linux.
-
18:27
So their license was very liberal.
-
18:29
And that was helpful, because in order for CSS to work, you need fonts.
-
18:33
You need to be able to have some font material to set those font style and
-
18:39
font family properties on.
-
18:42
And these are well-designed.
-
18:44
They cover a fair range of the Unicode spectrum,
-
18:47
and people have used them to great effect.
-
18:50
Still, it's only ten or so of them.
-
18:53
And after a while, they became kind of boring and we needed more.
-
18:58
So we had in CSS2, the spec from 1998, we had the mechanism for
-
19:03
linking two font files on the web.
-
19:05
Just like you link to an image, you can link to a font file.
-
19:09
The problem was that we didn't have an agreement on the font format.
-
19:13
There was some reluctance to linking straight to Truetype files because people
-
19:18
were thinking, oh, the font industry will die if we do that.
-
19:22
There's gonna be piracy.
-
19:23
There's gonna be all sorts of things.
-
19:24
So, some browsers want you to do Truetype, some didn't.
-
19:28
And then we found the compromise where we said
-
19:31
we're gonna have this font specific format which is better for compression.
-
19:35
And that it's not encrypted, there's no DRM or anything,
-
19:38
but it needs a conversion.
-
19:40
You need to convert it from Truetype to this other format.
-
19:43
So they said okay that's probably good enough, let's try that.
-
19:45
And I think what we've seen is that we've had a resurgence of fonts.
-
19:49
The font industry has had, we've had lots of small companies coming up,
-
19:52
doing interesting designs.
-
19:54
Doing bespoke fonts.
-
19:55
And also putting them out for free for anyone to use.
-
19:58
This is, I'm gonna showcase some of the Fonts made by Dieter Steffman,
-
20:03
a German designer.
-
20:06
Using this is very easy.
-
20:08
Basically you import a style sheet that lists all of his fonts.
-
20:14
That's one line.
-
20:16
And then you can start using these in your code.
-
20:18
Like just set font-family Angel.
-
20:20
And this is actually letters.
-
20:22
It's not a picture.
-
20:23
This is just loading his font in the browser.
-
20:27
I'm using the Opera browser here to give my talk.
-
20:29
Becker Inline.
-
20:30
Broadcast Titling.
-
20:31
I mean, some of these fonts, they're more showcase, right?
-
20:35
I would not write my CD using this font only.
-
20:39
That's probably not gonna get you anywhere.
-
20:42
But for a birthday invitation, maybe.
-
20:45
Or for that marketing campaign you want to set yourself a little bit
-
20:51
apart from the Times Roman world.
-
20:53
And using Broadcast Titling or Cardiff makes some sense.
-
20:58
So there's definitely a design element to using those fonts.
-
21:03
There is another angle too, though.
-
21:06
Which is even more important I think.
-
21:08
At least for some people.
-
21:11
A few billions of people that don't live in
-
21:16
places that are well served by, western phones.
-
21:20
Here's a message though sent out to the Wikipedia mailing list in 2011.
-
21:25
When they turned on web fonts for 11 Indic languages.
-
21:31
So India is complex, language wise, and
-
21:36
it's hard to find fonts that cover all of the languages.
-
21:41
But using web fonts you can actually make these letters, the missing letters, or
-
21:45
the missing alphabets.
-
21:48
You can encode them yourself.
-
21:49
You don't have to lobby Microsoft or
-
21:51
the Lynx people to include this in your distribution, you can just do it yourself.
-
21:56
It's sort of democratizing the whole font distribution mechanism.
-
22:00
So using those fonts in this Indic language, you can now read Wikipedia
-
22:07
with good looking fonts in your local language which I think is very important.
-
22:12
I mean Wikipedia is one of those fantastic projects, right?
-
22:15
I were to name one project that's come out of the Internet web thing that is
-
22:19
truly worth discussing, it's Wikipedia.
-
22:23
The fact that we can all have a dictionary,
-
22:27
an encyclopedia in our pockets.
-
22:29
It's just incredible.
-
22:33
There's been a lot of work on testing as well.
-
22:36
We've had some trouble making sure that the browsers show things the same way.
-
22:43
But we had a very active community forum on that, because one thing was
-
22:47
the specification, which was done inside the World Wide Web consortium.
-
22:52
But then we needed sort of a grassroots organizations too,
-
22:56
to lobby for browser makers to actually follow the rules.
-
23:02
And Microsoft I must say were particularly challenging.
-
23:07
Because they got to a stage where they had monopoly power on the web.
-
23:11
They had more than 90% of the users use Internet Explorer.
-
23:15
And at that point they basically lost interest
-
23:18
in doing anything standards related.
-
23:21
They effectively closed down the Internet the IE team.
-
23:25
So the early 2000s were very hard.
-
23:28
When they said, I think this was in 2005,
-
23:29
they said they would do another version of Internet Explorer, IE7.
-
23:34
Then some of us sat down and said, okay, they're gonna make a new version of IE.
-
23:40
We need to make sure that that version corrects some of the mistakes,
-
23:44
and improves support for standards.
-
23:46
Otherwise we've lost.
-
23:49
So we made a page called the Acid 2,
-
23:54
which it was inspired by another, an early test,
-
23:58
called the Acid test, that had done some things but basically had limited coverage.
-
24:03
Acid you had much bigger coverage and
-
24:06
when rendered correctly in the browser it would look like this.
-
24:09
So you can immediately see that this looks correct.
-
24:12
He's smiling.
-
24:14
He's cheerful.
-
24:15
And every little pixel here every black or yellow bit has a test underneath it.
-
24:22
So it's quite complex the underlying code.
-
24:27
But anyone can see whether this is right or wrong.
-
24:30
And when we launched this it showcased bugs in all browsers.
-
24:37
But especially it was bad in Internet Explorer.
-
24:39
>> [LAUGH].
-
24:41
>> This is what it looked like.
-
24:42
And you can kind of make out that it is a face there you know?
-
24:45
You have, you have two eyes, but
-
24:49
it's kinda bloody and there's something dripping underneath here.
-
24:53
Not sure what that is really.
-
24:56
And then IE7 came along and oh, have they improved it?
-
25:03
They had done something, it's harder to make out that it's a face actually
-
25:07
although there are two dots at the top there, and the drooling is even worse.
-
25:12
So, we thought oh darn, they're not listening.
-
25:16
But then the fantastic thing was that the community rised up and
-
25:20
on every conference like this one if there was a Microsoft representative there,
-
25:24
he would be asked, so when are you gonna do the acid test?
-
25:26
That will really help my life as a designer if you could fix those problems,
-
25:31
fix the bugs.
-
25:32
So, I think at some point somebody inside must have said,
-
25:37
all right, we just have to do this.
-
25:39
There's no way around this.
-
25:40
They're gonna keep bothering us, so let's make my life easier.
-
25:44
So when I8 came around, this is what it looked like.
-
25:48
Truly magic.
-
25:49
They fixed all the problems, well not all of them, there's still problems on
-
25:54
the web but they fixed all the problems that they asked it to try to show.
-
25:58
So I think that shows the power of one web page can change
-
26:02
the course of the web if it has an active community around it.
-
26:07
So I'm very happy that we have conferences like this where designers can meet
-
26:12
discuss problems and even maybe start lobbying campaigns.
-
26:16
Personally I went to Opera to work there.
-
26:20
We had Netscape and Internet fight against each other.
-
26:24
Opera was the sort of the lone little browser from the Nordic areas.
-
26:33
We made browsers that made browsers and we still do.
-
26:37
We make browsers that make their way into many types of devices.
-
26:42
A lot of phones, a lot of TV sets, and a lot of desktop computers.
-
26:47
We have had especially success with our Opera Mini service,
-
26:53
which is a way of compressing it's a service more than a program really.
-
26:58
It compresses the web pages in the fixed network.
-
27:02
And then hands it over to the handsets.
-
27:07
That may be over a slow line it may be in a congested area.
-
27:11
It may be there are many reasons why I think compression still
-
27:14
will be around with us for a long time.
-
27:17
So, today we do web compression and also video compression.
-
27:22
When we started this,
-
27:24
we had some interesting articles being written about it.
-
27:31
Especially in Chicago these things started coming up.
-
27:33
Norway's number one.
-
27:37
So, the bus system in Chicago CTA it's called.
-
27:42
They had early on a very advanced tracking of buses,
-
27:45
they had these GPS devices and they sent the position, so
-
27:49
you could see on the map where all the buses in Chicago were.
-
27:54
And it turned out that some journalists got to see the access logs for
-
28:00
these webpages and they found that most of the requests actually came from Norway.
-
28:05
So this article, this journalist wrote, Norwegians are either utterly
-
28:10
fascinated with the goings and comings of CTA buses or there just are not
-
28:15
enough recreational activities in the land of fjords and Viking ships.
-
28:20
>> [LAUGH] >> So they had seen that most of
-
28:22
those who follow the buses were actually coming from Norway.
-
28:26
They thought that they were Norwegian.
-
28:28
Of course as you have already guessed I'm sure, these were not Norwegians at all.
-
28:32
These were people standing in Chicago, probably freezing, waiting for
-
28:36
the bus to come, but they had a phone in their pocket.
-
28:39
They had the upper mini running on that phone.
-
28:41
And when they made the request to say where the bus was,
-
28:44
this was sent through our servers, which were in Oslo at the time.
-
28:47
So from the log sites, it looked like they were coming from Norway, but
-
28:50
they were actually very, very local.
-
28:54
I think that journalist should be a little sharper here actually.
-
28:58
But this was early days you know?
-
29:00
And you weren't used to kinda your
-
29:03
watch communicating with your computer over a satellite link.
-
29:08
Things have changed the geographic world.
-
29:11
All right I'm going to look a little bit more into the future now.
-
29:13
Apps you heard of apps yeah?
-
29:16
All right we have them.
-
29:19
And we like them.
-
29:20
We all use them.
-
29:22
And I think it's a challenge for the web.
-
29:24
I think we need to make sure that we can write apps using web technologies.
-
29:28
And we can kind of but still a lot of people write native code for their apps.
-
29:33
And then you have to sign up with either Apple or Google and
-
29:36
you have to obey by their restrictions and you can't reach all devices.
-
29:41
You basically have this duopoly that rule.
-
29:44
I'd like for there to be a way to do all the things that you can do in an app you
-
29:49
should be able to do through HTML and CSS and JavaScript.
-
29:52
In one thing for example, which I think is very important,
-
29:56
is the paging effects that you can do in In these apps.
-
30:00
Many of them do so, for example, Facebook's Paper application.
-
30:05
This is a bit more like books, flipping the page rather than scrolling.
-
30:10
There was this talk yesterday about how the future of the web is printing.
-
30:14
It was very inspirational to hear.
-
30:16
I think we can learn a lot more from book design.
-
30:20
And I think paging is one of these things, and
-
30:23
we have seen some incredible apps where you can buy books.
-
30:27
And you have this multi-column layout, looks beautiful looks
-
30:32
beautiful on your tablet, and when you switch direction,
-
30:36
it changes from maybe two column to one column layout.
-
30:41
So I think there are things we can do there.
-
30:43
And we've actually in Opera we've done this prototype
-
30:46
where we actually add pages, add paging to the web.
-
30:51
So this is basically a web document.
-
30:56
But instead of having a scroll bar on the side,
-
31:00
we do things by scrolling to the next page or even to the next document.
-
31:05
So we can go from one article to the other by pressing page down or page up.
-
31:11
And of course on a tablet you would do this by swiping.
-
31:13
It's more natural there.
-
31:16
I think this interaction model, so instead of sort of the point and
-
31:18
click that we have on the web, you have that kind of gesture based
-
31:22
page navigation, which I think is a good thing.
-
31:26
And I'm trying to get this thing into CSS.
-
31:29
Like I said, it's a little harder these days, it goes a little slower.
-
31:32
But I do think it's important for us in order to compete with the apps.
-
31:39
And I do think, when Amazon sells more electronic books than paper books,
-
31:44
we should be able to display those electronic books in browsers.
-
31:48
You shouldn't have to have a special app for that.
-
31:51
And so I want to be able to do, like Alice in Wonderland,
-
31:54
I want to read Alice in Wonderland in a web browser.
-
31:56
And I'd like for there to be kind of a paging.
-
31:59
When you sit with a child on your lap,
-
32:02
then flipping the page becomes sort of a feature.
-
32:08
The child will wonder what's on the next page.
-
32:11
I want that to be there.
-
32:13
All right, let's continue.
-
32:18
So one of the spec which is used here is the multi-column layout spec,
-
32:21
which is being worked on, and it's being supported in most browsers by now.
-
32:27
You can see it in use in Wikipedia, where you have the list of
-
32:32
elements there is done using multi-column layout to save space.
-
32:37
I think I'm gonna give you a little demonstration of what we can do with,
-
32:41
do I have enough time for that?
-
32:43
Yeah, I have a few more minutes?
-
32:44
Yeah, let's try that.
-
32:45
I'm gonna show you first a newspaper article.
-
32:51
Take a look at this article, okay.
-
32:53
It's a British headliner here about cats.
-
32:59
The content isn't that important, but look at the layout.
-
33:03
This is stuff that papers had been doing for years and
-
33:06
years and can we do the same things on the web?
-
33:09
Do we want to?
-
33:10
I don't know, but I think we should look into it.
-
33:14
This is, starting page is a normal web page where you have a scroll bar
-
33:19
on the right-hand side.
-
33:21
And in order to get to the bottom you have to use that scroll bar.
-
33:24
So if I go to the next page here, I've given it two columns.
-
33:29
So instead of one column, I have two columns.
-
33:31
But in order to read those columns, I had to scroll up and down.
-
33:35
So it's not ideal.
-
33:40
I can also make the, instead of saying two columns,
-
33:44
I can actually set the columns to be an optimal size, 14 ms.
-
33:48
So that you typically have the number of columns
-
33:52
will change with regards to the content, which is good.
-
33:56
But it still doesn't solve my problem of having to scroll up and down.
-
34:00
In order to solve that problem we had to add a thing, and this is basically
-
34:05
just a flip, a binary switch where you switch from a scroll view to a paged view.
-
34:11
I think that switch is very important,
-
34:13
you can do it kind of with some JavaScript libraries.
-
34:15
But I'd like for
-
34:16
this to be easily accessible in a one-liner, like the code shown up here.
-
34:20
So when I'm here, I can go to the next page, and
-
34:23
the previous page, by way of paging, flipping pages back and forth.
-
34:28
So you don't have to do that scrolling up and down,
-
34:30
instead, you go to the next page.
-
34:33
All right, let's move on.
-
34:34
Let's see what else we can do.
-
34:36
We can also set things to span.
-
34:38
So here the image spans two columns,
-
34:40
and the headline there is also set to span two columns.
-
34:45
And it floats to the top corner,
-
34:47
which is also a very common way of doing things in newspaper.
-
34:51
Here we've added another image, given it a bottom floating position.
-
34:58
That one, and we can add more things, make them span.
-
35:06
So you see where I'm heading with this one?
-
35:10
Yeah, you see this, yeah.
-
35:13
But we have better animals, you see that, yeah, yeah?
-
35:15
>> [LAUGH] >> All right, so
-
35:17
now we can pretty much replicate what the newspaper did.
-
35:19
But we don't really know what the newspaper would have been if
-
35:22
it was on a mobile screen because that newspaper article was on paper only.
-
35:26
So it was a fixed representation.
-
35:28
What would the designer have done?
-
35:31
We don't know, but given in this system where we basically just
-
35:35
attach properties to these elements, we can actually make these things scalable.
-
35:39
I said that we could change the number of columns based on the width.
-
35:43
We can also change the positioning, and you see it's a little bit jerky now.
-
35:47
But it still makes for a decent presentation, at any point in time,
-
35:52
at any width here.
-
35:54
I don't think people will go back and forth like this.
-
35:57
But, we can make this page work on wide screens,
-
36:03
on tablets, and on mobile phones.
-
36:06
And there's no media queries at all in use here.
-
36:08
There's no tricks for adding different stuff.
-
36:11
This is just one style sheet where I basically said float to the bottom,
-
36:16
float to the top.
-
36:17
And then I turn on paging.
-
36:19
So it's a very scalable system.
-
36:21
In ten lines of code, I can describe newspaper layouts as they've been done for
-
36:26
the last hundreds of years.
-
36:29
All right, continuing on the book theme, because I think books are important, and I
-
36:34
think like the speaker said yesterday, we can learn things from the design of book.
-
36:39
I've actually spent some time recently on a classic
-
36:44
English book from 1798, does anyone know this one?
-
36:49
It is not important, but could anyone guess the author of this 1798?
-
36:54
Malthus, yeah, does that ring a bell?
-
36:57
Malthusian, yeah, he was a politician, a philosopher living at the time.
-
37:04
He wrote about how the populations would increase faster than the food supply,
-
37:09
and I'm not so interested in the topic really.
-
37:13
But I'm very interested in the typography from 1798, can we replicate that in CSS?
-
37:17
It's kind of a test to make sure, do they do stuff there that we can do today?
-
37:22
So, I have been studying this scanned version of the document.
-
37:26
It's scanned at archive.org, a fantastic place, and
-
37:29
I have recreated this in CSS, almost down to the millimeter level.
-
37:35
You can see some differences, and I need to
-
37:37
do a little bit of tweaking on font sizes for example, but it's pretty close.
-
37:42
So that's a good start but that was only the first page.
-
37:45
Let's go to some of the text.
-
37:49
And here we see some interesting things, how they wrote English in 1798.
-
37:55
I think I may fairly make two postulata.
-
37:59
All right, you see they're exchanging the S in the Postulata.
-
38:04
Postulate, we still have that word.
-
38:07
They are using the long S, the one that looks like an F,
-
38:12
which makes it kind of hard to read.
-
38:15
But using CSS, we can actually do that too.
-
38:18
We can replace one character with another.
-
38:20
So here is a screenshot from the PDF that I've generated with HTML and CSS.
-
38:25
And I still have the, I think I may fairly make two postulata.
-
38:29
The line breaking is in a different place.
-
38:32
But I think that has to do with manual versus automatic line breaking.
-
38:35
I don't know.
-
38:36
And then there's more stuff.
-
38:39
First, that food is necessary for the existence of man.
-
38:44
Here we see the ligatures.
-
38:46
You see the first, the ST there is a ligature, actually.
-
38:50
So we need to be able to support ligatures in CSS.
-
38:53
We also see that they used actually capital letters where today we would
-
38:57
use small letters.
-
38:58
But that's okay.
-
39:02
It says secondly that the passion between the sexes is necessary and
-
39:06
will remain nearly in its present state.
-
39:09
Yeah I'm not gonna make any comment on that.
-
39:11
I don't know what the passion between the sexes were in 1798.
-
39:14
I know it exists today still, but I'm more interested in the typography like I said.
-
39:20
So what does the code look like?
-
39:22
Here's a little snapshot, a little bit of the style sheet behind that experiment.
-
39:29
And we're turning on font variance.
-
39:32
Open type fonts typically have ligatures in them.
-
39:35
We can turn these on in this property now.
-
39:39
We can also use text replacement generating PDF.
-
39:41
I used a program called Prince to convert the HTML to PDF,
-
39:46
and there I can do text replacements.
-
39:49
I can replace the S with the long S, the one that looks like the F.
-
39:55
But it's not done in all cases, like not at the end of the word.
-
40:00
At the end of the word and the beginning of the words, the curly s remains so
-
40:05
I had to make some exceptions.
-
40:07
So this is kind of a little set of rules that are used
-
40:12
to replicate the typography from 1798.
-
40:16
Now going back even further, we have Gutenberg's bible.
-
40:22
I haven't started working on that yet.
-
40:24
That's the ultimate challenge, because even though it was one of the very first
-
40:28
books to be printed, it was really why Gutenberg invented that machine.
-
40:35
It's still one of the most beautiful books ever made.
-
40:38
And the the line breaking, the hyphenation,
-
40:42
the multicolumn layout, it's very, very advanced.
-
40:47
You will not find, I think, any book that's so
-
40:52
big and has that same level of aesthetics in it.
-
40:55
So I will try to replicate that in CSS one day as well.
-
40:58
We'll see if that succeeds.
-
41:00
But more importantly, I think, when looking at this book.
-
41:05
This is a picture I took this recently in New York at the Morgan Library.
-
41:11
They have three Bibles.
-
41:14
There's only 70 in existence, but they have three of them there and
-
41:17
you can go in and see.
-
41:18
It's fantastic.
-
41:19
It's like the same feeling I get when I see the Rosetta Stone at
-
41:21
the museum here in London.
-
41:23
And you can immediately see that this is a book and we would know how to use it.
-
41:30
And if there hadn't been this glass around it,
-
41:32
I could pick it up and flick the pages.
-
41:36
The book metaphor has survived from Gutenberg's time until today.
-
41:41
The font is a little hard to read, I must admit.
-
41:45
It's Fractule.
-
41:45
And the language is Latin.
-
41:47
So I would struggle with that as well.
-
41:49
But the basic metaphor, the user interface of the book has remained the same.
-
41:53
So this brings me to my last page, my last question to you.
-
41:57
How long will the web last?
-
42:01
Okay, we know it's been going on for 25 years, right?
-
42:05
How long will the HTML codes, those H1 elements that I wrote,
-
42:09
how long into the future will computers be able to read those?
-
42:15
I mean, we know things are gonna change, right?
-
42:16
We're gonna add more CSS stuff, right?
-
42:18
And we're probably gonna add more HTML elements too.
-
42:21
But if we go into a computer store x number of years from now,
-
42:27
will that computer we buy be able to read those HTML tags?
-
42:33
Yeah, you know it's impossible to give an answer to that but
-
42:36
I think that x in the equation is 500 years.
-
42:42
And that's not a random number.
-
42:43
It's a very convenient number for me to say, because in 500 years,
-
42:46
I'm not going to be around, so nobody can tell me I was wrong.
-
42:50
But it's also not random because of the guy I mentioned, Johannes Gutenberg.
-
42:57
The thing he did 500 years ago, we still can read today.
-
43:02
And the metaphors, the user metaphors are still with us.
-
43:06
So I think the concept of web page is going to be with us for a very, very,
-
43:10
very long time.
-
43:11
So we must make sure that the standards we use, and
-
43:14
the documents we write, that they have a certain standard.
-
43:17
They shouldn't just be for disposable use for the minute.
-
43:21
I think we need to make sure that this can actually last for a long time and that we
-
43:25
should try to encode all of mankind's information using those standards.
-
43:30
And this is also why I'm so interested in recreating books out of HTML and
-
43:35
CSS, because I don't think books are gonna be made that much anymore.
-
43:38
Paper is too expensive and there's too much information.
-
43:41
Books should be reserved for
-
43:43
those very special pieces of text that we truly want to save and enjoy.
-
43:49
And there's nothing better.
-
43:51
Sitting down with a beautiful book.
-
43:53
Opening it up.
-
43:54
The paper the feeling you get, at least inside me, is very special.
-
44:00
So I want to make sure that the standards we can use also can be made to
-
44:04
create books into the future.
-
44:07
And the book, just my finishing note, the book was truly important in the history,
-
44:12
especially in Europe.
-
44:13
In the 1460s when Guttenberg did this invention, Europe was in a backward state.
-
44:20
Then the printing press came along, and it suddenly became possible
-
44:23
to distribute information inexpensively to a lot of people.
-
44:27
Then suddenly a lot of things happened.
-
44:29
We had the Renaissance, the Reformation,
-
44:35
none of those things would have happened without books,
-
44:38
without being able to publish information and distribute it inexpensively.
-
44:43
And then the Industrial Revolution, as well.
-
44:45
It wouldn't have happened without the printing press.
-
44:48
And if you look at the web today, the only thing, really,
-
44:51
we can compare the invention of the web with is, I think, the printing press.
-
44:56
But, unlike the printing press, which basically changed Europe,
-
45:01
the web is changing the whole world.
-
45:04
We're seeing it often, that the users, they were in Chicago in my examples.
-
45:09
Today they're more likely to be in Vietnam, or Indonesia, or Ukraine.
-
45:12
We have lots of users in these places, where they have mobile phones,
-
45:16
they have access to the web through very narrow channels.
-
45:20
But they actually can get Wikipedia in their pockets.
-
45:23
So this will be changing the world in the years to come.
-
45:27
And like the book, I think it will be mostly for the better, and
-
45:32
I hope you're with me on that.
-
45:33
Let's make sure we can enjoy this web for a long time.
-
45:37
Thank you.
-
45:38
>> [APPLAUSE]
-
45:45
[MUSIC]
You need to sign up for Treehouse in order to download course files.
Sign up