美文网首页
基本知识拾遗\备忘

基本知识拾遗\备忘

作者: iMark | 来源:发表于2016-09-28 08:37 被阅读15次
  • Note that it's important to have both opening and closing curly braces ({ and }) around each element's style. You also need to make sure your element's style is between the opening and closing style tags. Finally, be sure to add the semicolon to the end of each of your element's styles.

  • in the style declaration section (or in .CSS), a class/id starts with a period(.)/hash(#), when referring to them in HTML we must leave the ./# out

  • Remember that you can apply multiple classes to an element by separating each class with a space within its class attribute. For example: <img class="class1 class2">

  • a elements, also known as anchor elements, are used to link to content outside of the current page.

  • Sometimes you want to add a elements to your website before you know where they will link.
    This is also handy when you're changing the behavior of a link using jQuery, which we'll learn about later.
    Replace the value of your a element's href attribute with a #, also known as a hash symbol, to turn it into a dead link.

  • input 中使用占位符 <input type="text" placeholder="placeholder text here">

  • Forms commonly use checkboxes for questions that may have more than one answer.
    Checkboxes are a type of input
    Each of your checkboxes should be nested within its own label element.
    All related checkbox inputs should have the same name attribute.
    Here's an example of a checkbox:
    <label><input type="checkbox" name="personality"> Loving</label>

  • Applying multiple class attributes to a HTML element is done with a space between them like this:
    class="class1 class2"
    Note: It doesn't matter which order the classes are listed in the HTML element.
    However, the order of the class declarations in the <style> section are what is important. The second declaration will always take precedence over the first.

  • id 的优先级高于 class,inline style 的优先级高于 id

相关文章

网友评论

      本文标题:基本知识拾遗\备忘

      本文链接:https://www.haomeiwen.com/subject/reehyttx.html