Some basic knowledge of HTML

Disclaimer: This article is a blogger original article, follow the CC 4.0 BY-SA copyright agreement, reproduced, please attach the original source link and this statement.
This link: https://blog.csdn.net/weixin_43701019/article/details/98948318

- Personal Notes

Web pages are written in HTML can, we can on the page, and then check the right will be the source, so we want to copy someone else's blog, will be forwarded directly in the copy on the line.

  • The basic syntax
    usually are HTML <element name> contents </ element name> so constituted, the following common elements, like a bit of code inside the key.
    Here Insert Picture Description

  • Links in general by the <a>label definitions, href attribute is used to specify points to the page URL, name attribute is within the page markup

    //这个是内部的链接
    <a href="#type1" >定位按钮</a><br>
    <a name="type1">定位位置</a>
    //这个是外部的链接,也就是超级链接 
     <a href="https://blog.csdn.net/weixin_43701019/article/details/98948318" >   自己定义 </a>
    
  • <br>Blank line

  • The style attribute can be used to define the style of the text page, such as font size, color, spacing, alignment, etc.
    add a style attribute as elements, attributes are usually placed at the beginning of the HTML element tag.
    Such as<h1 style="color:#20b2aa;">有颜色的标题</h1>

  • Similar properties id and class attributes usage, is to find, locate elements, or elements to define the purpose of the id and class - those who set the style for the element. But id attribute identifies a unique element, and class used to identify a series of elements.

  • Property class applications

       <html>
          	<head>
             	<meta charset="utf-8"> 
               	<title>      </title>
               	<style>
               	.book {
               	float: left;/*控制元素浮动*/
               	margin: 5px;/*外边距为5像素*/
               	padding: 15px;/*内边距为15像素*/
             	width: 350px; /*宽度为350像素*/
               	height: 240px;/*高度为240像素*/
               	border: 3px solid #20b2aa;/*边框为3像素*/
               	} 
               	</style>
          	 </head>
           	<body>
           		<div class="book">
           			<p></p>
           		</div>
       	</body>
     </html>
    

    Here Insert Picture Description

  • id application
    id is just similar to each part of a class name and good management of inside, similar to a folder inside text, png, etc., we built in this folder folder, these classified into these folders, we will give a folder named, named the equivalent of starting id.

Guess you like

Origin blog.csdn.net/weixin_43701019/article/details/98948318