Home Web Front-end HTML Tutorial web前端入门:一小时学会写页面 - 空酷狗

web前端入门:一小时学会写页面 - 空酷狗

May 20, 2016 pm 01:49 PM

一小时学会写页面

作为一个懒癌晚期患者,总是习惯找各种简单的解决问题的方法,也习惯性把问题简单化,所以今天想分享给大家简单的web前端入门方法。
既然题目已经定了一个小时那么废话就不多说了,计时开始

1.什么是前端

简单来说,前端就是做网页(大神勿喷,本文一切从简)

2.前端技术

html,是首字母缩写,具体意义请百度,大家要记住“t”代表textok你们没有想错,text就是文本文件text,好了准备工作做好了,现在开始做网页

3.我们的第一个网页

请身边有电脑的小伙伴和我一起开始,在桌面鼠标右击,创建一个txt文件,命名为index把后缀修改为html,可能会跳出一个弹出框点击确定~点击这个文件大部分人应该会在浏览器打开吧,如果是那就对了,然后这个页面可以不关掉接着走下一步

4.添加内容

右键点击刚才建立的文件,我们可以直接用记事本打开,ok现在在文档里面输入hello world~刷新刚才用浏览器打开的那个页面~不出意外hello world应该在了

5.页面结构

在文档中输入以下代码

    

    

Document

6.代码说明

这行代码位于文档的第一行,用于声明文档类型

1、对于 HTML 4.01 中有三种 声明,在HTML5中只有以上一种声明
2声明不是HTML标签

...

html标签内包裹页面文档的整个内容
1、 告诉浏览器这个网页是英文网站
2lang="zh"表示该网站是中文网站
3lang="en"可以省略

....

head标签内可以放入描述文档的各种属性和信息的标签例如<script></script>

meta元素提供页面的信息
1meta里面放入charset="UTF-8"说明页面编码格式是UTF-8
2meta里面放入name="keywords" content="html, css, JavaScript是描述文档的关键字

Document

定义文档的标题,这个你可以根据你的需求命名

....

body标签放入文档的所有内容比如插入一张图片,写一段说明,放个视频什么的都是放在body

7、实战页面

    

    

<span style="font-family: 宋体;">百度一下,你就知道</span><span style="font-family: Calibri;"></span>

    

        .header{text-align:right;width:100%;}

        .header a{color:#333;margin-left:20px;font-size:13px;font-weight:bold;}

        .logo{text-align:center;}

        .logo img{width:270px;height:129px;}

        .search{text-align:center;}

        .search input{width:539px;height:34px;border:1px solid #b6b6b6;}

        .search button{width:100px;height:38px;background:#3385ff;border:1px solid #3385ff;color:#fff;cursor:pointer;}

    

    

        糯米

        新闻

        hao123

        地图

        视频

    

    

        

        

    

这段代码我简单的写了一下百度的首页(虽然和真正的百度首页差的有点多),主要是为了说明如何添加页面内容,其中style标签内添加了一部分样式文件,具体含义留在后面继续为大家讲解。

 

Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn

Hot AI Tools

Undresser.AI Undress

Undresser.AI Undress

AI-powered app for creating realistic nude photos

AI Clothes Remover

AI Clothes Remover

Online AI tool for removing clothes from photos.

Undress AI Tool

Undress AI Tool

Undress images for free

Clothoff.io

Clothoff.io

AI clothes remover

Video Face Swap

Video Face Swap

Swap faces in any video effortlessly with our completely free AI face swap tool!

Hot Tools

Notepad++7.3.1

Notepad++7.3.1

Easy-to-use and free code editor

SublimeText3 Chinese version

SublimeText3 Chinese version

Chinese version, very easy to use

Zend Studio 13.0.1

Zend Studio 13.0.1

Powerful PHP integrated development environment

Dreamweaver CS6

Dreamweaver CS6

Visual web development tools

SublimeText3 Mac version

SublimeText3 Mac version

God-level code editing software (SublimeText3)

Is HTML easy to learn for beginners? Is HTML easy to learn for beginners? Apr 07, 2025 am 12:11 AM

HTML is suitable for beginners because it is simple and easy to learn and can quickly see results. 1) The learning curve of HTML is smooth and easy to get started. 2) Just master the basic tags to start creating web pages. 3) High flexibility and can be used in combination with CSS and JavaScript. 4) Rich learning resources and modern tools support the learning process.

The Roles of HTML, CSS, and JavaScript: Core Responsibilities The Roles of HTML, CSS, and JavaScript: Core Responsibilities Apr 08, 2025 pm 07:05 PM

HTML defines the web structure, CSS is responsible for style and layout, and JavaScript gives dynamic interaction. The three perform their duties in web development and jointly build a colorful website.

Understanding HTML, CSS, and JavaScript: A Beginner's Guide Understanding HTML, CSS, and JavaScript: A Beginner's Guide Apr 12, 2025 am 12:02 AM

WebdevelopmentreliesonHTML,CSS,andJavaScript:1)HTMLstructurescontent,2)CSSstylesit,and3)JavaScriptaddsinteractivity,formingthebasisofmodernwebexperiences.

What is an example of a starting tag in HTML? What is an example of a starting tag in HTML? Apr 06, 2025 am 12:04 AM

AnexampleofastartingtaginHTMLis,whichbeginsaparagraph.StartingtagsareessentialinHTMLastheyinitiateelements,definetheirtypes,andarecrucialforstructuringwebpagesandconstructingtheDOM.

Gitee Pages static website deployment failed: How to troubleshoot and resolve single file 404 errors? Gitee Pages static website deployment failed: How to troubleshoot and resolve single file 404 errors? Apr 04, 2025 pm 11:54 PM

GiteePages static website deployment failed: 404 error troubleshooting and resolution when using Gitee...

How to use CSS3 and JavaScript to achieve the effect of scattering and enlarging the surrounding pictures after clicking? How to use CSS3 and JavaScript to achieve the effect of scattering and enlarging the surrounding pictures after clicking? Apr 05, 2025 am 06:15 AM

To achieve the effect of scattering and enlarging the surrounding images after clicking on the image, many web designs need to achieve an interactive effect: click on a certain image to make the surrounding...

How to implement adaptive layout of Y-axis position in web annotation? How to implement adaptive layout of Y-axis position in web annotation? Apr 04, 2025 pm 11:30 PM

The Y-axis position adaptive algorithm for web annotation function This article will explore how to implement annotation functions similar to Word documents, especially how to deal with the interval between annotations...

HTML, CSS, and JavaScript: Essential Tools for Web Developers HTML, CSS, and JavaScript: Essential Tools for Web Developers Apr 09, 2025 am 12:12 AM

HTML, CSS and JavaScript are the three pillars of web development. 1. HTML defines the web page structure and uses tags such as, etc. 2. CSS controls the web page style, using selectors and attributes such as color, font-size, etc. 3. JavaScript realizes dynamic effects and interaction, through event monitoring and DOM operations.

See all articles