首页 > 其他分享 >CSS-框架替代指南-全-

CSS-框架替代指南-全-

时间:2024-08-13 14:04:48浏览次数:12  
标签:指南 code mdl Figure Listing 替代 class CSS define

CSS 框架替代指南(全)

原文:CSS Framework Alternatives

协议:CC BY-NC-SA 4.0

一、为直观的网页设计选择轻量级框架

什么是框架?

A framework is a premeditated set of concepts, modules, and standardized criteria that make the task of developing web sites and web applications easier. It provides generic functionality with already written modules and tailored components created in a standard manner. In short, it is a reusable software environment that allows web designers and developers to easily build their projects and solutions with minimal coding and without worrying about the low-level details. This reduces development time and provides easy upkeep and alterations whenever necessary. Usually, there are two kinds of frameworks .

  • 前端框架(CSS 和 JavaScript 框架)
  • 后端或服务器端编程框架

While back-end frameworks are used by web developers and programmers to build applications on the server-side, front-end frameworks are used by web designers and developers for implementing the Cascading Style Sheets language. In this book, you will get a glimpse into front-end frameworks, which basically are pre-prepared packages containing the structure of files and folders of Hypertext Markup Language (HTML) and CSS documents (some with JavaScript functions), which help designers and developers build interactive and immersive web sites. Frameworks allow you to use a common standardized structure that cuts out much of the groundwork of writing code from scratch and helps you reuse components, modules, and libraries, freeing you up to focus on core tasks at a high level.

CSS 框架的组件

The following are the basic components of a CSS framework:

  • 网格(帮助组织内容和设计布局的结构)
  • 排版元素
  • 跨浏览器兼容性
  • 用于定位元素的帮助器类
  • 实用程序类别
  • 导航元素
  • 用 Sass 等预处理程序编写的源代码
  • 媒体元素(徽章、工具提示、评论等)

使用 CSS 框架的优势

Though some people have advocated not using CSS frameworks, mainly because of issues such as bloated structure, ingrained HTML markup, and a common aesthetic across framework-based web sites, using a CSS framework has several benefits. You should try using a CSS framework for the following reasons:

  • 干净一致的编码
  • 跨浏览器兼容性
  • 基于网格的设计
  • 整合健康编码实践的能力
  • 易于构建的原型
  • 易于维护和保养
  • 允许重用和干净的同质代码结构
  • 易于扩展和修改
  • 可靠的文件
  • 构建沉浸式网站的共同基础
  • 易接近

A budding developer can find it difficult to build web sites just based on pure HTML, CSS, and JavaScript. In addition, grid-based layouts help budding designers to position, structure, and design the layout quite easily. You do not have to reinvent the wheel, meaning you can get some hands-on experience without the intricacies and dilemmas that you will come across when you code from scratch. Good and clean coding practices are imperative when you grow as a web designer, and frameworks are all about awesome cohesiveness and consistent coding that will hold you in good stead in times to come.

各种流行的框架

In this section, you will look at the most popular frameworks used by web designers across the globe. The most popular frameworks for designing web sites are Bootstrap, Foundation, and Materialize. Which one a developer chooses depends on the needs and requirements of a web site and its design. However, just because a framework is popular doesn’t mean it fits the bill when it comes to designing your projects. You need to consider several issues when it comes to selecting a framework; we’ll talk more about that later. Let’s now take a look at the various superlative frameworks that are in vogue today.

引导程序

Bootstrap is the most popular mobile-first framework in web design; it’s used extensively by developers across the globe (Figure 1-1). You can find more information on the official web site at getbootstrap.com/ .A450102_1_En_1_Fig1_HTML.jpg Figure 1-1Bootstrap Bootstrap adopts a mobile-first paradigm by which you can build responsive web sites. It comes with components, modules, JavaScript functions, and media queries that help developers build immersive web sites with ease.

基础

Foundation was the earliest responsive framework and is as massive and advanced as Bootstrap for building web products and services (Figure 1-2). Foundation comes with cool features such as Flex Grid and Motion UI . The latest version, Foundation 6, is quicker, is lighter in size compared to its earlier versions, and is a solid front-end framework for designing beautiful web sites, e-mails, and apps that look good on any device. You can find more information on the official web site at foundation.zurb.com/ .A450102_1_En_1_Fig2_HTML.jpg Figure 1-2 Foundation

