前端面試題(二)

  • html 元素有哪些(包括 H5)

    塊級元素:
       head
       meat 
       title
       style
       body
       header
       section
       fotter  
       article
       aside
       nav
       menu
       address
       caption
       div
       dd
       dt
       dl
       form
       h1 ~ h6
       hr
       table
       li
       ui
       ol
       td 
       th
       tr
     
       行內元素
       a
       abbr
       b
       br
       code
       em
       i
       img
       span
       input
       textarea
       等等.........

  • css3 有哪些新增的特性

    • 邊框
      border-radius
      box-shadow
      border-image
    • 背景
      background-size
      background_origin
      background-clip
    • 漸變
      linear-gradient
      radial-gradient
    • 文本效果
      word-break
      word-wrap
      text-overflow
      text-shadow
      text-wrap
      text-outline
      text-justify
    • 轉換
      transform
      transform-origin
      translate(x,y)
      translateX(n)
      translateY(n)
      rotate(angle)
      scale(n)
      scaleX(n)
      scaleY(n)
      rotate(angle)
      transition
      animation

  • 寫一個方法去掉字符串中的空格

    此處最好最方便的方法即是正則表達式了css

    var trim = function(str){
           return str.replace(/\s*/g,"");
       }
       
       str.replace(/\s*/g,""); //去除字符串內全部的空格
       str.replace(/^\s*|\s*$/g,""); //去除字符串內兩頭的空格
       str.replace(/^\s*/,""); //去除字符串內左側的空格
       str.replace(/(\s*$)/g,""); //去除字符串內右側的空格

面試題摘自 Githubhtml

相關文章
相關標籤/搜索