Home Web Front-end HTML Tutorial css 笔记_html/css_WEB-ITnose

css 笔记_html/css_WEB-ITnose

Jun 24, 2016 am 11:28 AM

css 笔记

第一种:常用的全局CSS属性设置    //参考大型网站,如凤凰网(1)清除所有的标记的内外边距body,div,dl,dt,dd,ul,ol,li,h1,h2,h3,h4,h5,h6,pre,form,fieldset,input,p,blockquote,th,td{margin:0;padding:0}(2)项目符号ul,ol,li{list-style:none;}(3)全局字体颜色设置body{font-size:12px;color:#444;}(4)常用标题的设置h1,h2,h3,h4,h5,h6{font-size:100%}h1{padding:11px 0 0; margin-bottom:4px;font:normal 20px/30px 黑体;text-align:center;}h2 { padding:6px 0 0; margin-bottom:4px; font:normal 20px/30px 黑体; text-align:center; }h3{font-size:12px}h4{font-size:12px;font-weight:normal}(5)全局链接a{text-decoration:none;cursor:pointer}a:link, a:visited {color:#004276}a:hover{text-decoration:underline;color:#ba2636}(6)图片img{border:none;}     ie6 图片有边框,兼容性问题,要去边框(7)浮动和清除.float1{float:left;}.float2{float:right}.clear{clear:both;}.blank10{height:10px;clear:both;}   添加空白div  解决 div margin 上下边距会合并,兼容性问题(8)颜色.red{color:#FF0000;}.blue{color:#0000FF;}.green{color:#00ff00;}安装IETEST 测试 ie 6 (1)ie5网页居中     IE5下的居中,应该是:body{text-align:center} 加上这个,再在最大的div加{text-align:left;}    Firefox下的居中,应该是:margin:0px auto;        body{text-align:center;}    .box{ margin:0 auto; text-align:left;}    <body>        <div class="box">            xx xx xx         </div>    </body>        (2)单行内容垂直中齐    Div{height:80px;line-height:80px;}        (3)IE中元素浮动时,margin左右加倍的问题    解决办法:Display:inline;          margin:0 auto;  ie6还是不行   问题被 (1)解决margin 左右边距在Ie6下会加倍,上下边距会合并,兼容性问题上下边距会合并,在中间加 div{height:10px;}.div1{width:200px;height:200px;background-color:#0000FF;margin:50px;float:left; display:inline;}  //第一个div 的 display为行内样式 解决"margin 左右边距在Ie6下会加倍".div2{width:200px;height:200px;background-color:#0000FF;margin:50px;float:left;}<body><div class="div1"></div><div class="div2"></div>    (4)实现1px高度的<div>在IE6下解决办法:overflow:hidden;  //超出1px外的部分全部隐藏掉<div style="width:100px; height:1px; overflow:hidden;"></div> //超出的部分隐藏掉
Copy after login

 

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.

What is the purpose of the <progress> element? What is the purpose of the <progress> element? Mar 21, 2025 pm 12:34 PM

The article discusses the HTML &lt;progress&gt; element, its purpose, styling, and differences from the &lt;meter&gt; element. The main focus is on using &lt;progress&gt; for task completion and &lt;meter&gt; for stati

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.

What is the purpose of the <datalist> element? What is the purpose of the <datalist> element? Mar 21, 2025 pm 12:33 PM

The article discusses the HTML &lt;datalist&gt; element, which enhances forms by providing autocomplete suggestions, improving user experience and reducing errors.Character count: 159

What is the purpose of the <meter> element? What is the purpose of the <meter> element? Mar 21, 2025 pm 12:35 PM

The article discusses the HTML &lt;meter&gt; element, used for displaying scalar or fractional values within a range, and its common applications in web development. It differentiates &lt;meter&gt; from &lt;progress&gt; and ex

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.

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.

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...

See all articles