Home > Web Front-end > HTML Tutorial > CSS is just part of evolution_html/css_WEB-ITnose

CSS is just part of evolution_html/css_WEB-ITnose

WBOY
Release: 2016-06-24 11:48:00
Original
1000 people have browsed it

Bert Bos is a computer scientist and one of the founders of CSS. During the development of CSS, Bos was one of the first to collaborate with Håkon Wium Lie (the father of CSS). In 1996, he joined the World Wide Web Consortium (W3C) and was responsible for CSS development. He served as chair of the CSS Working Group and is currently the working group's W3C representative.

Prior to this, Bert independently developed the Argo browser as a test application for his style sheet proposal while studying at the University of Groningen. The Argo browser can handle its own SSP style sheet language. Using this new browser language, he created a CSS standard. Later, Lie and Bos collaborated to develop CSS into W3C Recommendation.

Interview: Gao Bo | Editing: Li Pan

Question: Mr. Bert, you have been to China many times. What changes do you think are happening to web developers in China recently?

I came to Beijing in 2008, and I have also been to Hong Kong and Shenzhen before. Although China started late, more and more companies are now joining the W3C, including browser companies and search companies. Although China started later than the United States, Europe, and Australia, now it seems that Chinese developers are no different from developers around the world. They make the same repairs, ask similar questions, and have the same The layout is troublesome.

 Q: Do you think that although Chinese developers started late, they have now caught up?

 Yes. Judging from various companies, although Chinese developers lagged behind for a while when they started, they have now caught up and are technically in sync.

 Q: Now CSS has become an indispensable part of web development, but in fact the concept of CSS is not necessarily there from the beginning (there is already HTML description content, and JavaScript Describing behavior and interaction), it can be said that it was invented from scratch. As one of the founders of CSS, can you tell us how the idea of ​​needing a set of style sheets came about in the early stages of development? What are the stories from the early development process?

Håkon Wium Lie and I invented CSS, but we didn’t invent the concept of style sheets. This concept existed a long time ago. What we invented is just a concrete language that makes web development easier. However, the concept of documenting and structuring content with stylesheets dates back to much earlier than this. In a book, what kind of fonts, what kind of pictures, and how big the edges are are all determined by style sheets. These concepts have existed for a long time. Electronic style sheets expressed in computer language have also appeared in the mid-1980s.

Let’s put it this way, ML appeared before HTML, HTML was built on XML, and XML had style sheets long ago. We studied the early style sheet concept of XML, and also studied the concept of style sheet that was still developing at that time, and absorbed many good ideas from it. Additionally, we met the inventor of HTML at a conference, where we heard a lot about the need for style sheets. Although we had never interacted with these people before, we gained many key ideas from them.

Suffice to say, for us, this is not an invented concept, but for many others, it all started with HTML and CSS. But I know they are just part of evolution.

Question: The full name of CSS is cascading style sheet. Why is it cascading instead of other words, such as combining?

Håkon Wium Lie has a claim that the view consists of two parts, one is what the provider thinks people should see, and the other is the document that the recipient actually reads on the screen. From the very beginning, our design philosophy was that the receiver also needs to have an influence on the result of the view. That is, after getting the content, you can adjust it to what you want. Content and styling come from the provider, who can specify specific colors and sizes. But the recipient can use different fonts or colors depending on the peculiarities of the screen. That's the idea: multiple influences, multiple style sheets integrated together, which is the basis of the concept of cascading style sheets. Cascading means one thing is layered on top of another. Cascading is like a waterfall, adding up to each other and finally reaching the result. This is a metaphor.

 Q: Your background is in mathematics. Did this background help or influence you when you created CSS?

I learned grammar in computer science, and I also learned some artificial intelligence. Grammar analysis also helped me a lot. In terms of language design, we try to make syntax that is easy to read and parse. Therefore, studying computer science has helped me more than mathematics.

 Q: You once created a browser called Argo and tested CSS on it, is that right?

No, Argo is not for testing style sheets, but for teachers and students of the University's Central African Institute of Technology (such as the School of Art, School of History) to freely access the Internet, so that they can exchange files online and read the collection catalog , send and receive emails, etc. So my goal is to create a very easy-to-use browser that supports HTML but also supports XML, because XML is used more in some colleges. For example, someone is studying the Bible and they need to compare different versions of the Bible. These files are all presented through XML. They also need style sheets, so I need a style sheet language in my browser. There were some interesting concepts in stylesheets, but at the time they didn't pay attention to syntax, and not everyone wanted to write code. Håkon Wium Lie also expressed his own ideas at this time, and I think our ideas can be combined.

 Q: As one of the creators of CSS, you may be the best person to answer this question. What is the most fundamental purpose of CSS? What purpose can transcend time? How will this purpose impact future development?

