2021-05-26 Day01-html标签

***html标签

块级元素
1.div容器
	<div></div>
2.p段落元素
	<p></p>
	垂直方向有段落间距
3.标题元素
	<h1></h1>一级标题
	<h2></h2>二级标题
	<h3></h3>三级标题
	<h4></h4>四级标题
	<h5></h5>五级标题
	<h6></h6>六级标题
	h1字号最大,垂直方向有间距。h1在页面中只能出现一次
4.列表
	- 无序列表
		<ul type="square">
			<li>列表项</li>
			<li>列表项</li>
			<li>列表项</li>
			<li>列表项</li>
		</ul>
		type="disc"实心圆
		type="circle"空心圆
		type="square"实心方块
	- 有序列表
		<ol type="I" start="">
			<li>列表项</li>
			<li>列表项</li>
			<li>列表项</li>
			<li>列表项</li>
		</ol>
		type="1"数字
		type="a"小写字母
		type="A"大写字母
		type="i"小写罗马数字
		type="I"大写罗马数字
		start=""代表从几开始数起
	- 自定义列表
		<dl>
			<dt>千锋教育</dt>
			<dd>知名IT培训机构,培训前端、java、UI等一些列课程</dd>
		</dl>
行内元素
1.加粗
	<b></b>
	<strong></strong> 有强调的作用
2.倾斜
	<i></i>
	<em></em> 有强调的作用
3.下划线
	<u></u>
4.删除线
	<s></s>
	<del></del>
5.span
	一段文本中改变几个文字的样式,而且保证前后不换行
6.上标
	<sup></sup>
7.下标
	<sub></sub>
8.文本换行
	<br/>
	编辑器中无论有多少个空格和回车、缩进都会被浏览器解析成一个空格
9.img图片
	<img src="" alt="" title=""/>
		src=""路径
		alt=""图片加载失败时显示的文本
		title=""鼠标移入时显示的文本
	路径:绝对路径和相对路径
		同级文件:直接写文件名.后缀
		子集:先找到同级文件夹/引入的文件
		父集:返回上一级../
	***面试题:alt和title的区别
10.超链接
	<a href="" target="">跳转到百度</a>
		href=""路径
		target="_self" 默认值,在当前页面打开
		target="_blank" 在新的标签页中打开
	利用a标签打开一张图片
	<a href="img/img14.jpg">
		打开图片
	</a>

转义字符

空格:&nbsp;
小于号:&lt;
大于号:&gt;
版权标识:&copy;
注册:&reg;
引号:&quot;
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
要在 `uni-calendar` 中显示节假日,可以通过自定义日历的方式来实现。具体步骤如下: 1. 在 `uni-calendar` 中设置自定义日历模板。 在 `uni-calendar` 中,可以通过 `template` 属性来设置自定义日历模板,例如: ```html <uni-calendar :template="calendarTemplate"></uni-calendar> ``` 其中,`calendarTemplate` 为自定义日历模板的名称。 2. 编写自定义日历模板。 在 `template` 中,可以使用 `slot` 标签引入自定义的日历模板,例如: ```html <template name="calendarTemplate"> <div class="calendar-container"> <div class="calendar-header"> <span class="calendar-title">{{title}}</span> </div> <div class="calendar-body"> <div class="calendar-weekdays"> <span v-for="weekday in weekdays">{{weekday}}</span> </div> <div class="calendar-days"> <slot name="calendar-days"></slot> </div> </div> </div> </template> ``` 在自定义日历模板中,可以使用 `slot` 标签占位日历的日期部分,例如: ```html <template> <div class="calendar-days"> <div v-for="day in days" :class="{'calendar-today': day.isToday, 'calendar-holiday': day.isHoliday}"> <span>{{day.day}}</span> <div>{{day.holiday}}</div> </div> </div> </template> ``` 在上述代码中,通过 `v-for` 循环遍历日期数组 `days`,并根据日期的一些属性来设置样式。其中,`day.isToday` 判断是否为当天日期,`day.isHoliday` 判断是否为节假日日期,`day.holiday` 为节假日名称。 3. 在组件中获取节假日数据。 在组件中,可以通过第三方插件获取节假日数据,并将数据传递给自定义日历模板。例如使用 `lunar-calendar` 插件获取节假日数据: ```js import LunarCalendar from 'lunar-calendar'; export default { data() { return { holidays: [] // 节假日数据 } }, methods: { getHolidayData(year, month) { let days = []; for (let i = 1; i <= 31; i++) { let solar = LunarCalendar.solar2lunar(year, month, i); let holiday = solar.Term || solar.lunarFestival || solar.solarFestival || ''; days.push({ day: i, isHoliday: holiday !== '', holiday: holiday }); } this.holidays = days; } }, mounted() { let now = new Date(); this.getHolidayData(now.getFullYear(), now.getMonth() + 1); } } ``` 在上述代码中,通过 `LunarCalendar.solar2lunar` 方法获取指定日期的农历信息和节假日信息,并将数据保存到 `holidays` 数组中。 4. 在自定义日历模板中显示节假日信息。 在自定义日历模板中,可以通过 `v-bind` 或 `v-for` 指令将节假日数据传递到日历日期部分。例如: ```html <template> <div class="calendar-days"> <div v-for="(day, index) in days" :class="{'calendar-today': day.isToday, 'calendar-holiday': day.isHoliday}"> <span>{{day.day}}</span> <div v-if="day.isHoliday">{{day.holiday}}</div> </div> </div> </template> ``` 在上述代码中,通过 `v-if` 判断当前日期是否为节假日日期,如果是则显示节假日名称。 以上就是在 `uni-calendar` 中显示节假日的基本步骤,具体实现还需要根据项目的实际情况进行调整。

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

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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值