목차
第三章 无需计算玩转CSS网格布局
3.1 网格布局介绍
3.2 使用网格布局
3.2.1 术语
3.2.3 固定的网格布局还是流动的网格布局
3.3 使用Blueprint
3.3.2 使用Compass应用Blueprint
3.3.3 使用Compass应用无需类名的Blueprint
3.4 使用960网格布局系统
3.5 通过Compass处理垂直韵律
3.5.2 前置和后置
5.4 小结
第四章 有Compass不再枯燥
4.1.1 全局样式重置--global-reset
4.1.2 通过有针对性的样式重置进行更多控制
4.2 更快更直观的排版辅助工具
4.2.1 链接辅助工具
4.2.2 列表辅助工具--创建各种各样的列表
4.2.3 文本辅助工具--用辅助工具征服文字
4.3 布局辅助工具
4.3.1 粘滞的页脚
4.3.2 可伸展元素
第五章 通过Compass使用CSS3
5.1 新属性:浏览器前缀
5.2 通过Compass使用CSS3
5.2.1 圆角
5.2.2 CSS3阴影--text-shadow和box-shadow
5.2.3 颜色渐变
5.2.4 用@font-face嵌入字体
웹 프론트엔드 HTML 튜토리얼 (二)在实战中使用Sass和Compass_html/css_WEB-ITnose

(二)在实战中使用Sass和Compass_html/css_WEB-ITnose

Jun 24, 2016 am 11:44 AM

第三章 无需计算玩转CSS网格布局

3.1 网格布局介绍

3.2 使用网格布局

3.2.1 术语

1 术语名             定义                      是否涉及HTML标签2 列           内容度量的垂直单位                    否3 容器         构成一个网格布局的HTML元素             是4 槽           网格布局中列与列之间的统一留白          否
로그인 후 복사

3.2.3 固定的网格布局还是流动的网格布局

1 // 由于网络用户的屏幕尺寸不一,设计人员有两种选择:2 // 1.要么选择一种对于大多数用户合理的固定布局大小(并且限制这种布局内的内容不溢出);3 // 2.要么实现一种灵活的<strong>流动布局</strong>,让内容自适应用户的屏幕,甚至当浏览器窗口大小改变时也会自适应;
로그인 후 복사

3.3 使用Blueprint

1 // Blueprint把一些通用的对网格布局/段落和表格进行样式修饰的CSS技术打包到一个<strong>框架</strong>中,然后可以在各个项目中通用这个框架;2 // 安装Blueprint3 C:\Users\DELL><strong>gem install compass-blueprint</strong>
로그인 후 복사

3.3.2 使用Compass应用Blueprint

 1 // 创建一个基本的Blueprint项目 2 C:\Users\DELL><strong>compass create simple --using blueprint/basic</strong> 3 directory simple/ 4 directory simple/images/ 5 directory simple/sass/ 6 directory simple/sass/partials/ 7 directory simple/stylesheets/ 8    create simple/config.rb 9    create simple/sass/screen.scss10    create simple/sass/partials/_base.scss11    create simple/sass/print.scss12    create simple/sass/ie.scss13    create simple/images/grid.png14     write simple/stylesheets/ie.css15     write simple/stylesheets/print.css16     write simple/stylesheets/screen.css17 18 // 在screen.scss文件生成↓↓↓↓↓↓↓↓↓↓:19     // This import applies a global reset to any page that imports this stylesheet.20     @import "blueprint/reset";              // 默认的Blueprint重置模块;21 22     // To configure blueprint, edit the partials/_base.sass file.23     @import "partials/base";                //<strong> 网格布局设置</strong>;24 25     // Import all the default blueprint modules so that we can access their mixins.26     @import "blueprint";                    // 让Blueprint的模块可用;27 28     // Import the non-default scaffolding module.29     @import "blueprint/scaffolding";        //<strong> 引入脚手架</strong>;30 31     // Generate the blueprint framework according to your configuration:32     @include blueprint;                     //<strong> 生成网格布局</strong>;33 34     @include blueprint-scaffolding;         //<strong> 表单和其他Blueprint元件;</strong>
로그인 후 복사

3.3.3 使用Compass应用无需类名的Blueprint

 1 C:\Users\DELL>compass create simple --using blueprint/semantic 2  3 Sass: 4     #container { 5 <strong> @include container; </strong> 6     } 7 CSS: 8     #container { 9 <strong> width: 950px; 10       margin: 0 auto; 11  overflow: hidden; 12       *zoom: 1; </strong>13     }
로그인 후 복사

