<!DOCTYPE html><html>
    <head>
        <meta charset="utf-8" />
        <title>testtitle>
        <style type="text/css">
             .myclass1{
                background-color: red;
                width: 100px;
                height: 200px;
                display:inline-block;
            }
            
            .myclass2{
                background-color:black;
                 width: 100px;
                height: 200px;
                display:inline-block;
            }
             .myclass3{
                background-color: red;
                 width: 100px;
                height: 200px;
                display:inline-block;
               }      
        style>
    head>
    <body>
        <span class="myclass1">1span>
        <span class="myclass2">2span>
        <span class="myclass3">3span>
    body>html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>mood float</title>
    <style type="text/css">
        .box1 {
            width: 100px;
            height: 100px;
            background-color: red;
            float: left;
        }

        .box2{
            width: 100px;
            height: 100px;
            background-color: green;
            float: left;
        }

        .box3{
            width: 100px;
            height: 100px;
            background-color: orange;
            float: right;
        }
    </style>
</head>
<body>
    <div class="box1" >
        red
    </div>
    <div class="box2">
        green
    </div>
    <span class="box3">
        orange
    </span>
</body>
</html>
 <html>
<head>
  <meta charset="utf-8">
  <title></title>
<style>
clear:right;        
</style>  
</head>
<body>
<!--浮动元素float-->                                          
<img src="./111.jpg" alt="美女2" style="float:right"/>    
<!--
.clear{clear:left;}
清楚浮动后,则变成块标签
-->        
<p>11111111<p>
<p>11111111<p>
<table border="1" cellspacing="0" width="40%" height="100%" align="center">
<tr>
<td>测试浮动元素</td>
<td>测试</td>
</tr>
</table>
<p>11111111<p>
<p>11111111<p>
<p>11111111<p>
<p>11111111<p>
<p>11111111<p>
<p>11111111<p>
<!--使用<div>布局页面,产生三列的效果-->
<img src="./111.jpg" alt="美女2" style="float:right"/>    
<img src="./111.jpg" alt="美女2" style="float:right"/>    
<img src="./111.jpg" alt="美女2" style="float:right"/>

<!--
 定位元素

将浏览器窗口看做一个坐标系统,以左上角为坐标原点 (0,0),横坐标为x轴,纵坐标为y轴。
absolute(绝对定位)
通过属性left、right、top和bottom来定位元素。
h1
{
            position: absolute;
            top: 20px;
            left: 60px;
}
绝对定位不占据页面空间。
-->    
<!--
relative(相对定位)
采用相对定位的元素,其位置是相对于它在文档中的原始位置计算而来的(top,left)。
采用相对定位的元素会获得相应的空间。
即是相对定位是通过将元素从原来的位置向右、向左、向上或向下移动来定位的。

例子:
<div class="center">
        <div class="content">
            美国两位总统候选人7日晚在田纳西州贝尔蒙特大学举行了第二场辩论,金融危机成为双方攻守的主打牌。
        </div>
</div>

