CSS tutorial about css framework web design
I personally summarized some experience in developing css framework and made a fool of myself. I hope your discussion will enable us to make progress together. :)
1. CSS framework
China’s Internet industry has developed for 10 years, and browsers have also evolved from the earliest popular NS to the current FF3.IE7 and so on... The position of front-end development engineer was also born. In recent years, there has been a very popular word in web development - "framework". JavaScript frameworks such as YUI, JQuery, and Prototype have indeed become powerful tools for front-end development engineers when developing websites. why? Because the framework includes tools, function libraries, conventions, and attempts to abstract common modules from common tasks that can be reused, allowing designers and programmers to avoid repeated development. In layman's terms, it saves most of the time on repetitive work.
The same goes for writing css. From the beginning, it was just defining text color and content layout, to now defining all performances. The CSS framework has gradually received more attention, because everyone realizes that extracting abstract modules from concrete expressions for reuse is the most important means to reduce user downloads and facilitate team and individual development.
2. Development sequence of css framework
a) Format reset.css
The real benefit of formatting css is that it can start work quickly. You can introduce the framework into a new HTML file without having to deal with resetting padding and margins. , to achieve unified layout and the same performance under the browser.
b) Layout layout.css
Define whether the page is two columns or three columns, full screen or 1024×768...
A website design may have many kinds of layouts, but most of them are composed of several complex layouts. Practical layout composition, selectively introduce the required layout, and you can quickly apply the desired page layout.
c) Basic style type.css
Define the font size and color of body, h1-h6, a:link-a:active, p, etc.
CSS reference of basic styles, such as defining ul class as "ul-text" to display the same icon, line spacing, and link color.
You can also apply it like this: class="ul-text square", the square icon is displayed in front of the li.
d) Table modification table.css
Define the performance of tags such as table, tr, td, th, thead, tfoot, tbody, and caption.
It is the same as the basic style, but the presentation form of the table on the existing website is almost all data processing, so the references are stored separately. For example, if table-style-1 is applied to a table, it will be a table with a black border, and table-style-2 will be a table with a yellow border.
e) Form modification form.css
Define the performance of fieldset, label, button, input, select, and textarea labels.
Most websites’ forms, buttons, and input boxes are almost the same. The reason why this css is introduced is to facilitate unified display in various browsers. The display of default buttons, input boxes, etc. in various browsers is very different. Although it has been initially unified in the formatted css, the borders of the input boxes and the styles of the buttons need to be defined in this css. Unfortunately, the selection cannot be unified. If you consider using js to implement it, the cost is too high.
f) Print modification print.css
Modify the printed output page.
g) CSS that contains other css
frontpage.css, list.css, detail.css, register.css, etc.
Introduce the corresponding CSS according to various references. For example, if there is no table modification in the list page, table.css will not be introduced. to save code.
3. Creation of css framework folder
a) core mainly
stores reset.css, layout.css, type.css, print.css
b) bud module
stores table.css, form.css, album .css and other css
c) petal specific application
Store encapsulated css. frontpage.css, llist.css, detail.css, register.css and other css. The css stored in this folder are directly referenced.
The naming of the folder is based on personal preference! I also hope to name it with electrons, protons, etc. hey-hey!
4. Advantages of CSS framework
a) Improve development efficiency.
b) Standardized name definition for easy maintenance.
c) Standardize the project development process
d) The css code is clearer and simpler. The html code is more reasonable.
5. Disadvantages of CSS framework.
a) Increased learning costs. You need to understand the entire framework and read the framework's documentation.
b) The css framework is bloated for pages such as a small project. There may be a lot of code in the framework that you won't use.
c) It may not help your skills improve. Too dependent on the framework, making it difficult to troubleshoot bugs. Including bugs inherent in the framework.
d) It is painful to choose the framework and development framework you need. After writing it, I found that it was becoming more and more inflexible and bloated. Sorry -_-
6. Common problems encountered in developing and using CSS frameworks.
1. There are too many external reference styles on the page.
For example, the margin definition of ul will be declared as 0 in the formatted css, and margin: 5px 10px may be declared in the basic style css;
So there will be multiple definitions in Yslow.
2. Consideration of component reusability.
For example, the css of the form definition defines all the form modifications, and it is assumed that only 30% of this css is needed in the registration page. Should we cut out the unnecessary 70%?
Based on the above two problems, I personally think that the solution is to encapsulate, so that what should be there and what should not be there are not. Try to reduce the number of http connections and the size of css. But if this is done completely, the reusability of CSS will become very poor, and manual encapsulation in the later stage will be very painful. We can only apply Xiao Ma’s words: “Specific circumstances require specific analysis.” Life is really a contradiction...
3. Should we support em?
It can be seen that if we want to support em, the biggest purpose is to be able to freely scale the browser according to the user's resolution. For users with extremely large monitors and small Monitor users are very useful. However, after collecting the browser data of our users, we found that there are very few users who are at these two ends. It is conceivable that it is obviously not cost-effective to spend more than twice the normal development time for these users, so When we were developing tbsp, our team decided not to support em. Of course, this is a suggestion, and we also hope to use em to give users the best experience.
The above six points are the thoughts and summaries of my and the entire Taobao UED team’s daily development. You may have some different opinions. That’s okay. Leave us a message and let’s discuss it together!
The above is the content of the CSS tutorial on CSS framework web design. For more related articles, please pay attention to the PHP Chinese website (www.php.cn)!

