css 笔记_html/css_WEB-ITnose
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> //超出的部分隐藏掉

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



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 article discusses the HTML <progress> element, its purpose, styling, and differences from the <meter> element. The main focus is on using <progress> for task completion and <meter> for stati

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.

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

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

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

AnexampleofastartingtaginHTMLis,whichbeginsaparagraph.StartingtagsareessentialinHTMLastheyinitiateelements,definetheirtypes,andarecrucialforstructuringwebpagesandconstructingtheDOM.

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