web前端开发面试题(二)

前端面试题第二天

一、html部分

html的元素(包含H5)

块元素:

div p h1-h6 ol ul li table tbody td tr thead dl dt dd

行内块元素:

img input

行内元素:

span button br a  i em

H5新增元素

section article audio video hearder nav footer small

二、 css部分

CSS3新增特性

transform           -- 2D 3D 变换
rotate()		-- 旋转
scale()			-- 缩放
skew()			-- 倾斜
translate()		-- 平移
animation			-- 自定义动画
@Keyframes		-- 动画规则
transition			--过渡动画
box-sizing			-- 盒子组成
background-size cover/can...	-- 背景图大小
background_origin 			-- 背景图片的定位区域
background-clip 			-- 背景图片的绘制区域
outline			--点击外边距
background-image: 			-- 背景图
linear-gradient 			-- 线性渐变
radial-gradient 			-- 径向渐变
opacity			-- 透明度
text-shadow			--文字阴影
border-shadow			--边框阴影
text-overflow			-- 文字超出省略号
white-space				-- 换行
border-radius			-- 边框圆角
@media			-- 媒体查询
    
补充新增css3伪类:
:after 在元素之前添加内容,也可以用来做清除浮动。
:before 在元素之后添加内容。
:enabled 选择可用的表单元素。
:disabled 控制表单控件的禁用状态。
:checked 单选框或复选框被选中。

三、 js部分

去掉字符串中的空格

写一个方法去掉字符串中的空格,要求传入不同的类型分别能去掉前、后、前后、中间的空格

最简单的方法:

​ 使用split()函数

split() 方法用于把一个字符串分割成字符串数组。

语法:

字符串.split(" ")

例:

<script>
        var str = 'web chicken -- CSDN'
		// 字符串切割
        var new_str = str.split(" ")
        // 数组变字符串
        new_str = new_str.join("")
        console.log(new_str)
    </script>

你可能感兴趣的:(web前端,css,js,js,css,html,html5,javascript)