HTML and CSS

HTML and CSS basis

  1. different classes and IDs
    • Style selector is used to describe a class group of elements, different from the class selector selector id, class can be used in a plurality of elements.
  2. HTML elements elements
    • All of the code tags (end tag) from the start tag (start tag) to the end.
    • demo:
    <title>peculiarly</title>
  3. What are tags?
    • The basic structure of an HTML document includes tags, which surround content and apply meaning to it.
    • demo: opening tag <head> and closing tag </head>
  4. What are forms?
    • <form> Tag creates an HTML form for user input.
  5. What is a div?
    • <div> Partitions can be defined in the document or section (division / section).
  6. What is the difference between "pixels" and "ems"?
    • px pixels (Pixel), the relative length unit. px is relative to the screen resolution of the display.
      1. IE can not adjust the font size that use px as a unit;
    • em is the relative length unit with respect to the current font size of the text objects. If the current line of text to the font size is not artificially set, with respect to the browser's default font size.
      1. Value em is not fixed;
      2. em inherit the font size of the parent element.
  7. CSS Inheritance
    • inherit
    • demo:
    div{color: red;} .extra div{color: inderit;}
  8. Two kinds of CSS properties to move page elements
    • float
    • position
  9. Three ways to insert CSS style sheet
    • External style sheet (External style sheet)
      • demo:
      <head>
      <link rel="stylesheet" type="text/css" href="style.css">
      </head>
    • Internal style sheet (Internal style sheet)
      • demo:
      <head>
      <style>
          p {
              color: blue;
              margin-right: 20px;
              }
      </style>
      </head>
    • Inline style (Inline style)

      • deom:
      <p style="color: blue; margin-right: 20px;">A paragraph.</p>

Guess you like

Origin www.cnblogs.com/lonelyWMW/p/11669167.html