05 2019 档案
摘要:实现效果 效果1:点击标签跳转到页面的指定位置 效果2:当页面滑动到相应位置时导航栏样式改变 效果如下: 方法: 使用scrollTop进行定位和跳转。 首先,在HTML中给跳转到的结点设置id 然后在js中设置点击事件,点击导航栏的按钮使窗口跳转指定位置。 scrollTop() 方法返回或设置匹
阅读全文
摘要:图片居中 方法1.将放置图片的容器的布局改为 display: table-cell; text-align: center; 可以使容器内的元素均居中显示。效果如下: 如果需要水平垂直居中,添加 display: table-cell; text-align: center; vertical-a
阅读全文
摘要:将文字或者其他元素和图片重叠 1.上层为块级元素,效果图: 设置上边元素的定位为 再根据相对图片的位置调整right、left、top和bottom值 2.当上层元素是文字时,效果图: 可设置文本框的区域大小,然后将图片设置为背景
阅读全文
摘要:Given an array where elements are sorted in ascending order, convert it to a height balanced BST. For this problem, a height-balanced binary tree is d
阅读全文
摘要:Given a binary tree, return the zigzag level order traversal of its nodes' values. (ie, from left to right, then right to left for the next level and
阅读全文
摘要:问题:Failed to execute 'appendChild' on 'Node': parameter 1 is not of type 'Node' 原因:appendChild的参数为node节点,导致这样的问题说明当前的参数不是node,有可能是字符串。 例如: 这时dom是字符串 解
阅读全文
摘要:Given two binary trees, write a function to check if they are the same or not. Two binary trees are considered the same if they are structurally ident
阅读全文
摘要:Given n, how many structurally unique BST's (binary search trees) that store values 1 ... n? Example:
阅读全文
摘要:Given an integer n, generate all structurally unique BST's (binary search trees) that store values 1 ... n. Example:
阅读全文
摘要:Given a binary tree, return the inorder traversal of its nodes' values. Example: Follow up: Recursive solution is trivial, could you do it iteratively
阅读全文
摘要:Given a string containing only digits, restore it by returning all possible valid IP address combinations. Example: 使用标志k记录当前所得的子字符串个数。当满足有4个子字符串并且s中的
阅读全文
摘要:A message containing letters from A-Z is being encoded to numbers using the following mapping: Given a non-empty string containing only digits, determ
阅读全文
摘要:white-space 默认属性 normal:忽略掉文本中多余的空格和回车符。 no-wrap:忽略掉文本中多余的空格和回车符,并且文本在一行中显示。 pre:不忽略文本中多余的空格和回车符。但是文本只在回车符处进行换行,如果没有回车符,文本将会在一行中显示。 pre-wrap:不忽略空格和回车符
阅读全文
摘要:方法一: 水平居中 text-align 应用于块级元素的文本水平居中 text-align=left; 左对齐 text-align=right; 右对齐 text-align=justify; 两端对齐 text-align=center; 水平居中 将块级元素中的内联元素设置为水平居中,并不能
阅读全文
摘要:The gray code is a binary numeral system where two successive values differ in only one bit. Given a non-negative integer n representing the total num
阅读全文
摘要:80. Given a sorted array nums, remove the duplicates in-place such that duplicates appeared at most twice and return the new length. Do not allocate e
阅读全文

浙公网安备 33010602011771号