3.4 使用960网格布局系统

 1 // 安装960系统; 2 C:\Users\DELL><strong>gem install compass-960-plugin </strong> 3  4 // 创建一个960网格系统的Compass项目 5 C:\Users\DELL><strong>compass create -r ninesixty twelve_col --using 960</strong> 6 directory twelve_col/ 7 directory twelve_col/sass/ 8 directory twelve_col/stylesheets/ 9    create twelve_col/config.rb10    create twelve_col/sass/grid.scss11    create twelve_col/sass/text.scss12     write twelve_col/stylesheets/grid.css13     write twelve_col/stylesheets/text.css
로그인 후 복사

3.5 通过Compass处理垂直韵律

1 @import "compass/typography";       //<strong> 引入段落模块</strong>;2 $base-font-size:16px;               // 声明字体大小;3 $base-line-height:24px;4 <strong>@include establish-baseline; </strong>5 h1 { @include adjust-font-size-to(48px); }
로그인 후 복사

3.5.2 前置和后置

 1 //<strong> leader混合器在元素前加一个基线单位的外间距</strong>; 2 //<strong> trailer混合器在元素的后边加了一个基线单位的外间距;</strong> 3 p { @include leader; @include trailer; } 4 Sass: 5     p {  6       @include leader; 7       @include trailer; 8     } 9 CSS:10     p {11       margin-top: 1.5em;12       margin-bottom: 1.5em;13     }
로그인 후 복사

3.6 小结

1 // 流行的CSS网格框架如何简化维护留白和快速构建原型设计;2 // 通过添加一些CSS类,就可以创建彼此之间有统一间距的竖列内容;
로그인 후 복사

第四章 有Compass不再枯燥

// 使用Compass重置浏览器默认样式;

// 改进样式表排版的Compass辅助器;

// 使用Compass创建粘滞的页脚/多样化的表格以及浮动;

4.1.1 全局样式重置--global-reset

4.1.2 通过有针对性的样式重置进行更多控制

1 @import "compass/reset/utilities";2 >1.<strong>HTML5样式重置--@include reset-html5 </strong>3 >2.Compass文档中更多的样式重置4     >>1.<strong>reset-box-</strong><strong>model:移除元素的内边距和边框</strong>;5     >>2.<strong>reset-</strong><strong>font:重置文字的字号和基线</strong>;6     >>3.<strong>reset-</strong><strong>focus:移除浏览器提供的轮廓线</strong>;7     >>4.<strong>reset-table和reset-table-</strong><strong>cell:重置表格的边框和对齐方式</strong>;8     >>5.<strong>reset-quotation:为<blockquotes>添加仅存在于样式表中的双引号</strong>;
로그인 후 복사

4.2 更快更直观的排版辅助工具

4.2.1 链接辅助工具