实现

Materialize is a modern front-end framework based on Google’s Material Design philosophy that helps developers build and design immersive web sites (Figure 1-3). You can find more information on the official web site at materializecss.com/ .A450102_1_En_1_Fig3_HTML.jpg Figure 1-3Materialize Materialize has a superlative, creative user interface (UI) component library that incorporates cross-browser compatibility and device-agnostic capabilities for developing attractive and consistent web sites.

骨骼

As mentioned earlier, sometimes you don’t need a large framework, especially if you are embarking on a small project. Skeleton is a simple, responsive boilerplate and is extremely lightweight with 400 lines of code and with a mobile-based philosophy (Figure 1-4). You can find more information on the official web site at getskeleton.com/ .A450102_1_En_1_Fig4_HTML.jpg Figure 1-4Skeleton

Milligram

Milligram is a minimalistic framework with just enough styles for small and interactive web sites (Figure 1-5). Its zipped file size is only 2KB. It comes with a mobile-first philosophy and supports the modern browser versions of Chrome, Firefox, Safari, IE, and Opera. Its cutting-edge features include the FlexBox grid system, and it is a simple, top-notch framework from a usability point of view. You can find more information on the official web site at milligram.io/ .A450102_1_En_1_Fig5_HTML.jpg Figure 1-5 Milligram

UIkit

UIkit is a light and modular front-end framework for developing faster and powerful web interfaces (Figure 1-6). It has a massive collection of HTML, CSS, and JavaScript components and modules that can be extended with themes. It is flexible because it can be customized to give a unique feel to your web sites. You can find more information on the official web site at getuikit.com/v2/ .A450102_1_En_1_Fig6_HTML.jpg Figure 1-6UIkit

材质设计精简版

Google released its own front-end framework called Material Design Lite (MDL) that is based on its Material Design philosophy (Figure 1-7). MDL is a lightweight framework with few dependencies and is focused on simple web sites such as blogs and landing pages. It allows you to customize styles and web sites designed using MDL degrade gracefully in legacy browsers. You can find more information on the official web site at getmdl.io/ .A450102_1_En_1_Fig7_HTML.jpg Figure 1-7Material Design Lite

Susy!Susy

In today’s era of agile development and constant changes, the layout designs are crucial and cannot be restricted to a single framework, especially if your web site is intricate design-wise. With Susy (Figure 1-8), the settings are not set in stone, meaning you can use its integrated Sass-based libraries to create immersive layouts with potent structural designs. Susy is not a typical framework but more of a UI utility as it simplifies and streamlines the task of designing intricate grid layouts. You can find more information on the official web site at susy.oddbird.net/ .A450102_1_En_1_Fig8_HTML.jpg Figure 1-8 Susy

选择框架

As you can see, we have covered many popular frameworks. Choosing the right framework is quite important and depends on the needs and requirement of your projects. Some frameworks are bloated, meaning they have too many built-in styles, which might not be required for a small project. The following are some of the factors that you should consider when choosing a framework:

  • 一个现有的 web 项目可能已经在使用一个特定的框架,而该框架不能与您想要的框架一起使用。
  • 对于与性能相关的问题,一些项目可能不需要与重量级框架相关的混乱。
  • 您可能需要不同的预处理器支持,比如对于 LESS 或 Sass,它们没有与您想要的框架集成。
  • 使用特定框架构建的网站可能看起来很相似,如果没有进行定制以提供真实的外观和感觉的话。

There are several other factors such as the ease of use, speed of configuration, usability, features, widgets, components, long-term support, and reliability that you need to consider when choosing a framework. In summary, you need to choose your framework based on the requirements and needs of the project; especially when choosing lightweight front-end kits for small projects, given the bloat and bulk associated with massive frameworks.

网格的概念