Hot AI Tools

Undresser.AI Undress
AI-powered app for creating realistic nude photos

AI Clothes Remover
Online AI tool for removing clothes from photos.

Undress AI Tool
Undress images for free

Clothoff.io
AI clothes remover

Video Face Swap
Swap faces in any video effortlessly with our completely free AI face swap tool!

Hot Article

Hot Tools

Notepad++7.3.1
Easy-to-use and free code editor

SublimeText3 Chinese version
Chinese version, very easy to use

Zend Studio 13.0.1
Powerful PHP integrated development environment

Dreamweaver CS6
Visual web development tools

SublimeText3 Mac version
God-level code editing software (SublimeText3)

Hot Topics











According to news on March 4, Kubi Rubik's Cube will launch the "Xiaoku Tablet 2Lite" tablet computer on March 5, with an initial price of 649 yuan. It is reported that the new tablet is equipped with Unisoc’s T606 processor, which uses a 12nm process and consists of two 1.6GHz ArmCortex-A75 CPUs and six ArmCortex-A55 processors. The screen uses a 10.95-inch IPS eye-protection screen with a resolution of 1280x800 and a brightness as high as 350 nits. In terms of imaging, Xiaoku Tablet 2Lite has a 13-megapixel main camera on the rear and a 5-megapixel selfie lens on the front. It also supports 4G Internet access/calls, Bluetooth 5.0, and Wi-Fi5. In addition, the official claimed that this tablet&l

According to news on April 26, ZTE’s 5G portable Wi-Fi U50S is now officially on sale, starting at 899 yuan. In terms of appearance design, ZTE U50S Portable Wi-Fi is simple and stylish, easy to hold and pack. Its size is 159/73/18mm and is easy to carry, allowing you to enjoy 5G high-speed network anytime and anywhere, achieving an unimpeded mobile office and entertainment experience. ZTE 5G portable Wi-Fi U50S supports the advanced Wi-Fi 6 protocol with a peak rate of up to 1800Mbps. It relies on the Snapdragon X55 high-performance 5G platform to provide users with an extremely fast network experience. Not only does it support the 5G dual-mode SA+NSA network environment and Sub-6GHz frequency band, the measured network speed can even reach an astonishing 500Mbps, which is easily satisfactory.

