`
mutongwu
  • 浏览: 452446 次
  • 性别: Icon_minigender_1
  • 来自: 广州
社区版块
存档分类
最新评论
文章列表
如果block父元素设置了宽度,而block子元素又没有设置宽度(我的理解是默认为一个单词/汉字的宽度),那么,假如 子元素的内容+padding + margin 超过了父元素的宽度,则,子元素的内容将会自动换行,每一行的最小内容为一个单词(汉字),然后计算该行的内容 + padding +  margin,超过父元素的宽度,重复换行操作,直到所有内容显示。这个时候,假如父元素没有设置高度,那么所有的内容都能够正常显示,假如父元素设置了高度,并且高度已经不足于包含内容,所有内容也会显示,但可能会受到周围元素的覆盖。 .sample{ display:block; visibility: ...
.container{ width:350px; background-color:#ccc; } span.box { display:inline; visibility:visible; line-height:100px; margin:0 100px; padding:20px 120px; border-top: 5px solid gray; border-bottom:5px solid black; border-left: 5px solid gray; border-right: 5px solid ...
利用insertAdjacentHTML与Range实现DOM操作,可以允许我们把一串字符串快速的转变为DOM元素,并插入到文档中的具体位置。 function fn(){ //IE 和 Chrome var str = '<div style="width:200px;height:100px;background-color:gray;">Content here</div>'; var b = document.getElementById("b"); //b.insertAdjacentHTML('Befo ...
1.方法一:上下两张带圆角的图片。宽度固定,允许高度变动. <div class="box"> <h2>Headline</h2> <p>Content</p> </div> .box { width: 418px; background: #effce7 url(images/bottom.gif) no-repeat left bottom; } .box h2 { background: url(images/top.gif) no-repeat left top; } ...
空白边叠加现象:只发生在垂直方向上的block元素(如p,h1,div等)。float,inline(如strong,span)以及绝对定位元素不受影响。 1.包含关系: <div class="outer"> <div class="inner">inner</div> </div> .inner{ width:100px;height:100px;background-color:#666; margin-top:20px; } .outer{ width:200p ...
background-position: [left] [top] ; 默认值为: 0% 0% 。此时背景图片将被定位于对象不包括补丁( padding )的内容区域的左上角,也就是说padding值不影响position的定位。 如果只指定了一个值,该值将用于横坐标。纵坐标将默认为 50% 。如果指定了两个值,第二个值将用于纵坐标。内置的几个值分别对应: top:0%; left:0%; right:100%; bottom:100%; center:50%; 1.对于使用数据值单位(如px等) 那么以 目标元素左上角为坐标原点,以image元素的左上角为参考点,距离目标元素的左边距和上边距 ...
转载自:http://witmax.cn/css-text-selection.html 样式: /*应用到全部标签*/ * ::-moz-selection{ background:#FFCC89 none repeat scroll 0 0; color:#222222; } ::selection{ background:#FFCC89 none repeat scroll 0 0; color:#222222; } #someID ::-moz-selection{ background:#cc00cc none re ...

关于float的理解

    博客分类:
  • CSS
div.collapse{ width:100px; height:100px; padding:5px; /*margin:10px;*/ background-color:lightblue; border:1px solid #a9a9a9; } <div id="wrapper" style="background:pink;"> <div class="collapse" style="float:left;">content </div ...

简单表单

    博客分类:
  • CSS
fieldset{ border: 1px solid green; } legend{ font-weight:bold; } label{ /* 启用该规则,标签将显示在输入框上面 display:block; */ /*启用下面的规则,标签将显示在输入框的左边,并具有了宽度*/ float:left; width:10em; /*text-align:center;*/ } input[type="text"]{ width:200px; } /*IE6不支持属性选择*/ input.radio{ ...
1.采用固定宽度 #wrapper{ width:800px; margin:0 auto; background:#999 url(img/1.jpg) repeat-y left top; } #header{ height:100px; background-color:#ccc; } #nav{ width:200px; background-color:#999; float:left; } #content{ float:right; background-color:#362219; } #bigger{ wid ...
转载自:http://dancewithnet.com/2004/12/13/effect-of-meat-in-html/ meta 是用来在HTML文档中模拟HTTP协议的响应头报文。meta 标签用于网页的<head />与</head />中,meta 标签的用处很多。meta 的属性有两种:name和http-equiv。name属性主要用于描述网页,对应于content(网页内容),以便于搜索引擎机器人查找、分类(目前几乎所有的搜索引擎都使用网上机器人自动查找meta值来给网页分类)。这其中最重要的是description(站点在搜索引擎上的描述)和key ...
function T(name){ this.name = name; } var a = new T('Jack'); //注意:__proto__属性在访问IE下无法访问。 alert(a.constructor)//function T(){...} alert(T.prototype.constructor);//function T(){...} alert(T.prototype.isPrototypeOf(a))//true.判定 a 的_proto_ 指向 T的prototype对象。 alert(a.__proto__ == T.prototy ...
toString()用于将对象转换为相应的字符串,以便作为输出(如调用alert()方法)易于阅读。 如果对象没有自己定义该方法的实现,则默认调用Object对象的toString()方法。 valueOf() 的作用跟toString()方法有些类似,对于某一些对象,例如Number,Boolean,或者是自己定义的"数字类",我们更倾向于获取它们的值,而不仅仅是作为字符串的意义输出。那么,我们就可以为该对象定义自己的valueOf()方法。 注意:当把一个对象转化为字符串的时候,valueOf()方法会稍微比 toString()方法更为优先,因此,想得到正确的字符串 ...
来源:《Javascript权威指南第五版》 <body onload="init();"> <!-- Define the element to be dragged --> <div style="position:absolute; left:100px; top:100px; width:250px; background-color: white; border: solid black;"> <!-- Define the "handle" to ...
<?xml version="1.0" encoding="UTF-8"?> <project name="Packaging Generator" default="newReport_war" basedir="."> <!--公共基础组件 --> <property name="commonLibDir" value="WebContent/WEB-INF/lib" /> < ...
Global site tag (gtag.js) - Google Analytics