A grid system allows you to structure and stack content horizontally and vertically in an easy manner. It is easily adaptable for any web site or web application and has a lot of advantages. It is usually responsive, meaning it adjusts itself based on the browser or device width. So, it displays the content appropriately in a mobile device, a laptop, a tablet, or a desktop depending on the size of the device. Plus, you have media queries, which help you define the grid layout based on the device width. Grids are usually 12-column containers in many frameworks but can be customized using methods specific to the framework. You can have flexible layouts wherein you can divide the page into several regions and place content using the markup. Another concept catching on in CSS designs is the FlexBox . The difference between a grid and FlexBox layout is that grid layouts are two-dimensional, while a FlexBox is usually one-dimensional wherein you can lay out content in a row or a column. The choice of using a grid layout or a FlexBox depends on how you want to structure your content. With a FlexBox you space out the content and build a structure using that content. Suppose you have certain items; it is up to you to decide how much space each item should take. Grid layouts, on the other hand, are content-agnostic. In grid layouts, you create a layout and place the content into rows and columns. In most modern frameworks, both the grid and the FlexBox are supported. While the usability of the grid layout is awesome, a FlexBox can help you place things more aesthetically. For a detailed explanation of the grid concept , you can refer the Mozilla developer network web site, specifically the following web page, for in-depth information: developer.mozilla.org/en-US/docs/Web/CSS/CSS_Grid_Layout .

摘要

In this chapter, we gave you an overview of some popular CSS frameworks. We also covered the benefits of using a CSS framework. CSS frameworks are comprised of components, modules, libraries, navigational elements, typography, media queries, tailor-made widgets, and grid layouts that make web design a breeze. We also gave you an overview of grid and FlexBox layouts. We will now dedicate a chapter for each of the frameworks mentioned in the introduction of the chapter, starting with Skeleton. With each chapter, we use a progressive approach, meaning the next framework is more extensive and a framework’s resourcefulness increases as you move through the book.

二、使用框架构建登录页面

安装骨架

