display

Why do I get a gap between last element in one form and first element in second form?

泪湿孤枕 提交于 2019-12-10 19:21:00
问题 I have this html file: * { margin: 0; padding: 0; box-sizing: border-box; } body { margin: 0; background: #ff5; } form { display: inline; } #nick_msg { background: #000; position: fixed; bottom: 0; width: 90%; } #nick { width: 20%; } #nick input { border: 0; padding: 10px; width: 10%; background: #00f; } #nick button { border: 0; padding: 10px; width: 10%; background: rgb(130, 224, 255); } #msg { width: 80%; } #msg input { border: 0; padding: 10px; width: 60%; } #msg button { border: 0;

基础梳理之 标签默认样式及css reset

冷暖自知 提交于 2019-12-10 17:11:27
一、浏览器标签的一些默认样式 部分: body { margin : 8px ; line-height : 1.12 } h1 { font-size : 2em ; margin : .67em 0 } h2 { font-size : 1.5em ; margin : .75em 0 } h3 { font-size : 1.17em ; margin : .83em 0 } h4, p, blockquote, ul, fieldset, form, ol, dl, dir, menu { margin : 1.12em 0 } h5 { font-size : .83em ; margin : 1.5em 0 } h6 { font-size : .75em ; margin : 1.67em 0 } h1, h2, h3, h4, h5, h6, b,strong { font-weight : bolder } button, textarea, input, object, select { display : inline-block ; } big { font-size : 1.17em } small, sub, sup { font-size : .83em } sub { vertical-align : sub } /*定义sub元素默认为下标显示*/

web第四讲 display三种用法

Deadly 提交于 2019-12-10 15:06:03
display三种用法 display三种用法 display:inline 让块状元素成为一行 display:block 让行内元素成为块状元素 display:inline-block 将对象呈现为内联(行),但对象的内容作为块对象呈现出来。《行内块状元素》 <!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <title>display的三种用法</title> <style type="text/css"> #hang1{ background-color: aqua; display: inline; } #hang2{ background-color:green; display: inline; } #kua1{ background-color: aqua; display: block; } #kua2{ background-color:green; display: inline-block; } strong{display: block;} </style> </head> <body> <p id="hang1">今天是星期四!</p><br> <p id="hang2">明天是星期五!</p> <strong id="kua1">今天是星期四!</strong>

Hidding SVG affects other SVG styles in the same page

最后都变了- 提交于 2019-12-10 14:37:18
问题 An SVG is loaded several times in the same page. The SVG is used to show a graphic representation of values. Think of a map where every region shows a given value using a color code. In each SVG, for every region a CSS class is dynamically applied to match the desired SVG pattern fill used. CSS styles and patterns are defined in the SVG file. Here is an example: <svg height="100" width="100"> <style> /* */ .striped-pain-1 {fill: url(#striped-pain-1);} /* */ </style> <defs> <pattern id=

Why do the MDN docs state that the initial display value for all elements is inline?

北城以北 提交于 2019-12-10 12:37:40
问题 This is clearly not the case as each element can have it's own default. See here: https://developer.mozilla.org/en-US/docs/Web/CSS/display Initial value: inline Applies to: all elements And of course contradicting documentation which seems more correct in this case. https://www.w3schools.com/css/css_display_visibility.asp Is there something I'm missing here? It seems to clearly state that "all elements" have "initial value" set to inline. 回答1: First of all w3schools isn't the official

一个很有趣的用于调试函数代码的函数 dtrace.lisp

て烟熏妆下的殇ゞ 提交于 2019-12-10 03:47:04
一个很有趣的用于调试函数代码的函数 dtrace.lisp,来自这本书《COMMON LISP:A Gentle Introduction to Symbolic Computation》。 Common Lisp 中原来就有一个跟踪函数 trace,使用时把你要跟踪的函数名称作为参数,然后你的函数就可以显示一些内部信息了。 dtrace 则使用了一些更形象的符号,看起来好像稍微直观了一些,我把原来的符号改成了用制表符,效果如下: CL-USER> (defun 迭代 (积 次数 最大次数) (if (> 次数 最大次数) 积 (迭代 (* 次数 积) (+ 次数 1) 最大次数))) 迭代 CL-USER> (defun 阶乘 (数) (迭代 1 1 数)) 阶乘 CL-USER> (阶乘 5) 120 这里定义了两个用于求阶乘的函数,接下来为这两个函数建立跟踪,建立好跟踪之后执行该函数,命令如下: CL-USER> (dtrace 阶乘 迭代) (阶乘 迭代) CL-USER> (阶乘 15) ┌─── [进入-> 阶乘 │ 数 = 15 │ ┌─── [进入-> 迭代 │ │ 积 = 1 │ │ 次数 = 1 │ │ 最大次数 = 15 │ └─── 迭代 <-返回] 1307674368000 └─── 阶乘 <-返回] 1307674368000

清除浮动的7种方法

纵然是瞬间 提交于 2019-12-10 03:20:52
使用display:inline-block会出现的情况: 1.使块元素在一行显示 2.使内嵌支持宽高 3.换行被解析了 4.不设置的时候宽度由内容撑开 5.在IE6,7下步支持块标签 由于inline-block属性换行的时候被解析(有间隙)故解决方法使用浮动float:left/right 使用浮动时出现的情况: 1.使块元素在一行显示 2.使内嵌元素支持宽高 3.不设置不宽高的时候宽度由内容撑开 4.换行不被解析(故使用行内元素的时候清除间隙的方法可以使用浮动) 5.元素添加浮动,会脱离文档流,按照指定的一个方向移动,直到碰到父级的边界或者另一个浮动元素停止(文档流是文档中可显示对象在排列时所占用的位置) 1 <!DOCTYPE HTML> 2 <html> 3 <head> 4 <meta http-equiv="Content-Type" content="text/html; charset=utf-8"> 5 <title>无标题文档</title> 6 <style> 7 div,span{height:100px;background:red;border:1px solid #000; float:left;} 8 /* 9 inline-block 10 11 1.使块元素在一行显示 12 13 2.使内嵌支持宽高 14 15 3.换行被解析了 16 17 4

Web前端第五天-jquery进阶

安稳与你 提交于 2019-12-10 02:38:22
#1.在jquery中获取其属性 KaTeX parse error: Expected 'EOF', got '#' at position 3: ("#̲tv_div").prop("… ("#tv_div").prop(“class”,“getClass”) 删除其属性:$("#tv_div").removeProp(“class”); 具体代码如下: < ! DOCTYPE html > < html lang = "en" > < head > < meta charset = "UTF-8" > < title > Title < / title > < script src = "js/jquery-1.8.3.js" > < / script > < style > . getClass { width : 100 px ; height : 100 px ; background : red ; } < / style > < / head > < body > < input type = "button" onclick = "show()" value = "获取" > < input type = "button" onclick = "setElment()" value = "设置" > < input type = "button" onclick

水平居中和垂直居中

倾然丶 夕夏残阳落幕 提交于 2019-12-10 02:14:31
1.水平居中 (1) 文本、图片等行内元素的水平居中   给父元素设置text-align:center可以实现文本、图片等行内元素的水平居中。 (2) 确定宽度的块级元素的水平居中   通过设置margin-left:auto;和margin-right:auto;来实现的。 (3) 不确定宽度的块级元素的水平居中   方法一:   使用table标签,table本身并不是块级元素,如果不给它设定宽度的话,它的宽度由内部元素的宽度“撑起”,但即使不设定它的宽度,仅设置margin-left:auto;和margin-right:auto;就可以实现水平居中!   将需要居中的部分包含在table标签内,对table设置margin-left:auto;和margin-right:auto;就可以使table水平居中,间接使需要居中的部分水平居中。   缺点:增加了无语意标签,加深了标签的嵌套层数。 <style type="text/css">ul{list-style:none; margin:0; padding:0;}.wrap{ width:500px; height:100px;}table{margin-left:auto;margin-right:auto;}.test li{float:left; display:inline; margin-right:5px;

flex布局

廉价感情. 提交于 2019-12-10 01:00:21
flex布局 容器的属性 flex-direction属性 flex-wrap属性 flex-flow属性 justify-content属性 align-items属性 align-content属性 flex布局 Flex 是 Flexible Box 的缩写,意为"弹性布局",用来为盒状模型提供最大的灵活性。 任何一个容器都可以指定为 Flex 布局。 .box{ display: flex; } 行内元素也可以使用 Flex 布局。 .box{ display: inline-flex; } Webkit 内核的浏览器,必须加上 -webkit 前缀。 .box{ display: -webkit-flex; /* Safari */ display: flex; } 注意,设为 Flex 布局以后,子元素的 float 、 clear 和 vertical-align 属性将失效。 容器的属性 以下6个属性设置在容器上。 flex-direction flex-wrap flex-flow justify-content align-items align-content flex-direction属性 通过给父盒子添加flex属性,来控制子盒子的位置和排列方式 flex-direction 属性决定主轴的方向(即项目的排列方向)。 row (默认值):主轴为水平方向