padding

前端之CSS

别说谁变了你拦得住时间么 提交于 2019-12-01 08:53:22
目录 CSS 介绍 CSS语法 引用方法 基本选择器 4 | 2组合选择器 后代选择器 儿子选择器 毗邻选择器 弟弟选择器 属性选择器 分组和嵌套 伪类选择器 伪元素选择器 选择器的优先级 CSS属性相关 宽和高 字体属性 文字属性 文字之间的距离 背景属性 边框 border-radius display属性 CSS盒子模型 margin外边距 padding内填充 float clear overflow溢出属性 定位(position) 是否脱离文档流 z-index opacity CSS 介绍 CSS(Cascading Style Sheet,层叠样式表)定义如何显示HTML元素。 当浏览器读到一张样式表,它就会按照这个样式表来对文档进行格式化(渲染)。 CSS语法 引用方法 行内样式 行内样式是在标记的style属性中设定CSS样式。(不推荐大规模使用) <p style="color=red">hello world</p> 内部样式 内部样式是将CSS样式集中写在网页的 <head></head> 标签中的 <style></style> 标签中。 <head> <meta charset="utf-8"> <title>Title</title> <style> p{ background-color:red; } </style> </head> 外部样式

Flutter 将TextField平滑过渡到Text

对着背影说爱祢 提交于 2019-12-01 08:23:37
import 'package:flutter/material.dart'; void main() => runApp(MyApp()); class MyApp extends StatelessWidget { @override Widget build(BuildContext context) { return MaterialApp( home: HomePage(), ); } } class HomePage extends StatefulWidget { @override _HomePageState createState() => _HomePageState(); } class _HomePageState extends State<HomePage> with SingleTickerProviderStateMixin { AnimationController controller; @override void initState() { super.initState(); controller = AnimationController( duration: Duration(seconds: 1), vsync: this, ); } @override Widget build(BuildContext context) {

Padding causes horizontal scroll - it increases the width

回眸只為那壹抹淺笑 提交于 2019-12-01 08:17:23
问题 Please look at this code: <html> <head> <style type="text/css"> html, body{ width:100%; height:100%; margin:0px; } #header{ width:100%; height:100px; position:fixed; display:inline-block; background-color:red; padding:0 10px 10px 10px; } </style> </head> <body> <div id="header"> <div id="header-container"> </div> </div> </body> </html> here is the demo . The header must have 100% width and 10px padding from left,right and bottom. please look at this picture this is the layout of #header by

前端CSS

故事扮演 提交于 2019-12-01 08:11:48
前端CSS CSS介绍 CSS( C ascading S tyle S heet,层叠样式表)定义 如何显示 HTML元素。 当浏览器读到一个样式表,它就会按照这个样式表来对文档进行格式化(渲染)。 CSS语法 CSS实例 每个CSS样式由两个组成部分:选择器和声明。声明又包括属性和属性值。每个声明之后用分号结束。 CSS注释 /*这是注释*/ 注释是代码之母。 CSS的几种引入方式 行内样式 行内式是在标记的style属性中设定CSS样式。不推荐大规模使用。 <p style="color: red">Hello world.</p> 内部样式 嵌入式是将CSS样式集中写在网页的<head></head>标签对的<style></style>标签对中。格式如下: <head> <meta charset="UTF-8"> <title>Title</title> <style> p{ background-color: #2b99ff; } </style> </head> 外部样式 外部样式就是将css写在一个单独的文件中,然后在页面进行引入即可。推荐使用此方式。 <link href="mystyle.css" rel="stylesheet" type="text/css"/> CSS选择器 基本选择器 元素选择器 p {color: "red";} ID选择器 #i1

jQuery进阶第三天(2019 10.12)

血红的双手。 提交于 2019-12-01 08:01:00
一、原生JS 快捷的尺寸(属性) clientWidth/clientHeight       =====> 获得元素 content+padding 的宽/高; offsetWidth/offsetHeight       =====>获得元素 content+padding+border 的宽/高; clientLeft/clientTop =====>左/上边框的距离; offsetLeft/offsetTop =====>获得距离父元素定位左/上的距离 IE浏览器计算边框 // 高级浏览器不计算边框; offsetParent =====>获得定位的父元素的信息 (父元素不一定是parentNode,若没有定位,则往祖 1 <!DOCTYPE html>    1-2的案例 <!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <meta name="viewport" content="width=device-width, initial-scale=1.0"> <meta http-equiv="X-UA-Compatible" content="ie=edge"> <title>Document</title> <style> *{ padding: 0; margin: 0; } div{

002 前端基础之CSS

♀尐吖头ヾ 提交于 2019-12-01 07:58:43
目录 一、CSS介绍 二、CSS语法 2.1 CSS实例 2.2 CSS注释 三、CSS的几种引入方式 3.1 行内样式(内联样式) 3.2 内部样式 3.3 外部样式 四、CSS选择器 4.1 基本选择器 元素选择器 ID选择器 类选择器 通用选择器 4.2 组合选择器 后代选择器 儿子选择器 毗邻选择器 兄弟选择器 4.3 属性选择器 4.4 分组和嵌套 分组 嵌套 4.5 伪类选择器 4.6 伪元素选择器 first-letter before after 4.7 选择器的优先级 CSS继承 选择器的优先级 五、CSS属性相关 5.1 宽和高 5.2 字体属性 文字字体 字体大小 字重(粗细) 文本颜色 5.3 文字属性 文字对齐 文字装饰 首行缩进 文字之间的距离 5.4 背景属性 5.5 边框 5.6 border-radius 5.7 display属性 5.8 CSS盒子模型 5.9 margin外边距 5.10 padding内填充 4.11 float浮动 三种取值 5.12 clear清除浮动 清除浮动 5.13 overflow溢出属性 5.14 定位(position) static relative(相对定位) absolute(绝对定位) fixed(固定) 脱离文档流: 不脱离文档流: 5.15 z-index 5.16 opacity 六、综合案例

博客园simplememory模板自定义背景代码

人盡茶涼 提交于 2019-12-01 07:57:15
页面定制CSS代码 /*simplememory*/ #google_ad_c1, #google_ad_c2 {display:none;} .syntaxhighlighter a, .syntaxhighlighter div, .syntaxhighlighter code, .syntaxhighlighter table, .syntaxhighlighter table td, .syntaxhighlighter table tr, .syntaxhighlighter table tbody, .syntaxhighlighter table thead, .syntaxhighlighter table caption, .syntaxhighlighter textarea { font-size: 14px!important; } #home { opacity: 0.80; margin: 0 auto; width: 85%; min-width: 950px; background-color: #fff; padding: 30px; margin-top: 30px; margin-bottom: 50px; box-shadow: 0 2px 6px rgba(100, 100, 100, 0.3); } #blogTitle h1 {

CSS, nested divs & margins vs. padding

五迷三道 提交于 2019-12-01 07:49:07
i totally understand the box model. this question is more about trying to pin down a semantic methodology regarding when to use margins and when to use padding. here is a typical example, first, in plain English: situation: we have a container div, inside of which there is a paragraph element. goal: to have a 12px space between the inside of the div and the outside of the paragraph. option a) apply 12px of padding to the container div option b) apply 12px margins to the paragraph element or, if you prefer, HTML: <div id="container"> <p>Hello World!</p> </div> and, CSS: option a) div#container

