Home Web Front-end HTML Tutorial Static Web Development CSS_html/css_WEB-ITnose

Static Web Development CSS_html/css_WEB-ITnose

Jun 24, 2016 am 11:39 AM

 

二章 CSS


1节
CSS介绍

CSS(Cascading Style Sheets) //cascade级联,串联
CSS由两个部分组成:选择器,以及一条或多条声明
selector{declaration1;declaration2;...}


一级标签

 

2节
CSS定义三种样式

1 内联式

一级标题


2 嵌入式 //一节中的样式
3 外联式
//新建一个css @charset "UTF-8"; h1{font-size:36px;color:pink;}
//指定关联文件的类型,指定关联文件与当前文件的关系,引用关联文件
//如果通过嵌入式和外部引入同时对一个 选择器进行了修饰,以最下面的一个样式为准 (最后执行的样式会覆盖前面的样式)
//外联式又有两种:
1
属于XHTML
当页面被加载时,link引入的会同时被加载
所有浏览器都支持
支持通过dom进行操作
2 @import url("*.css");
属于CSS特有的,必须嵌套到


7 sections
CSS text

text-indent:2em indent
text-align text alignment
word-spacing word spacing
letter-spacing letter spacing
text-transform character conversion
text-decoration text decoration none underline overline linethrough blink
white-space processing whitespace normal


Text

8 sections
CSS font

font-family font format
font-style font style normal italic italic oblique oblique
font-variant Set small caps
font-weight normal bold 100-900
font-size


This is also italic, the same as italic< /i>

Section 9
CSS link

//Hyperlinks are underlined by default and underlined when suspended
a{text-decoration :none;}
a:hover{text-decoration:underline;}

10 sections
CSS list

ul{list-style:none ;} //No style
ul{list-style-position:center,center;}
ul{list-style-type:square;}
ul li{list-style-image:url( ...);}

Section 11
CSS table

border-collapse Set whether to merge the table borders into a single border (collapse)
border-spacing sets the distance between divided cells
vertical-align vertically aligns top bottom middle
caption-side sets the position of the table title
empty-cells sets whether to display empty cells in the table
table -layout sets the algorithm (layout) for displaying units, rows, and columns

12 sections
CSS Box Model

border margin
padding inner margin
margin outer margin

The box model specifies how the element box handles element content and inner margins , border and margin mode
tr{border:1px solid #333;} //No order dashed dashed line
div{width:200;height:100;border:2px dashed #333;padding:5px; margin=10px;}
//Firefox---Layout---

Section 13
CSS outline (outline)

//Outline is A line drawn around the element, located outside the edge of the border, can play a role in highlighting the element
//outline attribute specifies the style color width of the element

outline-color outlie-style outline-width
div{width:200px;height:100px;border:solid #CCC 5px;outline:solid #F00 2px;}
input{outline:none;}
input:focus{border:green 1px solid; } //Style when the input tag gets focus

Section 14
margin&padding

padding padding (length value, percentage, negative values ​​cannot be used, default Set the top, bottom, left and right values)
padding-top //Specify a certain direction to set a specific size
paddng-left
padding-right
padding-bottom


# div1{width:200px;height:100px;border:red dashed 2px;padding:5px 10px 20px 30px;margin:10px;}
#div2{width:200px;height:100px;border:red dashed 2px;margin- top:-10px;margin-left:10%;}
#div3{width:50;height:50px;background:gray;margin-top:20%;}
#div4{width:960x;height :40px;background:#333;margin-left:10px;margin:0 auto;}

margin //Can display negative values

< ;/div>



//Positioning---???---

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

Hot AI Tools

Undresser.AI Undress

Undresser.AI Undress

AI-powered app for creating realistic nude photos

AI Clothes Remover

AI Clothes Remover

Online AI tool for removing clothes from photos.

Undress AI Tool

Undress AI Tool

Undress images for free

Clothoff.io

Clothoff.io

AI clothes remover

Video Face Swap

Video Face Swap

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

Hot Tools

Notepad++7.3.1

Notepad++7.3.1

Easy-to-use and free code editor

SublimeText3 Chinese version

SublimeText3 Chinese version

Chinese version, very easy to use

Zend Studio 13.0.1

Zend Studio 13.0.1

Powerful PHP integrated development environment

Dreamweaver CS6

Dreamweaver CS6

Visual web development tools

SublimeText3 Mac version

SublimeText3 Mac version

God-level code editing software (SublimeText3)

Is HTML easy to learn for beginners? Is HTML easy to learn for beginners? Apr 07, 2025 am 12:11 AM

HTML is suitable for beginners because it is simple and easy to learn and can quickly see results. 1) The learning curve of HTML is smooth and easy to get started. 2) Just master the basic tags to start creating web pages. 3) High flexibility and can be used in combination with CSS and JavaScript. 4) Rich learning resources and modern tools support the learning process.

The Roles of HTML, CSS, and JavaScript: Core Responsibilities The Roles of HTML, CSS, and JavaScript: Core Responsibilities Apr 08, 2025 pm 07:05 PM

HTML defines the web structure, CSS is responsible for style and layout, and JavaScript gives dynamic interaction. The three perform their duties in web development and jointly build a colorful website.

Understanding HTML, CSS, and JavaScript: A Beginner's Guide Understanding HTML, CSS, and JavaScript: A Beginner's Guide Apr 12, 2025 am 12:02 AM

WebdevelopmentreliesonHTML,CSS,andJavaScript:1)HTMLstructurescontent,2)CSSstylesit,and3)JavaScriptaddsinteractivity,formingthebasisofmodernwebexperiences.

Gitee Pages static website deployment failed: How to troubleshoot and resolve single file 404 errors? Gitee Pages static website deployment failed: How to troubleshoot and resolve single file 404 errors? Apr 04, 2025 pm 11:54 PM

GiteePages static website deployment failed: 404 error troubleshooting and resolution when using Gitee...

What is an example of a starting tag in HTML? What is an example of a starting tag in HTML? Apr 06, 2025 am 12:04 AM

AnexampleofastartingtaginHTMLis,whichbeginsaparagraph.StartingtagsareessentialinHTMLastheyinitiateelements,definetheirtypes,andarecrucialforstructuringwebpagesandconstructingtheDOM.

How to use CSS3 and JavaScript to achieve the effect of scattering and enlarging the surrounding pictures after clicking? How to use CSS3 and JavaScript to achieve the effect of scattering and enlarging the surrounding pictures after clicking? Apr 05, 2025 am 06:15 AM

To achieve the effect of scattering and enlarging the surrounding images after clicking on the image, many web designs need to achieve an interactive effect: click on a certain image to make the surrounding...

How to implement adaptive layout of Y-axis position in web annotation? How to implement adaptive layout of Y-axis position in web annotation? Apr 04, 2025 pm 11:30 PM

The Y-axis position adaptive algorithm for web annotation function This article will explore how to implement annotation functions similar to Word documents, especially how to deal with the interval between annotations...

HTML, CSS, and JavaScript: Essential Tools for Web Developers HTML, CSS, and JavaScript: Essential Tools for Web Developers Apr 09, 2025 am 12:12 AM

HTML, CSS and JavaScript are the three pillars of web development. 1. HTML defines the web page structure and uses tags such as, etc. 2. CSS controls the web page style, using selectors and attributes such as color, font-size, etc. 3. JavaScript realizes dynamic effects and interaction, through event monitoring and DOM operations.

See all articles