Talk about the structure of a html page
来源:互联网 发布:80端口哪个运营商 编辑:程序博客网 时间:2024/06/18 05:18
At the first time I study html to build a web page ,it is not so hard to understand what the tags mean and how to use them .But when the first time I got a project form my mentor ,and my job was not to build the page with html and obviously css , javascript ,but to modify a demo for building a new page .Actually that was not difficult .And I was told that not just to copy ,paste and delete ,I had to figure out what I don't understand that something I don't know yet .So that was my beginning .And I finally did it .
Alright go to the thing .How to build the html file of a web page ?
First I wanna tell you a normal web page can't work without css and javascript ...So how should we build ?One :you can write the css in the '<style></style>' tag or you can just write them in the tag with a style property .But it is so complicated and not simple .But we can use the '<link/>' tag to import the css file like this :
<link rel="stylesheet" href="mycss.css" />
JUST like this ,you can create a css file in your project files list and you can write the css classes in the css file .So simple .But here is the thing :you might wonder where you write that tag .Yeah ,let me tell you .So my way is :because the page is loaded form the head of the html file to the end ,so there are two choices we get : you can write it in the head tag before the body or you can write it in the end before the '</body>' tag .When the page is loading in the browser ,it can't see the effect of the css classes if you load the css file in the end and it is bad for the users'experience .So you should write it like this :
<!DOCTYPE html><html lang="en"><head> <meta charset="UTF-8"> <title>MyTitle</title> <link rel="stylesheet" href="mycss.css" /></head>
And the second thing ,what about the javascript ?It also can write in the html file with the '<script></script>' .But same problem . I think something already come up in your mind .In most of cases ,the javascript code is not gonna change the page without event like click .So you can write the tag in the end before the '</body>' tag like this:
<script type="text/javascript" src="myjavascript.js"></script></body></html>
So here you go .What about the body ?What's in the body ?
When you get the design of the web page ,you should study it on the whole page .It means you should see how many big parts of the whole page ?For example ,if your page likes this :
How many parts you think ?You can see there are three parts of this page ,the navigate ,the search input with a logo and the news part .So you can write three div tags in the body and add some css classes for them to make them more perfect like this :
<div class="navi"></div><div class="input"></div><div class="news"></div>And for example ,the navi ,there are two big parts ,the left and the right .So you can write two div tags in the first div tag .Or you can see it in the other way that there are 15 parts in the navi ,it is not wrong .It is up to you .So you can write like this :
<div class="navi"> <div class="left"></div> <div class="right"></div></div>So you can complete the page like this way .Hope this would help you~Have a good day !
- Talk about the structure of a html page
- Go on talk about the process of developing software.
- About the ACCESS_MASK Structure
- The structure of a class file
- Oracle: check the structure of a table
- The structure of a PKZip file
- The Life Cycle of a JSP Page
- 名家之言--Gavin King talk about the reasons of hibernate's success
- The Structure of CICS
- The structure of GetMessage()
- Structure of the flower
- The Structure of jQuery
- Structure of a spider
- the travel of solving iframe navigate to display page of certain part of parent html page
- Talk of the town 街谈巷议
- Getting Information About the Contents of a Folder
- a speech --about the guidance of being mature (1)
- Changing the rendering mode of a shared page
- Android——滑动监听RecyclerView线性流+左右划删除+上下移动
- 环信群聊功能
- 堆和栈的区别(转过无数次的文章)
- DOM初探(4)
- Codeforces711D-Directed Roads(强连通分量+乘法原理)
- Talk about the structure of a html page
- Android入门三 Http通信(实例)
- 存储过程
- 各种Map的特点
- 封装原生的文件上传类
- 小熊仔要开启奔跑之旅啦
- static关键字所导致的内存泄漏问题
- poj--3249 Test for Job(topsort + dp)
- 后台数据管理