盒子模型总结

本小妞迷上赌 提交于 2019-12-01 07:43:46
1、CSS盒子模型 所有的HTML元素都可以看做盒子,包括:实际内容(content),内边距(padding),边框 (border),外边距(margin)四个属性 2、标准盒子模型和IE盒子(怪异)模型 盒子的实际内容content的width/height=我们设置的width/height 盒子总宽度=width/height+padding+margin+border .box { width: 200px; height: 200px; border: 20px solid black; padding: 50px; margin: 50px; } 怪异盒子模型(IE) width=content+padding+border 盒子的总高度=width+margin .box { width: 200px; height: 200px; border: 20px solid black; padding: 50px; margin: 50px; } 3、css3指定盒子模型类型 标准盒模型:box-sizing:content-box IE(怪异)盒模型:box-sizing:border-box 来源: https://www.cnblogs.com/xingxyx/p/11669663.html

盒子模型

孤者浪人 提交于 2019-12-01 07:27:30
盒子模型是由内容、边框、间隙(padding)、间隔(margin)组成 w3c标准盒子模型:盒子的宽度=左右margin+左右padding+width+border 盒子的高度=上下margin+上下padding+height+border IE盒子模型:margin+border+padding border border是元素的边框,border有三个主要属性,color(颜色)、width(粗细)和style(样式)。 1、color主要是指定border的颜色,比如红色是“#FF0000”,red,rgb(255,0,0)三种方式。 2、width是border粗细程度,可以设置为thin、thick和length,length为具体数值,比如说border:1px #CCC solid;其中1px指的是border的width,默认值是medium,一般浏览器解析为2像素。 3、style属性可以设为none、hidden、dotted、dashed、solid、double、groove、ridge、inset和outset等,其中none和hodden是不显示border,hidden可以用来解决边框的冲突问题。对于groove、inset、outset、rigde、border-style,IE会出现兼容问题。 margin margin用于控制块与块