HTML学习笔记(一)

1、

打开VScode→文件→新建→另存为选择保存为html文件

快速补全html代码:

在代码界面输入!,按TAB键

 

2、

<table border="10" cellpadding="10" cellspacing="10">

<table border="1" cellpadding="10" cellspacing="10">

<table border="10" cellpadding="1" cellspacing="10">

<table border="10" cellpadding="10" cellspacing="1">


 

3、

<embed></embed>使用align="center"并不能使之居中

只能在外面套一层div 并加上属性style="text-align: center;"来使之居中

 

4、

position: absolute 是找上层非默认static的父元素作为基准的。如果没有就默认是<body>

所以上层元素想要作为基准的话最好用 position:relative 定一下位

 

5、垂直居中

<img>的垂直居中,在上层元素注明了行高的情况下可以使用

<div style="text-align: center; width: 500px;height:200px; line-height:200px; border: green solid 1px;">
   <img alt="" src="https://www.baidu.com/img/baidu_jgylogo3.gif" style="display: inline-block; vertical-align: middle;" />
</div>

但是只能整个居中水平也居中

 

6、ul横向排列

总之,使其横向排列的最需要的是:

   <ul>标签的主要样式为display:block;

   <li>的主要样式为display:inline-block,float:left,list-style:none;

 

 

 

  • 1
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值