There are several goals, and they evolve over time. The first and main reason is to protect HTML. At that time, we saw that some companies, including Mozilla, began to add things to HTML in order to make the presentation effect better. We believe content and style should be distinguished because you want to see the same content in different styles on different devices and screens. To protect the stability of HTML, a lot of people, not just Håkon Wium Lie and me, are trying to do the same thing. We knew we needed another language to protect HTML, which is directly why we created CSS.

Another reason is that once you have a professional layout language, you can do more things. These things are difficult to accomplish using only HTML, but are a piece of cake for specialized languages. In addition, if you complete a style, you can reuse it again, which is more efficient. At the same time, because this is a language specifically designed to handle stylesheets, it is also more compact. Using HTML CSS requires less code and is more concise than simply using HTML. These are the reasons why we created CSS in the early days. But as time went on, other reasons emerged. For example, when a team writes documents, some people can specialize in writing documents, while others can focus on styles. This is the concept of traditional publishing, and this is how books are published. Someone writes the book, but they are not responsible for the formatting. This concept is very traditional and applies to the Web as well.

Some concepts emerged later, such as execution efficiency. At some point, we can implement animations. You can do animations in other languages ​​​​such as JavaScript or plug-ins, but we have noticed that it is easier to do this with CSS. CSS is declarative, so you don’t need to write a special program to implement it. You can state where an object's action begins, where it ends, and what path is taken in between. If you use JavaScript and need to execute a loop, the computer may not be able to predict how to execute it. But if you use CSS and execute it in the browser, they can see how things are progressing and where they should end. So you can do optimization and predict animation. This also makes animation more efficient and looks better on the screen. Execution efficiency is also the most important reason why CSS will be used more in HTML.

  Question: Nowadays, the traffic on PC has been eroded by mobile terminals. How do you think CSS will help this battle between web applications and local applications?

I don’t think this is a war, there is room for both sides to survive. But we do want the web platform to become as powerful as the local platform. Because once a web application is written it can run on any device anywhere, it is more efficient and cheaper. So we really hope that the Web platform can complete the functions of the local platform. CSS has also been trying to find boundaries: what belongs to CSS and what belongs to SVG, and some of them are difficult to define. But we think there is more room for CSS, and we want to do more in CSS. Because people find that even if they can do some things easier in SVG than in CSS, there is still a lot of work they are willing to do in parallel with SVG and CSS. I also work with the JavaScript API working group. JavaScript is the interface for connecting functions such as GPS and motion sensing. These designs also connect the API interfaces of different devices.

A lot of the time we also change styles based on how people interact with the device, so we thought there could be more that could go into CSS. People often suggest things that should be in CSS, but we feel that some things should be better done elsewhere. So we need to analyze specifically what people’s needs are and what we can provide.

 Q: It can be seen that CSS is a good answer, but it is not the answer to all questions. Many people are interested in the topic of preprocessors and they have some concerns about using these preprocessors. What is your opinion on this?

I was surprised that preprocessors appeared so late. I thought Sass and LESS would appear earlier. Because CSS is a simple text-based language, writing a preprocessor is not difficult. People do use preprocessors to complete more professional designs, but not everyone needs a preprocessor. You must first be a programmer to use it. But if you are a programmer, then tools like Sass will be very helpful to you. The emergence of tools is also a good thing for our work group. Preprocessors reduce the pressure of CSS. We can focus on functionality, fonts, and layout, and no longer need to think about programmer-friendly features like variables, because this has already been done in the preprocessor. In addition, people can also choose their preferred preprocessor, if we preset the preprocessor in CSS, there is only one way. But now everyone can choose, Sass, LESS, or even you can choose to use PHP. I think preprocessors are very important for professional designers.

 Q: What is the reason for adding custom attributes to CSS?

Variables are important for programmers, and if you want to write a lot of stylesheets, all of this can be done in Sass and LESS. I don't think the W3C working group should be responsible for defining how to get things done. We are responsible for creating the core language, properties and values, and others can decide how to write CSS. But now we have variables. The reason for adding variables is that we discovered that we can make CSS more conventional through custom properties and values. In terms of custom attributes, we take advantage of CSS's own mechanism of cascading, which means that you can attach variables to elements, so that you can not only attach style attributes, but also attach arbitrary attributes to the file. This is convenient for applications, like if you have files and structures and you need to develop something into a high-level element, you can use CSS to attach these values, you can do it in HTML, but it is easier to use CSS. That's why we now have custom properties and values.

