

Color: red
Color: rgb(255, 99, 71)
Color: rgba(<red>, <green>, <blue>, <alpha>)
Color: #ff6347
background-image: url("gradient_bg.png");
background-repeat: repeat-x; 或者:background-repeat: no-repeat;
(1)background-position:指定背景图像的位置
background-position: right top;
(2)background-attachment:指定背景图像时滚动还是固定。
Fixed: 固定 scroll:滚动
(3)background属性简写:
background: #ffffff url("tree.png") no-repeat right top;
border: 5px solid red;
包含:
Margin-top
Margin-right
Margin-bottom
Margin-left
包含:
Padding-top
Padding-right
Padding-bottom
Padding-left


文字间距
Text-indent:指定文本第一行的缩进
Letter-spacing:指定文本中字符之间的间距
Line-height:指定行之间的间距
normal:文字正常显示
italic:文本以斜体显示

list-style: square inside url("sqpurple.gif");

默认样式和单一边框样式
在<tr>元素上使用:hover选择器,以突出显示鼠标悬停时的表格行
在<table>元素周围添加带有overflow-x:auto的容器元素,以实现响应式效果。
如果屏幕太小而无法显示全部内容,则响应式表格会显示水平滚动条。

<view class="content">
<form bindsubmit="formSubmit" bindreset="formReset">
<view class="section">
<view class="section_title">性别</view>
<radio-group name="sex">
<label><radio value="male" checked/>男</label>
<label><radio value="female" style="margin-left:20rpx;" />女</label>
</radio-group>
</view>
<view class="section">
<view class="section_title">选择目的地</view>
<checkbox-group name="region">
<label wx:for="{{regions}}">
<checkbox value="{{item.name}}" checked="{{item.checked}}" />
{{item.value}}
</label>
</checkbox-group>
</view>
<view class="section">
<view class="section_title">地区选择器</view>
<picker name="country" bindchange="bindPickerChange" value="{{index}}" range="{{countries}}">
<view>当前选择:{{countries[index]}}</view>
</picker>
</view>
<view class="section">
<view class="section_title">日期选择器</view>
<picker name="date" mode="date" value="{{date}}" start="2016-09-01" end="2018-09-01" bindchange="bindDateChange">
<view>当前选择:{{date}}</view>
</picker>
</view>
<view class="section">
<view class="section_title">时间选择器</view>
<picker name="time" mode="time" value="{{time}}" start="09:01" end="21:01" bindchange="bindTimeChange">
<view>当前选择:{{time}}</view>
</picker>
</view>
<view class="section">
<view class="section_title">其他建议</view>
<textarea name="suggest" style="height:100rpx;"
placeholder="建议" value="{{suggest}}"/>
</view>
<view class="btn-area">
<button formType="submit" type="primary">提交</button>
<button formType="reset">重置</button>
</view>
</form>
<view>
<view class="section">
<swiper indicator-dots="{{indicatorDots}}" vertical="{{vertical}}" autoplay="{{autoplay}}" interval="{{interval}}" duration="{{duration}}">
<block wx:for="{{background}}">
<swiper-item>
<image src="{{item}}"/>
</swiper-item>
</block>
</swiper>
</view>
<view class="btn-area">
<button type="default" bindtap="changeIndicatorDots">指示点</button>
<button type="default" bindtap="changeVertical">{{vertical?'水平指示点':'垂直指示点'}}</button>
<button type="default" bindtap="changeAutoplay">自动播放</button>
</view>
<slider bindchange="durationChange" value="{{duration}}" show-value min="500" max="2000" />
<view class="section_title">页面切换间隔</view>
<slider bindchange="intervalChange" value="{{interval}}" show-value min="2000" max="10000" />
<view class="section_title">滑动动画时长</view>
</view>
<view class="btn-area">
<view class="section_title">loading提示</view>
<view>
<loading hidden="{{hidden}}" bindtap="loadingtap">加载中,单击退出...</loading>
<button type="default" bindtap="loadingTap1">事件loading</button>
</view>
<view>
<loading hidden="{{hidden2}}">{{exit_time}}秒后退出...</loading>
<button type="default" bindtap="loadingTap2">定时loading</button>
</view>
</view>
<view class="btn-area">
<view class="section_title">toast提示</view>
<view>
<toast hidden="{{hidden}}" bindchange="toast1Change">默认提示信息,1.5秒后关闭</toast>
<button type="default" bindtap="toast1Tap">默认toast</button>
</view>
<view>
<toast hidden="{{hidden2}}" duration="3000" bindchange="toast2Change">提示信息,3秒后关闭</toast>
<button type="default" bindtap="toast2Tap">3秒关闭toast</button>
</view>
</view>
<view class="btn-area">
<view class="section_title">showtoast提示</view>
<button type="default" bindtap="showtoast1Tap">默认loading</button>
<button type="default" bindtap="showtoast2Tap">5秒关闭loading</button>
</view>
<view class="btn-area">
<view class="section_title">modal模式对话框</view>
<modal confirm-text="是" cancel-text="否" hidden="{{modalHidden}}" bindconfirm="modalConfirm" bindcancel="modalCancel">您是否真的要退出应用?</modal>
<modal title="请选择" hidden="{{modalHidden2}}" no-cancel bindconfirm="modalChange2" bindcancel="modalChange2">
<view class="section">
<view class="section_title">请输入姓名</view>
<input placeholder="姓名" />
</view>
<view class="section">
<view class="section_title">想去的国家</view>
<checkbox-group name="region">
<label wx:for="{{regions}}">
<checkbox value="{{item.name}}" checked="{{item.checked}}" />
{{item.value}}
</label>
</checkbox-group>
</view>
<view class="section">
<view class="section_title">出发日期</view>
<picker mode="date" name="date1" value="{{date}}" start="2016-09-01" end="2018-09-01" bindchange="bindDateChange">
<view>{{date}}</view>
</picker>
</view>
</modal>
<button type="default" bindtap="modalTap">退出应用</button>
<button type="default" bindtap="modalTap2">可接收用户输入的对话框</button>
</view>
<view class="section">
<view class="section_title">audio音频</view>
<text>
播放状态:{{audio.currentTime}}s / {{audio.duration}}s
</text>
<slider value="{{audio.percent}}" bindchange="sliderChange"></slider>
<button type="primary" bindtap="playClick">
<text wx:if="{{audio.isPlaying}}">点击暂停</text>
<text wx:else>点击播放</text>
</button>
</view>
<view class="section">
<view class="section_title">video视频</view>
<view style="text-align: center;">
<video id="myVideo" src="{{video_src}}" binderror="videoErrorCallback" controls></video>
</view>
</view>
<view class="section">
<view class="section_title">获取手机号码信息</view>
<input name="phone" placeholder="手机号码" bindinput="bindinput" />
<button type="primary" bindtap="phoneTap">查询</button>
<view wx:if="{{resCode == '200'}}">
<view>电话号码:{{phone}}</view>
<view>所属城市:{{city}}</view>
<view>运营商:{{supplier}}</view>
</view>
<view wx:if="{{errMsg != ''}}">
<view>错误信息:{{errNum}} - {{errMsg}}</view>
</view>
</view>
</view>
// pages/form/form.ts
const backgroundAudioManager = wx.getBackgroundAudioManager();
Page({
/**
* 页面的初始数据
*/
data: {
regions:[
{name: 'Europe', value: '欧洲'},
{name: 'america', value: '美洲', checked: 'true'},
{name: 'africa', value: '非洲'},
{name: 'other', value: '其他'}
],
countries: ['中国', '美国', '巴西', '日本', '英国'],
index: 0,
time: '8:00',
date: '2016-11-1',
suggest: '',
background: [
'../../images/gao_1.jpeg',
'../../images/gao_2.jpeg',
'../../images/gao_3.jpeg',
'../../images/gao_4.jpeg',
'../../images/gao_5.jpeg'
],
indicatorDots: true,
vertical: false,
autoplay: false,
interval: 3000,
duration: 1200,
hidden: true,
hidden2: true,
exit_time: 5,
modalHidden: true,
modalHidden2: true,
current:{
poster: 'https://kekedj.com/uploadfiles/2021-10/202110071015218437.png',
name: '雨蝶',
author: '李翊君',
src: 'https://www.xzmp3.com/down/4874bea05337.mp3'
},
audio:{
isPlaying: true,
currentTime: 0,
duration: 0,
isWarting: false
},
video_src: 'http://vjs.zencdn.net/v/oceans.mp4',
html: "",
phone: "",
city: "",
supplier: "",
errMsg: '',
resCode: '-2',
},
changeIndicatorDots: function(e: any){
this.setData({
indicatorDots: !this.data.indicatorDots
})
},
changeVertical: function(e: any){
this.setData({
vertical: !this.data.vertical
})
},
changeAutoplay: function(e: any){
this.setData({
autoplay: !this.data.autoplay
})
},
intervalChange: function(e: any){
this.setData({
interval: e.detail.value
})
},
durationChange: function(e: any){
this.setData({
duration: e.detail.value
})
},
formSubmit: function(e: any){
console.log('提交表单');
console.log(e.detail.value);
},
formReset: function(e: any){
console.log('form发生了reset事件');
},
bindPickerChange: function(e: any){
console.log('picker发送选择改变')
console.log(e.detail.value)
this.setData({
index: e.detail.value
})
},
bindDateChange: function(e: any){
console.log('日期发生改变')
console.log(e.detail.value)
this.setData({
date: e.detail.value
})
},
bindTimeChange: function(e: any){
console.log('时间发生改变')
console.log(e.detail.value)
this.setData({
time: e.detail.value
})
},
toast1Change: function(e: any){
this.setData({
hidden: true
});
console.log("第1个toast组件的change事件,这里可进行其他操作")
},
toast2Change: function(e: any){
this.setData({
hidden2: true
});
console.log("第2个toast组件的change事件,这里可进行其他操作")
},
toast1Tap: function(e: any){
this.setData({
hidden: false
})
},
toast2Tap: function(e: any){
this.setData({
hidden2: false
})
},
showtoast1Tap: function(){
wx.showToast({
title: "默认1.5秒关闭的loading消息提示框",
icon: "loading",
success: function(){
console.log("success回调!")
},
complete: function(){
console.log("complete回调!")
}
});
},
showtoast2Tap: function(){
wx.showToast({
title: "5秒关闭的loading消息提示框",
icon: "loading",
duration: 5000
});
},
modalTap: function(e: any){
this.setData({
modalHidden: false
})
},
modalConfirm: function(e: any){
this.setData({
modalHidden: true
}),
console.log(e)
},
modalCancel: function(e: any){
this.setData({
modalHidden: true
}),
console.log(e)
},
modalTap2: function(e: any){
this.setData({
modalHidden2: false
})
},
modalChange2: function(e: any){
this.setData({
modalHidden2: true
})
console.log(e);
},
audioAction: {
method: 'pause'
},
/**
* 生命周期函数--监听页面加载
*/
onLoad() {
var self = this;
// 定时器(每秒执行1次)
setInterval(function(){
var h2 = self.data.hidden2;
var t = self.data.exit_time;
if(!h2){
t = t - 1;
if(t > 0){
self.setData({
exit_time: t
})
}
}
}, 1000);
backgroundAudioManager.title = '测试音频';
backgroundAudioManager.epname = '雨蝶';
backgroundAudioManager.singer = '李翊君';
backgroundAudioManager.coverImgUrl = 'https://kekedj.com/uploadfiles/2021-10/202110071015218437.png';
backgroundAudioManager.src = 'https://www.xzmp3.com/down/4874bea05337.mp3';
// backgroundAudioManager.onPlay(() => {
// console.info('开始播放');
// });
// 进度监听
backgroundAudioManager.onTimeUpdate(() => {
self.setData({
'audio.currentTime': backgroundAudioManager.currentTime,
'audio.duration': backgroundAudioManager.duration,
'audio.percent': backgroundAudioManager.currentTime / backgroundAudioManager.duration * 100,
});
});
},
playClick: function(e: any){
if(backgroundAudioManager.paused){
backgroundAudioManager.play();
}else{
backgroundAudioManager.pause();
}
this.setData({
'audio.isPlaying': !this.data.audio.isPlaying
});
},
sliderChange: function(e: any){
var val = e.detail.value;
var second = backgroundAudioManager.duration * val / 100;
backgroundAudioManager.seek(second);
},
loadingtap: function(e: any){
this.setData({
hidden: true
})
},
loadingTap1: function(e: any){
this.setData({
hidden: false
})
},
loadingTap2: function(e: any){
this.setData({
hidden2: false,
exit_time: 5
})
var self = this
// 定时器(5秒后执行)
setTimeout(function(){
self.setData({
hidden2: true
})
}, 5000)
},
tapPlay: function(e: any){
backgroundAudioManager.play();
// backgroundAudioManager.onPlay(() => {
// console.log('开始播放')
// })
console.log('开始播放')
},
videoErrorCallback: function(e: any){
console.log(e.detail.errMsg)
},
bindinput: function(e: any){
this.setData({
phone: e.detail.value,
resCode: '-2'
});
},
phoneTap: function(e: any){
var phone = this.data.phone;
if(phone != null && phone != ''){
var self = this;
wx.request({
url: 'https://hcapi02.api.bdymkt.com/mobile',
data: {'mobile': phone},
header: {
'Content-Type': 'application/json;charset=UTF-8',
'X-Bce-Signature': 'AppCode/<自己的百度appcode信息>'
},
success: function(res){
console.info(res)
if(res.data.code == '200'){
self.setData({
errMsg: '',
resCode: res.data.code,
city: res.data.data.city,
supplier: res.data.data.isp
});
}else{
self.setData({
errMsg: res.data.message,
resCode: res.data.code
})
}
}
});
}
},
/**
* 生命周期函数--监听页面初次渲染完成
*/
onReady() {
},
/**
* 生命周期函数--监听页面显示
*/
onShow() {
},
/**
* 生命周期函数--监听页面隐藏
*/
onHide() {
},
/**
* 生命周期函数--监听页面卸载
*/
onUnload() {
},
/**
* 页面相关事件处理函数--监听用户下拉动作
*/
onPullDownRefresh() {
},
/**
* 页面上拉触底事件的处理函数
*/
onReachBottom() {
},
/**
* 用户点击右上角分享
*/
onShareAppMessage() {
}
})
我正在编写一个包含C扩展的gem。通常当我写一个gem时,我会遵循TDD的过程,我会写一个失败的规范,然后处理代码直到它通过,等等......在“ext/mygem/mygem.c”中我的C扩展和在gemspec的“扩展”中配置的有效extconf.rb,如何运行我的规范并仍然加载我的C扩展?当我更改C代码时,我需要采取哪些步骤来重新编译代码?这可能是个愚蠢的问题,但是从我的gem的开发源代码树中输入“bundleinstall”不会构建任何native扩展。当我手动运行rubyext/mygem/extconf.rb时,我确实得到了一个Makefile(在整个项目的根目录中),然后当
我已经在Sinatra上创建了应用程序,它代表了一个简单的API。我想在生产和开发上进行部署。我想在部署时选择,是开发还是生产,一些方法的逻辑应该改变,这取决于部署类型。是否有任何想法,如何完成以及解决此问题的一些示例。例子:我有代码get'/api/test'doreturn"Itisdev"end但是在部署到生产环境之后我想在运行/api/test之后看到ItisPROD如何实现? 最佳答案 根据SinatraDocumentation:EnvironmentscanbesetthroughtheRACK_ENVenvironm
我们的git存储库中目前有一个Gemfile。但是,有一个gem我只在我的环境中本地使用(我的团队不使用它)。为了使用它,我必须将它添加到我们的Gemfile中,但每次我checkout到我们的master/dev主分支时,由于与跟踪的gemfile冲突,我必须删除它。我想要的是类似Gemfile.local的东西,它将继承从Gemfile导入的gems,但也允许在那里导入新的gems以供使用只有我的机器。此文件将在.gitignore中被忽略。这可能吗? 最佳答案 设置BUNDLE_GEMFILE环境变量:BUNDLE_GEMFI
这似乎非常适得其反,因为太多的gem会在window上破裂。我一直在处理很多mysql和ruby-mysqlgem问题(gem本身发生段错误,一个名为UnixSocket的类显然在Windows机器上不能正常工作,等等)。我只是在浪费时间吗?我应该转向不同的脚本语言吗? 最佳答案 我在Windows上使用Ruby的经验很少,但是当我开始使用Ruby时,我是在Windows上,我的总体印象是它不是Windows原生系统。因此,在主要使用Windows多年之后,开始使用Ruby促使我切换回原来的系统Unix,这次是Linux。Rub
我正在玩HTML5视频并且在ERB中有以下片段:mp4视频从在我的开发环境中运行的服务器很好地流式传输到chrome。然而firefox显示带有海报图像的视频播放器,但带有一个大X。问题似乎是mongrel不确定ogv扩展的mime类型,并且只返回text/plain,如curl所示:$curl-Ihttp://0.0.0.0:3000/pr6.ogvHTTP/1.1200OKConnection:closeDate:Mon,19Apr201012:33:50GMTLast-Modified:Sun,18Apr201012:46:07GMTContent-Type:text/plain
无论您是想搭建桌面端、WEB端或者移动端APP应用,HOOPSPlatform组件都可以为您提供弹性的3D集成架构,同时,由工业领域3D技术专家组成的HOOPS技术团队也能为您提供技术支持服务。如果您的客户期望有一种在多个平台(桌面/WEB/APP,而且某些客户端是“瘦”客户端)快速、方便地将数据接入到3D应用系统的解决方案,并且当访问数据时,在各个平台上的性能和用户体验保持一致,HOOPSPlatform将帮助您完成。利用HOOPSPlatform,您可以开发在任何环境下的3D基础应用架构。HOOPSPlatform可以帮您打造3D创新型产品,HOOPSSDK包含的技术有:快速且准确的CAD
在应用开发中,有时候我们需要获取系统的设备信息,用于数据上报和行为分析。那在鸿蒙系统中,我们应该怎么去获取设备的系统信息呢,比如说获取手机的系统版本号、手机的制造商、手机型号等数据。1、获取方式这里分为两种情况,一种是设备信息的获取,一种是系统信息的获取。1.1、获取设备信息获取设备信息,鸿蒙的SDK包为我们提供了DeviceInfo类,通过该类的一些静态方法,可以获取设备信息,DeviceInfo类的包路径为:ohos.system.DeviceInfo.具体的方法如下:ModifierandTypeMethodDescriptionstatic StringgetAbiList()Obt
目录前言滤波电路科普主要分类实际情况单位的概念常用评价参数函数型滤波器简单分析滤波电路构成低通滤波器RC低通滤波器RL低通滤波器高通滤波器RC高通滤波器RL高通滤波器部分摘自《LC滤波器设计与制作》,侵权删。前言最近需要学习放大电路和滤波电路,但是由于只在之前做音乐频谱分析仪的时候简单了解过一点点运放,所以也是相当从零开始学习了。滤波电路科普主要分类滤波器:主要是从不同频率的成分中提取出特定频率的信号。有源滤波器:由RC元件与运算放大器组成的滤波器。可滤除某一次或多次谐波,最普通易于采用的无源滤波器结构是将电感与电容串联,可对主要次谐波(3、5、7)构成低阻抗旁路。无源滤波器:无源滤波器,又称
最近在学习CAN,记录一下,也供大家参考交流。推荐几个我觉得很好的CAN学习,本文也是在看了他们的好文之后做的笔记首先是瑞萨的CAN入门,真的通透;秀!靠这篇我竟然2天理解了CAN协议!实战STM32F4CAN!原文链接:https://blog.csdn.net/XiaoXiaoPengBo/article/details/116206252CAN详解(小白教程)原文链接:https://blog.csdn.net/xwwwj/article/details/105372234一篇易懂的CAN通讯协议指南1一篇易懂的CAN通讯协议指南1-知乎(zhihu.com)视频推荐CAN总线个人知识总
深度学习部署:Windows安装pycocotools报错解决方法1.pycocotools库的简介2.pycocotools安装的坑3.解决办法更多Ai资讯:公主号AiCharm本系列是作者在跑一些深度学习实例时,遇到的各种各样的问题及解决办法,希望能够帮助到大家。ERROR:Commanderroredoutwithexitstatus1:'D:\Anaconda3\python.exe'-u-c'importsys,setuptools,tokenize;sys.argv[0]='"'"'C:\\Users\\46653\\AppData\\Local\\Temp\\pip-instal