7小时玩转网页布局开发【新】——5.高级技巧之多列等高

本文解决双飞翼的问题!


效果:



代码:

<!DOCTYPE html>
<html lang="en">
<head>
	<meta charset="UTF-8">
	<title>双飞翼演示</title>
	<style>
		body{ margin:0; }
		.container {  width: 100% ; overflow: hidden;}
		.container div{ float: left; min-height: 200px; margin-bottom: -9999px; padding-bottom: 9999px; }
		.container .body{ width: 100%; }
		.container .body div{ margin:0 120px; background: #cccccc; float:none;margin-bottom: -9999px; }
		.container .left{ width: 100px; background: red; margin-left: -100%;}
		.container .right{ width: 100px; background: blue; margin-left:-100px; }
	</style>
</head>
<body>
	<div class="container">
		<div class="body">
			<div>
			中间中间中间中间中间中间中间中间中间中间中间中间中间中间中间中间中间中间中间中间中间中间中间中间中间中间中间中间中间中间中间中间中间中间中间中间中间中间中间中间中间中间中间中间中间中间中间中间中间中间中间中间中间中间中间中间中间中间中间中间中间中间中间中间中间中间中间中间中间中间中间中间中间中间中间中间中间中间中间中间中间中间中间中间中间中间中间中间中间中间中间中间中间中间中间中间中间中间中间中间中间中间中间中间中间中间中间中间中间中间中间中间中间中间中间中间中间中间中间中间中间中间中间中间中间中间中间中间中间中间中间中间中间中间中间中间中间中间中间中间中间中间中间中间中间中间中间中间中间中间中间中间中间中间中间中间中间中间中间中间中间中间中间中间中间中间中间中间中间中间中间中间中间中间中间中间中间中间中间中间中间中间中间中间中间中间中间中间中间中间中间中间中间中间中间中间中间中间中间中间中间中间中间中间<br/>
			中间中间中间中间中间中间中间中间中间中间中间中间中间中间中间中间中间中间中间中间中间中间中间中间<br/>
			中间中间中间中间中间中间中间中间中间中间中间中间中间中间中间中间中间中间中间中间中间中间中间中间<br/>
			中间中间中间中间中间中间中间中间中间中间中间中间中间中间中间中间中间中间中间中间中间中间中间中间<br/>
			中间中间中间中间中间中间中间中间中间中间中间中间中间中间中间中间中间中间中间中间中间中间中间中间<br/>
			中间中间中间中间中间中间中间中间中间中间中间中间<br/>
			中间中间中间中间中间中间中间中间中间中间中间中间<br/>
			中间中间中间中间中间中间中间中间中间中间中间中间<br/>
			中间中间中间中间中间中间中间中间中间中间中间中间<br/>
			中间中间中间中间中间中间中间中间中间中间中间中间<br/>
			中间中间中间中间中间中间中间中间中间中间中间中间<br/>
			中间中间中间中间中间中间中间中间中间中间中间中间<br/>
			中间中间中间中间中间中间中间中间中间中间中间中间<br/>
			中间中间中间中间中间中间中间中间中间中间中间中间<br/>
			中间中间中间中间中间中间中间中间中间中间中间中间<br/>
			中间中间中间中间中间中间中间中间中间中间中间中间<br/>
			中间中间中间中间中间中间中间中间中间中间中间中间<br/>
			中间中间中间中间中间中间中间中间中间中间中间中间<br/>
			中间中间中间中间中间中间中间中间中间中间中间中间<br/>
			</div>
		</div>
		<div class="left">左侧</div>
		<div class="right">右侧</div>

	</div>
</body>
</html>

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
绘制等线图需要将数据转化为二维数组形式,因为等线图是在二维平面上绘制的。如果数据有5列,你可以选择将其中3列作为坐标轴,另外2列作为度值,这样就可以绘制出一个三维的等线图。 以下是一个使用 Matplotlib 库绘制三维等线图的示例代码: ```python import numpy as np import matplotlib.pyplot as plt from mpl_toolkits.mplot3d import Axes3D # 生成数据 x = np.linspace(-5, 5, 50) y = np.linspace(-5, 5, 50) X, Y = np.meshgrid(x, y) Z1 = np.sin(np.sqrt(X**2 + Y**2)) Z2 = np.cos(np.sqrt(X**2 + Y**2)) Z3 = np.exp(-((X-1)**2 + (Y-1)**2)) Z4 = np.exp(-((X+1)**2 + (Y+1)**2)) Z5 = np.exp(-((X+2)**2 + (Y-2)**2)) # 绘制三维等线图 fig = plt.figure() ax = fig.add_subplot(111, projection='3d') ax.contour(X, Y, Z1, zdir='z', offset=-2, cmap=plt.cm.viridis) ax.contour(X, Y, Z2, zdir='z', offset=-1, cmap=plt.cm.viridis) ax.contour(X, Y, Z3, zdir='z', offset=0, cmap=plt.cm.viridis) ax.contour(X, Y, Z4, zdir='z', offset=1, cmap=plt.cm.viridis) ax.contour(X, Y, Z5, zdir='z', offset=2, cmap=plt.cm.viridis) # 设置坐标轴标签 ax.set_xlabel('X') ax.set_ylabel('Y') ax.set_zlabel('Z') # 显示图像 plt.show() ``` 在这个示例代码中,我们生成了5列数据,其中前两列是坐标轴的数据,后三列是度值数据。我们使用 Matplotlib 库中的 `Axes3D` 类来绘制三维图像,并使用 `contour` 函数绘制等线。通过 `zdir` 参数指定绘制在哪个平面上,通过 `offset` 参数指定绘制在哪个度上,通过 `cmap` 参数指定颜色映射表。最后通过 `set_xlabel`、`set_ylabel` 和 `set_zlabel` 方法设置坐标轴标签,并使用 `show` 函数显示图像。 你需要将示例代码中的数据替换为自己的数据,然后运行代码即可生成等线图。

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值