1 >1.<strong>为链接配色</strong>;2     a { @include <strong>link-colors</strong>(#333,#00f,#f00,#555,#f00); }3 >2.<strong>通过hover-link设置悬停样式(设置下划线); </strong>4     a { @include <strong>hover-</strong><strong>link</strong> }5 >3.<strong>通过unstyled-link设置隐性的链接(去掉颜色/光标样式/下划线); </strong>6     p.secret a { @include unstyled-link }
로그인 후 복사

4.2.2 列表辅助工具--创建各种各样的列表

 1 >1.<strong>用pretty-</strong><strong>bullets装点列表</strong>(利用背景图片显示列表的项目符号) 2     ul.features { 3         @include <strong>pretty-bullets('pretty-bullet.png'); </strong> 4     } 5 >2.通过no-bullet和no-bullets去掉项目符号 6     li.no-bullet { <strong>@include no-bullet</strong> }             //<strong> 去掉li类no-bullet的符号;</strong> 7     ul.no-bullet { <strong>@include no-bullets</strong> }            //<strong> 去掉整个列表的项目符号;</strong> 8 >3.轻松横向排布 9     // horizontal-list混合器有两个参数:$padding(内边距)和$direction(浮动方向);10     ul.nav { @include <strong>horizontal-</strong><strong>list</strong> }      11     ul.nav { @include <strong>horizontal-</strong><strong>list(7px,right)</strong> } // 列表水平排列;12 >4.用inline-list处理内联列表13     ul.words { @include <strong>delimited-list</strong> }            //<strong> 将列表设置成内联的样式;</strong>14     ul.words { @include <strong>delimited-list("!")</strong> }       //<strong> 自定义分隔符</strong>;
로그인 후 복사

4.2.3 文本辅助工具--用辅助工具征服文字

1 ><strong>1.用省略号代表截断内容</strong>(text-overflow:ellipsis);2     td.dot { <strong>@include ellipsis;</strong> }3 ><strong>2.用nowrap防止文本折行 </strong>4     td { <strong>@include nowrap</strong> }5 >3<strong>.用replace-text将文字替换图片 </strong>6     h1.coffee { <strong>@include replace-text("coffee-header.png")</strong> }
로그인 후 복사

4.3 布局辅助工具

4.3.1 粘滞的页脚

// 生成一个高40px的页脚,并且始终在最下面;

1 @include sticky-footer { 40px, "#content", "#footer", "#sticky-footer"};
로그인 후 복사

4.3.2 可伸展元素

// 元素绝对定位,距离边界5px;

1 // stretch混合器有4个参数:$offset-top/$offset-right/$offset-bottom/$offset-left;2 a.logo { @include stretch(5px,5px,5px,5px) }
로그인 후 복사

4.4 小结

// 本章,我们了解了Compass省时省力的工具;

// 包括:链接/列表/文本/布局;

第五章 通过Compass使用CSS3

// 用Compass的CSS3模块创建跨浏览器的CSS3样式表

// 在低版本IE中支持一些CSS3的特性

// Compass里的CSS3高阶技能

5.1 新属性:浏览器前缀

 1 // 引入CSS3模块 2 <strong>@import "compass/css3"; </strong> 3 Sass: 4     .notice { 5         @include border-radius(5px); 6     } 7 CSS: 8     .notice { 9         -moz-border-radius: 5px;10         -webkit-border-radius: 5px;11         border-radius: 5px;12     }
로그인 후 복사

5.2 通过Compass使用CSS3

5.2.1 圆角

1 button.rounded {2     <strong>@include border-radius (5px); </strong>3 }
로그인 후 복사

5.2.2 CSS3阴影--text-shadow和box-shadow

 1 Sass: 2     $shadow-1:rgba(#000,.5) -200px 0 0; 3     $shadow-2:rgba(#000,.3) -400px 0 0; 4     h2 { 5         <strong>@include box-shadow($shadow-1); </strong> 6         <strong>@include text-shadow($shadow-1,$shadow-2); </strong> 7     } 8 CSS: 9     h2 {10       -moz-box-shadow: rgba(0, 0, 0, 0.5) -200px 0 0;11       -webkit-box-shadow: rgba(0, 0, 0, 0.5) -200px 0 0;12       box-shadow: rgba(0, 0, 0, 0.5) -200px 0 0;13       text-shadow: rgba(0, 0, 0, 0.5) -200px 0 0, rgba(0, 0, 0, 0.3) -400px 0 0;14     }
로그인 후 복사

5.2.3 颜色渐变

 1 #pattern { 2 <strong> @include background(  3         linear-</strong><strong>gradient</strong>( 4             360deg, 5             #bfbfbf 0%, 6             #bfbfbf 12.5% 7             #bfbf00 12.5%, 8             #bfbf00 25%, 9             ...10         )11     );12     width:400px;13     height:300px;14 }
로그인 후 복사

5.2.4 用@font-face嵌入字体

1 <strong>@include font-face</strong> ("ChunkFiveRegular",2     font-files("ChunkFiveRegular-webfont.woff",woff,3                "ChunkFiveRegular-webfont.woff",ttf, 4                "ChunkFiveRegular-webfont.woff",svg,5                "ChunkFiveRegular-webfont.woff",normal,normal));
로그인 후 복사

5.4 小结

// 使用CSS3混合器实现:圆角/阴影/渐变以及文字引入;

 

본 웹사이트의 성명
본 글의 내용은 네티즌들의 자발적인 기여로 작성되었으며, 저작권은 원저작자에게 있습니다. 본 사이트는 이에 상응하는 법적 책임을 지지 않습니다. 표절이나 침해가 의심되는 콘텐츠를 발견한 경우 admin@php.cn으로 문의하세요.

핫 AI 도구

Undresser.AI Undress

Undresser.AI Undress

사실적인 누드 사진을 만들기 위한 AI 기반 앱

AI Clothes Remover

AI Clothes Remover

사진에서 옷을 제거하는 온라인 AI 도구입니다.

Undress AI Tool

Undress AI Tool

무료로 이미지를 벗다

Clothoff.io

Clothoff.io

AI 옷 제거제

Video Face Swap

Video Face Swap

완전히 무료인 AI 얼굴 교환 도구를 사용하여 모든 비디오의 얼굴을 쉽게 바꾸세요!

뜨거운 도구

메모장++7.3.1

메모장++7.3.1

사용하기 쉬운 무료 코드 편집기

SublimeText3 중국어 버전

SublimeText3 중국어 버전

중국어 버전, 사용하기 매우 쉽습니다.

스튜디오 13.0.1 보내기

스튜디오 13.0.1 보내기

강력한 PHP 통합 개발 환경

드림위버 CS6

드림위버 CS6

시각적 웹 개발 도구

SublimeText3 Mac 버전

SublimeText3 Mac 버전

신 수준의 코드 편집 소프트웨어(SublimeText3)

HTML은 초보자를 위해 쉽게 배우나요? HTML은 초보자를 위해 쉽게 배우나요? Apr 07, 2025 am 12:11 AM

HTML은 간단하고 배우기 쉽고 결과를 빠르게 볼 수 있기 때문에 초보자에게 적합합니다. 1) HTML의 학습 곡선은 매끄럽고 시작하기 쉽습니다. 2) 기본 태그를 마스터하여 웹 페이지를 만들기 시작하십시오. 3) 유연성이 높고 CSS 및 JavaScript와 함께 사용할 수 있습니다. 4) 풍부한 학습 리소스와 현대 도구는 학습 과정을 지원합니다.

