End of the first lesson: the front acquaintance

The establishment of a web page project need to create a folder in the folder will be CSS, js, HTML and pictures supplied in easy to manage different folders.

html consists of a large number of labels, tags and labels with a single dual-label, HTML consists of a head and the body of the head, the head is usually basic information about the content of the page, such as title, index information, we generally show parts of the body moiety; Here is the basic format;

<html>
  <head>
  </head>
  <body>
  </body>
</html>

 (Note: In order to prevent the emergence of Chinese garbled, usually choose to add in the head <meta charset = "utf-8")>, all tags and code section must be in English, or an error occurs)

 Just HTML content of the page, to make the page look good do also need to web content publishing, and this time they used CSS, CSS can quickly and easily to typeset pages, we can write the CSS styles directly in the HTML header such as ;

<head>
 <style type="text/css">
  HR {Color: Sienna;} 
  P {margin-left: 20px;} 
  body {background-Image: URL ( "Images / back40.gif");} 
</ head> You can use <style> tag in the document style sheet defines an inner header may be introduced from an external CSS file example:
</style>


<head> 
< linkthe rel = "this stylesheet" type = "text / CSS" the href = " mystyle.css" /> 
</ head> 
each page using the <link> tag linked to the style sheet. <link> tag in the head (of the document), the browser will read from the file mystyle.css style declaration, the format of the document according to it.
External introduced to pay attention to the absolute and relative paths:
Absolute path: refers to the full directory address file
relative path: refers to a file relative to the address of the current directory
if the page is not on the general use relative paths, because using an absolute path may result in the machine open the file does not show, and the relative path will not happen.

Guess you like

Origin www.cnblogs.com/Sunboy910/p/11179351.html