If you want to use variables, just use Sass. But more and more people will start to use custom attributes. Custom attributes have many possibilities in the future, and there are many interesting features worth looking forward to that may appear.

 Q: Modularity seems to be contrary to the idea of ​​CSS. Can you talk about the reason for introducing such a design?

There are two types of modularity. In working groups, we split up to develop more detailed specifications, which is a form of modularity. The reason we do this is that the specification process is simpler and can be tested on a smaller scale. But this has little to do with the modular structure in CSS, in the sense that we are not modularizing CSS but modularizing our internal processes. Since we can't do everything at the same time, we need to focus on one attribute and then move on to the next.

Another kind of modularity is the way people write style sheets. You can write many style sheets and then merge them. Multiple inputs can help you turn your work into your own style sheet.

There is even a third meaning, which has not yet started but has been discussed in the working group. We started talking about letting other developers add features to CSS, and we needed another way to modularize CSS, so we needed some kind of syntax, an interface in JavaScript or some other language, that allowed people to add features to CSS and also Comply with CSS syntax. You can use your own stylesheet or insert extensions. Although this matter does not exist yet, it is already being discussed. Although there are currently two forms of modules, it is possible that modularity will have a third meaning in the future.

 Q: CSS is trying to catch up with XSL. Will XSL become redundant by that day?

It is difficult to predict the future. XSL is still widely used in the publishing industry, and people still use XSL to publish books. But as I said, we are no longer developing XSL because we can't find enough people to form a working group. While we hope to have a new version of XSL (which is still version 1 for now), we currently have no plans to develop the next version. Maybe we'll be able to form a working group soon, maybe we never will, there's no telling.

Now our energy is focused on CSS. People hope to use CSS to complete the work that XSL can complete. The functions of XSL are designed for publishing, generating indexes, directories, etc. We will implement these features in the future, but there is no firm date.

Apart from that, we still have a lot of things to do. Before we stopped the XSL working group, there were already a number of requests submitted for XSL version 2. These were the features that users proposed to the working group that they wanted XSL to implement. The requirements still exist, and we may implement them in CSS as well, but that's for the next step.

 Q: CSS is almost 20 years old. You have been involved in the development work from the beginning. Looking back after so many years, which features are your favorite? Which ones are your least favorite?

What I like most about CSS is that almost anyone can write CSS. Anyone can look up some examples, look online to see what other people are doing, and then write their own stylesheet. This is less true now, as languages ​​get larger and stylesheets become more complex. But I still think it's not that hard to write CSS. You don't need to be a professional to write some web files, some HTML, and a little CSS. But of course, in order to complete a more advanced and perfect display, we also need professionals. Relatively speaking, XSL does not have such quality. XSL is designed for professionals.

What I am most dissatisfied with... may be the functions we failed to do well, such as positioning. This feature allows you to place an element in CSS at a specific point on the screen using horizontal and vertical coordinates. When CSS first started in 1996, we wanted to do this. A document from the time explained how we would lay out, modify the screen, and write anywhere. We call it frame, which appears earlier than HTML frame. We now call this concept regions, and the concept is the same for browsers and workgroups, but 1996 was too early for this concept. Browsers back then couldn't do what they can do today. HTML was only two years old at the time, and what was recorded was just a sequence, starting with the first letter and ending with the last letter. So the concept of "creating an event on the screen" is too advanced. But another concept came into being, which is the extra frame. It started from a very small concept and gradually developed into a very flexible concept. This is why the flex box appears now. This is the best we can do now.

 Q: In addition to the W3C working group, do you also work on any other projects? Have you ever considered writing a framework yourself?

I thought about writing a framework, but I never had the time to do it. In addition to the W3C working group, I also have a MathML working group, but the work is basically over. We have completed MathML version 3, and there are no plans to create the next version yet.

In the rest of the time, I am also working on some projects, but they have nothing to do with CSS, they are about network security. In Europe, the European Union will subsidize relevant research. Everyone can apply for a research project, but the project must be completed in the form of cooperation. Individuals and independent institutions cannot apply. W3C, together with the University of Leuven in Belgium, University College Dublin, and SAP Germany, jointly applied for research in network security. Our research covers many well-known network problems, but also some lesser-known problems, which makes it a very interesting project. A lot of research work is carried out in universities, and implementation work is carried out in companies. The work of both parties needs to be coordinated with each other. Standardization work is carried out in W3C and other institutions. This project took up a lot of my time, but I learned a lot from it.

 Q: Thank you very much for taking the time to be interviewed. I hope you will bring more exciting content next time you come to China.

Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template