To get started, go to the Skeleton web site at getskeleton.com/ . You will see the Download button, which is highlighted in a red box in Figure 2-1.A450102_1_En_2_Fig1_HTML.jpg Figure 2-1Skeleton download page Click Download to download the Skeleton .zip file. After unzipping the file, you will see the file structure shown in Figure 2-2.A450102_1_En_2_Fig2_HTML.jpg Figure 2-2 Content of the Skeleton framework The css folder is where you save your CSS files . By default, the css folder contains the Normalize and Skeleton style sheets. Normalize.css is a small CSS file that provides better cross-browser consistency in the default styling of HTML elements. It makes browsers render all elements more consistently and in line with modern standards. It precisely targets only the styles that need normalizing. You can find more information about Normalize on the official web site at necolas.github.io/normalize.css/ . You can also see the images folder where you can store your images. By default, the images folder contains the favicon image for Skeleton. The index.html file is your default web page. When you edit the page in Notepad++ or any editor, you will see the code displayed in Listing 2-1.         Your page title here </p> <strong>标签:</strong><a href="/tags/%E6%8C%87%E5%8D%97/0.html" target="_blank">指南</a>,<a href="/tags/code/0.html" target="_blank">code</a>,<a href="/tags/mdl/0.html" target="_blank">mdl</a>,<a href="/tags/Figure/0.html" target="_blank">Figure</a>,<a href="/tags/Listing/0.html" target="_blank">Listing</a>,<a href="/tags/%E6%9B%BF%E4%BB%A3/0.html" target="_blank">替代</a>,<a href="/tags/class/0.html" target="_blank">class</a>,<a href="/tags/CSS/0.html" target="_blank">CSS</a>,<a href="/tags/define/0.html" target="_blank">define</a> </br> From: https://www.cnblogs.com/apachecn/p/18356801 </div> <div class="details-con-other border-top"> <!-- java44_b --> <ins class="adsbygoogle" style="display:block" data-ad-client="ca-pub-6297881353008806" data-ad-slot="5891351586" data-ad-format="auto" data-full-width-responsive="true"></ins> <script> (adsbygoogle = window.adsbygoogle || []).push({}); </script> </div> <div class="tuijian"> <h3 class="show-list-title">相关文章</h3> <div class="news_list clearfix"> <ul class="clearfix"> <li><a href="/show/4/744943.html" title="CSS笔记总结(Xmind格式):第二天">CSS笔记总结(Xmind格式):第二天</a><div class="memo">Xmind鸟瞰图:简单文字总结:css知识总结:复合选择器:  1.交集选择器:在一个选择器的基础上,再增加一个选择器来增加条件(中间不能有任何符号包括空格)  2.并集选择器:多个选择器之间用逗号隔开,表示同时选择多个标签使用样式  3.后代选择器:使用空格分隔  4.子元......</div> </li><li><a href="/show/4/744934.html" title="电脑提示缺失highgui100.dll怎么办?dll的修复指南">电脑提示缺失highgui100.dll怎么办?dll的修复指南</a><div class="memo">在使用某些应用程序或游戏时,您可能会遇到系统提示“找不到highgui100.dll”或“highgui100.dll缺失”的错误信息。这个错误通常意味着您的系统中缺少了一个重要的动态链接库(DLL)文件,而这个文件对于程序的正常运行是必要的。以下是几个简单步骤来帮助您解决这个问题:1.确认文件......</div> </li><li><a href="/show/4/744822.html" title="大语言模型从零开始训练全面指南:预训练、Tokenizer训练、指令微调、奖励模型、强化学">大语言模型从零开始训练全面指南:预训练、Tokenizer训练、指令微调、奖励模型、强化学</a><div class="memo">在这篇文章中,我们将尽可能详细地梳理一个完整的LLM训练流程。包括模型预训练(Pretrain)、Tokenizer训练、指令微调(InstructionTuning)、奖励模型(RewardModel)和强化学习(RLHF)等环节。1.预训练阶段(PretrainingStage)工欲善其事,必先利其器。当前,不少工作选择在一个较......</div> </li><li><a href="/show/4/744740.html" title="提升效率的印象笔记(Evernote)使用指南">提升效率的印象笔记(Evernote)使用指南</a><div class="memo">印象笔记(Evernote)是一个功能强大、跨平台的笔记管理工具,它不仅能帮助你记录日常笔记,还可以用于整理工作计划、管理项目、存储灵感和信息等。为了最大化地提高你的生产力,以下将介绍一些高效使用印象笔记的技巧,帮助你充分发挥其潜力。一、入门基础:理解印象笔记的基本概念1.1笔......</div> </li><li><a href="/show/4/744559.html" title="CSS的重绘和重排是什么?">CSS的重绘和重排是什么?</a><div class="memo">你好同学,我是沐爸,欢迎点赞、收藏和关注。个人知乎在CSS中,元素的某些属性的变化会触发浏览器的重绘(Repaint)或重排(Reflow,也称为重渲染或回流)。了解这些差异可以帮助开发同学优化页面性能,避免不必要的性能开销。一、重排(Reflow)重排,简单理解就是重新排列。重排是浏览器中最......</div> </li><li><a href="/show/4/744440.html" title="矿泉水在线批发商城系统解决方案毕设毕业设计.web期末作业设计网页.css网页成品参考">矿泉水在线批发商城系统解决方案毕设毕业设计.web期末作业设计网页.css网页成品参考</a><div class="memo"> 博主介绍:黄菊华老师《Vue.js入门与商城开发实战》《微信小程序商城开发》图书作者,CSDN博客专家,在线教育专家,CSDN钻石讲师;专注大学生毕业设计教育和辅导。所有项目都配有从入门到精通的基础知识视频课程,学习后应对毕业设计答辩。项目配有对应开发文档、开题报告、任务书、P......</div> </li><li><a href="/show/3/744363.html" title="Ubuntu基础入门指南">Ubuntu基础入门指南</a><div class="memo">简介        Ubuntu是一个基于Debian的Linux发行版,以其易用性和强大的社区支持而闻名。无论你是初学者还是有经验的用户,Ubuntu都能提供丰富的功能和友好的用户体验。本博客将带你了解Ubuntu的基础知识,帮助你快速入门。安装Ubuntu        安装Ubuntu相对简......</div> </li><li><a href="/show/4/744362.html" title="二维前缀和学习指南">二维前缀和学习指南</a><div class="memo">为什么我为OI泪目,因为我菜得离谱......二维前缀和引子二维前缀和,仅仅是由一维前缀和进阶了一维而已。为了方便后面的学习,我先给出二维前缀和重点代码。处理二维前缀和for(inti=1;i<=n;i++) for(intj=1;j<=m;j++) sum[i][j]=sum[i-1][j]+sum[i][j-1]-sum[i-1][j-1]+a[......</div> </li><li><a href="/show/4/744247.html" title="解锁《终结者:幸存者》新玩法:Steam家庭共享机制详解与实战指南">解锁《终结者:幸存者》新玩法:Steam家庭共享机制详解与实战指南</a><div class="memo">在Steam平台上,玩家可以通过家庭共享功能,与亲朋好友共享自己购买的游戏库,包括《终结者:幸存者》这款游戏。以下是对Steam家庭共享机制的详细解析与实战指南:一、Steam家庭共享基本概念Steam家庭共享功能允许一个Steam账号在其许可的范围内,最多与其他5个Steam账号共享游戏库。这......</div> </li><li><a href="/show/4/744241.html" title="AWS Lambda 十年回顾:功能总览、更新记录与入门指南">AWS Lambda 十年回顾:功能总览、更新记录与入门指南</a><div class="memo">这次,我为2014年11月发布的AWSLambda创建了一个历史时间表。AWSLambda是一项无服务器、全托管的代码执行服务,今年2024年11月将迎来其宣布发布的十周年纪念。虽然提前了一些,但为了提前庆祝这一重要时刻,我写了这篇文章。文章中,我从AWSLambda的诞生到功能的增加和更新进行了追......</div> </li> </ul> </div> </div> </div> <div class="right"> <h3 class="show-list-title">赞助商</h3> <div> <!-- 右上 --> <ins class="adsbygoogle" style="display:block" data-ad-client="ca-pub-6297881353008806" data-ad-slot="2675262000" data-ad-format="auto" data-full-width-responsive="true"></ins> <script> (adsbygoogle = window.adsbygoogle || []).push({}); </script> </div> <h3 class="show-list-title">阅读排行</h3> <div class="news_list clearfix"> <ul class="clearfix"> <li class="row"><a href="/show/1/328888.html" title="Python3网络爬虫浓缩系列">Python3网络爬虫浓缩系列</a></li> <li class="row"><a href="/show/4/14059.html" title="visual studio 2022离线安装包制作教程">visual studio 2022离线安装包制作教程</a></li> <li class="row"><a href="/show/4/73988.html" title="#yyds干货盘点# 前端歌谣的刷题之路-第一百三十七题-可伸缩属性">#yyds干货盘点# 前端歌谣的刷题之路-第一百三十七题-可伸缩属性</a></li> <li class="row"><a href="/show/4/520.html" title="Codeforces">Codeforces</a></li> <li class="row"><a href="/show/4/468113.html" title="使用U盘制作启动盘并重装系统">使用U盘制作启动盘并重装系统</a></li> <li class="row"><a href="/show/1/272788.html" title="编写HelloWorld程序">编写HelloWorld程序</a></li> <li class="row"><a href="/show/4/105709.html" title="departments/components/add.vue">departments/components/add.vue</a></li> <li class="row"><a href="/show/4/143745.html" title="1081. 度的数量">1081. 度的数量</a></li> <li class="row"><a href="/show/4/136280.html" title="js- day03- 将数据变成柱形图">js- day03- 将数据变成柱形图</a></li> <li class="row"><a href="/show/3/42792.html" title="nginx使用">nginx使用</a></li> <li class="row"><a href="/show/4/460598.html" title="leetcode 22 括号生成">leetcode 22 括号生成</a></li> <li class="row"><a href="/show/4/5184.html" title="webrtc-streamer实现简单rtsp视频监控">webrtc-streamer实现简单rtsp视频监控</a></li> <li class="row"><a href="/show/4/159314.html" title="wordpress外贸独立站商城 如此简单">wordpress外贸独立站商城 如此简单</a></li> <li class="row"><a href="/show/4/471893.html" title="函数练习错题">函数练习错题</a></li> <li class="row"><a href="/show/2/31729.html" title="利用TableAdapter更新数据库">利用TableAdapter更新数据库</a></li> </ul> </div> </div> </div> </div> <div class="footer"> <div class="box"> <p><a href="/">网站主页</a><a href="/">关于我们</a><a href="/">联系我们</a><a href="/sitemap.xml">网站地图</a> </p> <p>本网站内容转载自其他媒体,侵权联系[admin##ips99.com]。 </p> <p>Copyright © 2020-2023 IPS99 版权所有 <a href=http://www.ips99.com/ target='_blank'>IPS99</a></p> </div> </div> <script> var _hmt = _hmt || []; (function() { var hm = document.createElement("script"); hm.src = "https://hm.baidu.com/hm.js?4c2aee340566629a4d3054a737c25421"; var s = document.getElementsByTagName("script")[0]; s.parentNode.insertBefore(hm, s); })(); </script> </body> </html>