According to news on April 17, HMD teamed up with the well-known beer brand Heineken and the creative company Bodega to launch a unique flip phone - The Boring Phone. This phone is not only full of innovation in design, but also returns to nature in terms of functionality, aiming to lead people back to real interpersonal interactions and enjoy the pure time of drinking with friends. Boring mobile phone adopts a unique transparent flip design, showing a simple yet elegant aesthetic. It is equipped with a 2.8-inch QVGA display inside and a 1.77-inch display outside, providing users with a basic visual interaction experience. In terms of photography, although it is only equipped with a 30-megapixel camera, it is enough to handle simple daily tasks.

According to news on April 3, Taipower’s upcoming M50 Mini tablet computer is a device with rich functions and powerful performance. This new 8-inch small tablet is equipped with an 8.7-inch IPS screen, providing users with an excellent visual experience. Its metal body design is not only beautiful but also enhances the durability of the device. In terms of performance, the M50Mini is equipped with the Unisoc T606 eight-core processor, which has two A75 cores and six A55 cores, ensuring a smooth and efficient running experience. At the same time, the tablet is also equipped with a 6GB+128GB storage solution and supports 8GB memory expansion, which meets users’ needs for storage and multi-tasking. In terms of battery life, M50Mini is equipped with a 5000mAh battery and supports Ty

According to news on July 12, the Honor Magic V3 series was officially released today, equipped with the new Honor Vision Soothing Oasis eye protection screen. While the screen itself has high specifications and high quality, it also pioneered the introduction of AI active eye protection technology. It is reported that the traditional way to alleviate myopia is "myopia glasses". The power of myopia glasses is evenly distributed to ensure that the central area of sight is imaged on the retina, but the peripheral area is imaged behind the retina. The retina senses that the image is behind, promoting the eye axis direction. grow later, thereby deepening the degree. At present, one of the main ways to alleviate the development of myopia is the "defocus lens". The central area has a normal power, and the peripheral area is adjusted through optical design partitions, so that the image in the peripheral area falls in front of the retina.

According to news on May 13, vivoX100s was officially released tonight. In addition to excellent images, the new phone also performs very well in terms of signal. According to vivo’s official introduction, vivoX100s uses an innovative universal signal amplification system, which is equipped with up to 21 antennas. This design has been re-optimized based on the direct screen to balance many signal requirements such as 5G, 4G, Wi-Fi, GPS, and NFC. This makes vivoX100s the mobile phone with the strongest signal reception capability in vivo’s history. The new phone also uses a unique 360° surround design, with antennas distributed around the body. This design not only enhances the signal strength, but also optimizes various daily holding postures to avoid problems caused by improper holding methods.

At work, ppt is an office software often used by professionals. A complete ppt must have a good ending page. Different professional requirements give different ppt production characteristics. Regarding the production of the end page, how can we design it more attractively? Let’s take a look at how to design the end page of ppt! The design of the ppt end page can be adjusted in terms of text and animation, and you can choose a simple or dazzling style according to your needs. Next, we will focus on how to use innovative expression methods to create a ppt end page that meets the requirements. So let’s start today’s tutorial. 1. For the production of the end page, any text in the picture can be used. The important thing about the end page is that it means that my presentation is over. 2. In addition to these words,

According to news on July 29, the Honor X60i mobile phone is officially on sale today, starting at 1,399 yuan. In terms of design, the Honor X60i mobile phone adopts a straight screen design with a hole in the center and almost unbounded ultra-narrow borders on all four sides, which greatly broadens the field of view. Honor X60i parameters Display: 6.7-inch high-definition display Battery: 5000mAh large-capacity battery Processor: Dimensity 6080 processor (TSMC 6nm, 2x2.4G A76+6×2G A55) System: MagicOS8.0 system Other features: 5G signal enhancement, smart capsule, under-screen fingerprint, dual MIC, noise reduction, knowledge Q&A, photography capabilities: rear dual camera system: 50 million pixels main camera, 2 million pixels auxiliary lens, front selfie lens: 8 million pixels, price: 8GB