HTML, CSS 및 JavaScript의 역할 : 핵심 책임 HTML, CSS 및 JavaScript의 역할 : 핵심 책임 Apr 08, 2025 pm 07:05 PM

HTML은 웹 구조를 정의하고 CSS는 스타일과 레이아웃을 담당하며 JavaScript는 동적 상호 작용을 제공합니다. 세 사람은 웹 개발에서 의무를 수행하고 화려한 웹 사이트를 공동으로 구축합니다.

HTML의 시작 태그의 예는 무엇입니까? HTML의 시작 태그의 예는 무엇입니까? Apr 06, 2025 am 12:04 AM

anexampleStartingtaginhtmlis, whithbeginsaparagraph.startingtagsareessentialinhtmlastheyinitiate rements, definetheirtypes, andarecrucialforstructurituringwebpages 및 smanstlingthedom.

HTML, CSS 및 JavaScript 이해 : 초보자 안내서 HTML, CSS 및 JavaScript 이해 : 초보자 안내서 Apr 12, 2025 am 12:02 AM

WebDevelopmentReliesonHtml, CSS 및 JavaScript : 1) HtmlStructuresContent, 2) CSSSTYLESIT, 및 3) JAVASCRIPTADDSINGINTERACTIVITY, BASISOFMODERNWEBEXPERIENCES를 형성합니다.

Gitee Pages 정적 웹 사이트 배포 실패 : 단일 파일 문제를 해결하고 해결하는 방법 404 오류? Gitee Pages 정적 웹 사이트 배포 실패 : 단일 파일 문제를 해결하고 해결하는 방법 404 오류? Apr 04, 2025 pm 11:54 PM

GiteEpages 정적 웹 사이트 배포 실패 : 404 오류 문제 해결 및 해결시 Gitee ...

웹 주석에서 y 축 위치의 적응 형 레이아웃을 구현하는 방법은 무엇입니까? 웹 주석에서 y 축 위치의 적응 형 레이아웃을 구현하는 방법은 무엇입니까? Apr 04, 2025 pm 11:30 PM

웹 주석 기능에 대한 Y 축 위치 적응 알고리즘이 기사는 Word 문서와 유사한 주석 기능을 구현하는 방법, 특히 주석 간격을 다루는 방법을 모색합니다 ...

CSS3 및 JavaScript를 사용하여 클릭 후 주변 사진을 흩어지고 확대하는 효과를 얻는 방법은 무엇입니까? CSS3 및 JavaScript를 사용하여 클릭 후 주변 사진을 흩어지고 확대하는 효과를 얻는 방법은 무엇입니까? Apr 05, 2025 am 06:15 AM

이미지를 클릭 한 후 주변 이미지를 산란 및 확대하는 효과를 얻으려면 많은 웹 디자인이 대화식 효과를 달성해야합니다. 특정 이미지를 클릭하여 주변을 만들 수 있습니다 ...

HTML, CSS 및 JavaScript : 웹 개발자를위한 필수 도구 HTML, CSS 및 JavaScript : 웹 개발자를위한 필수 도구 Apr 09, 2025 am 12:12 AM

HTML, CSS 및 JavaScript는 웹 개발의 세 가지 기둥입니다. 1. HTML은 웹 페이지 구조를 정의하고 등과 같은 태그를 사용합니다. 2. CSS는 색상, 글꼴 크기 등과 같은 선택기 및 속성을 사용하여 웹 페이지 스타일을 제어합니다.

See all articles