首页 > 其他分享 >html5+css-06

html5+css-06

时间:2023-10-20 17:36:19浏览次数:37  
标签:box 06 color text nth html5 child type css

HTML5(最常用)

新增标签

语义化

header:头部

nav:导航

article:内容

section:定义文档某个区域

aside:侧边栏

footer:尾部

主要针对搜索引擎

可多次使用

在IE9中需要转化为块级标签

视频

audio:音频(.mp3)

video:视频(尽量使用.mp4)

新的表单

  • email

  • url

  • number

  • range

  • Date pickers (date, month, week, time, datetime, datetime-local)

  • search

  • tel

  • color

    限制输入的元素

新的表单属性

新的 form 属性:

  • autocomplete
  • novalidate

新的 input 属性:

  • autocomplete
  • autofocus
  • form
  • form overrides (formaction, formenctype, formmethod, formnovalidate, formtarget)
  • height 和 width
  • list
  • min, max 和 step
  • multiple :提交多个文件
  • pattern (regexp)
  • placeholder :提示文本
  • required :必须书写,不能为空

CSS3

属性选择器

input[type=text] {

color:pink;

}

只选择type=text文本框的input选取出来

input[type^=text] {

color:pink;

}

以text开头的

input[type$=text] {

color:pink;

}

以text结尾的

input[type*=text] {

color:pink;

}

包含text的

属性权重与类选择器相同,10

结构伪类选择器

E:first-child父元素中第一个E元素

ul li:first-child

E:last-child父元素中最后一个E元素

E:nth-child(n)父元素中一个或多个E元素

ul li:nth-child(2)第二个

ul li:nth-child(even)偶数选出来

ul li:nth-child(odd)奇数选出来

ul li:nth-child(n)所有

ul li:nth-child(2n)偶数

……

n+5:从第5个开始

-n+5:前5个

E:first-of-type:指定类型E的第一个

E:last-of-type

E:nth-of-type(n)

伪元素选择器

权重为1

::before元素内部的前面插入内容

::after后面

语法:element::before{}

必须具有content属性

属行内元素

清楚浮动

第一种

.clearfix::after {

content: '';

display: block;

height: 0;

clear: both;

visibility: hidden;

}

第二种

.clearfix::before,

.clearfix::after {

content: '';

display: table;

}

.clearfix::after {

clear: both;

}

盒子模型

margin和padding会撑大盒子

box-sizing:content-box|border-box

content-box(默认),会撑大

border-box则不会撑大

照片模糊处理

filter:burl(5px);数值越大越模糊

calc函数

进行计算

子盒子永远比父盒子小30px

width:clac(100%-30px);

过渡

transition:属性 花费时间(0.5s) 运动曲线(ease) 何时开始(默认0)

div {

position: relative;

width: 400px;

height: 420px;

border: 5px solid orange;

background-color: pink;

box-sizing: border-box;

transition: width 1s;

}

div:hover {

width: 800px;

}

多个属性

div {

position: relative;

width: 400px;

height: 420px;

border: 5px solid orange;

background-color: pink;

box-sizing: border-box;

transition: all 1s;

}

div:hover {

width: 800px;

height: 800px;

background-color: blue;

}

谁做过渡给谁加transition

标签:box,06,color,text,nth,html5,child,type,css
From: https://www.cnblogs.com/Z2201210269/p/17777590.html

相关文章

  • CSS-05
    精灵图为了减少服务器接收和发送请求的的次数background-position一般情况下,向上向左均是负的background:url(images/icons.png)no-repeat-1103px-333px;字体图标展示为图标,本质为文字结构样式简单的使用字体图标,复杂的使用精灵图字体图标追加(.json)CSS三角.box2{......
  • CSS 实现鼠标悬浮边框线动画效果
    一、transitionCSStransition(过渡效果)详解CSS中提供了5个有关过渡的属性,如下所示:transition-property:设置元素中参与过渡的属性;transition-duration:设置元素过渡的持续时间;transition-timing-function:设置元素过渡的动画类型;transition-delay:设置过渡效果延迟的时间,默......
  • CSS3属性详解(一)文本 盒模型中的 box-ssize 属性 处理兼容性问题:私有前缀 边框 背景属
    CSS3是用于为HTML文档添加样式和布局的最新版本的层叠样式表(CascadingStyleSheets)。下面是一些常用的CSS3属性及其详细解释:border-radius:设置元素的边框圆角的半径。可以使用四个值设置四个不同的圆角半径,也可以只使用一个值来设置统一的圆角。box-shadow:创建一个元素的阴影效果......
  • HTML5+CSS3+移动web 前端开发入门笔记(一)
    千古前端图文教程千古前端图文教程git的使用Git是一个分布式版本控制系统,它的作用主要包括以下几个方面:版本管理:Git可以跟踪文件的修改历史,记录每次提交的内容、时间和作者等信息。通过Git,开发人员可以轻松地查看和比较不同版本之间的差异,回滚到历史版本或者创建新的分支。多人协作......
  • “SecurityError: Error #2060: 安全沙箱冲突:ExternalInterface 调用者xxx不能访问xx
    今天,我把我的FlashPlayer插件做了一下升级,变为了10.0.42.34的版本。然后发现之前能够在本地正常运行的DVF,今天运行起来却抛出了异常信息。提示信息如下:SecurityError:Error#2060:安全沙箱冲突:ExternalInterface调用者file://D:\study\flex\service\bin\rainbowX.swf......
  • 利用 CSS 的 clip-path 属性快速画三角形、气泡框
    clip-path 结合polygon函数,可以快速切出一个三角形、气泡框。a.三角形有三个顶点,因此 polygon 需要传三个参数,每个参数是顶点的x和y轴位置百分比:#triangle-1{-webkit-clip-path:polygon(50%0,100%100%,0100%);clip-path:polygon(50%0,100%100%,......
  • CSS水平垂直居中
    使用flex布局<divclass="content"> <divclass="box"> </div></div>.content{height:100vh;display:flex;justify-content:center;align-items:center;}【注意】若垂直居中失效,是因为content盒子缺少高度,height:100%无法撑开盒子......
  • 使用CSS的cross-fade()实现基于url的网页背景图半透明显示
     参考链接:https://www.zhangxinxu.com/wordpress/2020/07/css-cross-fade-background-image-opacity/引子在开发过程中,碰到了一个比较特别的情况,就是使用url()背景图像,同时又希望background-image背景图片是半透明的,作为网页的半透明背景图,这时候使用opacity,如果使用某一个大......
  • css元素水平垂直居中
    1、单行文字的处理<html><head><style>/*要点,设置行高和DIV的行高一行*/#div{background-color:antiquewhite;height:100px;line-height:100px;text-alig......
  • abc206
    C-Swappable171数组中不相等的数对数量D-KAIBUNsyo879每次操作可以把数组中等于\(x\)的数全变成\(y\),问变成回文数组至少需要几次操作简单的不错的并查集模拟题#include<bits/stdc++.h>usingnamespacestd;constintN=2e5+5;intn,a[N],p[N];intget......