.center{
            position: absolute;
            top: 50%;
            left: 50%;
          border: solid 1px green;
}
.content{
            position: relative;
            top: -50px;
            left: -100px;
            width: 200px;
            height: 100px;
            border: solid 1px red;
解析:
    1. 绿色边框是center元素所在的位置,其左上角处于页面的正中心。
    2. 红色边框的是content元素所在的位置,其左上角相对center元素向上移动了50px,向左移动了100px,从而使其位于页面的中心。
            
-->
<!--

-->
<!--

-->
<!--

-->
<!--

-->
<!--

-->
<!--

-->
<!--

-->
</body>
</html>
.left{float:left; background-color:green; width:200px; height:100px;}
.right{height:100px; background-color:blue; margin-left:200px;}
.clearfix:after{
content:""; /*设置内容为空*/
height:0; /*高度为0*/
line-height:0; /*行高为0*/
display:block; /*将文本转为块级元素*/
visibility:hidden; /*将元素隐藏*/
clear:both; /*清除浮动*/
}


.clearfix{
zoom:1; /*为了兼容IE*/
}
<div class="box1">box1</div>
<div class="box2">box2</div>
<div class="box3">box3</div>


.box1{
	border: 2px solid red;
	width: 40px;
	height:100px;
	float:left;
}
.box2{
	border: 6px solid black;
	width:100px;
	height:40px;
	float:left;
}
.box3{
	border: 12px solid blue;
	width:100px;
	height:300px;
	float:left;
}
box-shadow: h-shadow v-shadow blur spread color inset;

h-shadow	必需的。水平阴影的位置。允许负值
v-shadow	必需的。垂直阴影的位置。允许负值
blur	可选。模糊距离(模糊半径)
spread	可选。阴影的大小(扩展距离)
color	可选。阴影的颜色。在CSS颜色值寻找颜色值的完整列表
inset	可选。从外层的阴影(开始时)改变阴影内侧阴影
<!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>清除浮动-双伪元素清除浮动</title>
<style>
.clear::before,
.clearfix:after {
content: "";
display: block;

}

.clearfix:after {
clear: both;
}

.clearfix {
*zoom: 1;
}

.box {
width: 800px;
border: 1px solid blue;
margin: 0 auto;
}

.damao {
float: left;
width: 300px;
height: 200px;
background-color: purple;
}

.ermao {
float: left;
width: 200px;
height: 200px;
background-color: pink;
}

.footer {
height: 200px;
background-color: black;
}
</style>
</head>

<body>
<div class="box clearfix">
<div class="damao">大毛</div>
<div class="ermao">二毛</div>
</div>

<div class="footer"></div>

</body>

</html>
//UIbutton的换行显示
button.titleLabel.lineBreakMode = NSLineBreakByWordWrapping;
//然后如同title的内容用包含“\n”就会换行
title = @“123\n666”
知识2:Version 与 Build号的获取
NSString *versionStr = [[[NSBundle
mainBundle]infoDictionary]valueForKey:@"CFBundleShortVersionString"];
NSString *buildStr = [[[NSBundle
mainBundle]infoDictionary]valueForKey:@"CFBundleVersion"];
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<title> CSS属性 </title>
<meta name="Generator" content="EditPlus">
<meta name="Author" content="">
<meta name="Keywords" content="">
<meta name="Description" content="">
<style>
.float {
float: left;
width: 200px;
height: 100px;
background: #666666;
}
.clear {
clear: left;
float: left;
width: 200px;
height: 100px;
background: #999999;
}
</style>
</head>

<body>
<div class="float">这是一个浮动元素</div>
<div class="clear">这是一个清除浮动属性的元素</div>
</body>
</html>
  <p>固定高度</p>
<div >
<i>Float Test</i>
<div >Float Left</div>
<i>Float Test</i>
</div>
<div style={{ display: 'flex' }}>
<div style={{ width: '85px' }}>第一个子元素:</div>
<div style={{ width: '85px' }}>第二个子元素:</div>
</div>
<!DOCTYPE html>
<html lang="en">

<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>浮动元素具有行内块元素特点</title>
<style>
/* 任何元素都可以浮动,不管原先是什么模式的元素,添加浮动之后具有行内块元素相似的特性 */
span,
div {
float: left;
width: 200px;
height: 100px;
margin-right: 2px;
/* span为行内元素 没有宽和高,不能直接设置宽和高 */
background-color: skyblue;
/* 如果行内元素有了浮动,则不需要转换为块级/行内块元素 就可以直接设置高度和宽度 */
}

p {
height: 200px;
background-color: purple;
}
/* 清除浮动 - 使用双伪元素清除浮动 */
		.clearfix:before,
		.clearfix:after {
			content: "";
			display: table;
		}
<!DOCTYPE html> 
<html lang="en">
<head>    
	<meta charset="UTF-8" /> 
    <title>浮动元素与父盒子</title>
	<style type="text/css">
		/* 清除标签默认的内外边距 */
		* {
		   padding: 0;     
		   margin: 0;
		}
		
		/* 父容器盒子模型 */
		.father {
			width: 400px;
			height: 400px;
			background-color: pink;
			
			/* 20 像素边框 */
			border: 20px solid blue;
			
			/* 20 像素内边距 */
			padding: 20px;
			
			/* 20 像素外边距 */
			margin: 20px;
		}
		
		/* 子元素 - 浮动元素 */
		.son {
			float: left;
			width: 200px;
			height: 200px;
			background-color: red;
		}
	</style>
</head>
<body>
	<div class="father">
		<div class="son"></div>
	</div>
</body>
</html>
<!DOCTYPE html> 
<html lang="en">
<head>    
	<meta charset="UTF-8" /> 
    <title>浮动元素与父盒子</title>
	<style type="text/css">
		/* 清除标签默认的内外边距 */
		* {
		   padding: 0;     
		   margin: 0;
		}
		
		/* 父容器盒子模型 */
		.father {
			width: 500px;
			height: 500px;
			background-color: pink;
			
			/* 20 像素边框 */
			border: 20px solid blue;
		}
		
		/* 子元素 - 浮动元素 */
		.son1 {
			float: left;
			width: 200px;
			height: 150px;
			background-color: red;
		}
		
		/* 子元素 - 浮动元素 */
		.son2 {
			float: left;
			width: 150px;
			height: 200px;
			background-color: purple;
		}
	</style>
</head>
<body>
	<div class="father">
		<div class="son1"></div>
		<div class="son2"></div>
	</div>
</body>
</html>
  • 1
  • 2
  • 3
  • 4
  • 5