web 前端入门

一切从零开始,最基础的前端入门知识!
开发一个网页所需要的最少的知识,剩下的,在实践中学习,在动手中积累!

学习资料

  1. 网站 w3school
  2. 网站 MDN 开发者网络
  3. 视频教程 慕课网
  4. 互动教程 codeCademy

开发工具

  1. 编辑器 sublimeText VSCode webStorm
  2. 在线编辑器 codePen
  3. chrome 开发者工具 devTools 文档

从 Hello World 开始

<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Document</title>
</head>
<body>
    Hello World
</body>
</html>

标签

由尖括号包围的关键词,如 <body>
开始标签 <body> 结束标签 </body>
也有元素不能包含其他元素,没有结束标签,如 <img src="test.jpg">
常用标签: body, div, h1~h6, p, span, strong, em ul, li, input, button, a, talbe, img ....

标签实在太多,不一一列举,可以通过 w3school 查询 标签查询

属性

<input required="required"> 其中 required="required" 为属性
<p class="hello text"> Hello </p> 其中 class="hello text" 为属性

注释

<body>
    <!-- This is comment text -->
   <p> Hello World </p>
</body>

常用的 HTML 标签

布局容器: <div> ... </div> 是一个块级元素,常用于组合其他 HTML 元素,本身无实在意义

标题:<h1> ~ <h6> <h1> 是最大的标题, <h6> 是最小的标题。

<h1>This is a heading</h1>
<h2>This is a heading</h2>
<h3>This is a heading</h3>

段落:<p> content </p>
超链接: <a href="http://xxx. com">Link text</a>
图片:<img src="ghost.gif" alt="The ghost">
表格:

<table>
<tr>
  <th>Heading</th>
  <th>Another Heading</th>
</tr>
<tr>
  <td>row 1, cell 1</td>
  <td>row 1, cell 2</td>
</tr>
<tr>
  <td>row 2, cell 1</td>
  <td>row 2, cell 2</td>
</tr>
</table>

无序列表:

<ul>
  <li>Coffee</li>
  <li>Milk</li>
</ul>

有序列表:

<ol>
  <li>Coffee</li>
  <li>Milk</li>
</ol>

表单:

<form action="action_page.php">
  <input type="text" name="firstname" value="Mickey">
  <input type="text" name="lastname" value="Mouse">
  <input type="radio" name="sex" value="male" checked>Male
  <br>
  <input type="radio" name="sex" value="female">Female
  <input type="submit" value="Submit"></fieldset>
</form> 

了解DOM

什么是 DOM ?
DOM: Document Object Model, 文档对象模型。

  1. 是 HTML 和 XML 文档的编程接口;
  2. 对文档的结构化的表述;

例如,html 源码如下:

<body>
    <div class="section">
        <div class="nav content-header">
            <h1 class="nav-item title">This is a title</h1>
            <p> Hello </p>
        </div>
        <p> Hello </p>
    </div>
    <div> <p> Let it go </p> </div>
</body>

DOM 结构:

body   
│
└───div
│   │   p
│   │
│   └───div
│       │   h1
│       │   p
│   
└───div
    │   p

接下来,请看下一篇博客 css 基础介绍

最后编辑于
©著作权归作者所有,转载或内容合作请联系作者
平台声明:文章内容(如有图片或视频亦包括在内)由作者上传并发布,文章内容仅代表作者本人观点,简书系信息发布平台,仅提供信息存储服务。

推荐阅读更多精彩内容

  • web前端基础笔记 学习web前端开发基础技术需要掌握:HTML、CSS、JavaScript语言。下面我们就来了...
    Z314阅读 1,878评论 0 0
  • 一、什么是HTML5 HTML:一种超文本标记语言,一种纯文本类型的语言。该语言编写的文件,一般用html和htm...
    我是渐渐呀阅读 3,890评论 0 0
  • 写在前面 昨天工作室完成了第二次招新,感觉工作室又加入了新鲜的血液。很高兴这次有更多的小伙伴选择了Web前端方向,...
    年少有van阅读 4,099评论 2 2
  • 学习HTML的最佳网站没有之一http://www.w3school.com.cn/html/ 关于HTML/HT...
    Amyyy_阅读 6,575评论 0 16
  • 做一个有吸引力的人 吸引力是一样有趣的东西。 除了外表起到一些影响,你的想法和你的行为是吸引力的主要来源。经由对的...
    川哥在路上阅读 2,047评论 0 0