前端开发基本操作笔记合集【伸手党福利】【不断更新】

前端开发基本操作:


div中两个div强制在一行

父级元素添加style

white-space: nowrap;

子级元素添加style

display:inline-block

总计:

.father {
    
    
white-space: nowrap;
}
.father .son{
    
    
display:inline-block
}

同一行div左中右排版,强制左对齐,居中,右对齐

https://blog.csdn.net/weixin_43758938/article/details/100667061

float: left;


position: relative;


float: right;

微信小程序中,colorui

只需要在父级给
display: flex; justify-content: space-between;这两个即可

普通的:

<div class="header">
		<div class="header-left">
			<img src="./img/logo2.png">
		</div>
		<div class="header-center">
			<img src="./img/header.jpg">
		</div>
		<div class="header-right">
			<ul>
				<li>
					<a href="#">登录</a>
				</li>
				<li>
					<a href="#">注册</a>
				</li>
				<li>
					<a href="#">购物车</a>
				</li>
			</ul>
		</div>
	</div>
.header{
    
    
	width: 100%;
	height: 84px;
	display: flex; 
	justify-content: space-between;
}
.header-left{
    
    
	width: 140px;
	height: 62px;
	padding-top: 11px;
}
.header-left img{
    
    
	width: 100%;
	height: 100%;
}
ul{
    
    
	overflow: hidden;
	margin: 0px;
	padding: 0px;
}
.header-right>ul>li{
    
    
	float: left;
	margin-right: 20px;
	line-height: 84px;

}

在这里插入图片描述

放大和缩小元素

在uni中可以使用animate实现元素的放大和缩小,但是不能设置元素的重心,所以无法随意旋转元素实现动画效果。

猜你喜欢

转载自blog.csdn.net/wwppp987/article/details/111134460