网页设计详解(一)-HTML简介

本文作为博主学习笔记:2023-05-04星期四

一、网页介绍

网页是构成网站的基本元素,它是一个包含HTML标签的纯文本文件,是超文本标记语言格式(文件扩展名为.html或.htm)。网页通常用图像档来提供图画,通过浏览器来阅读。

在这里插入图片描述
超文本介绍:
(1)加入图片、声音、动画、多媒体内容,超出了文本的限制.
(2)可以从一个文件中跳转到另一个文件,与世界各地的主机的文件连接(超级链接文本)。
前端技术核心元素的是HTML、CSS和JavaScript,还要学习一些Ajax、SEO知识,但是前端只能开发静态的网页,后端技术能开发一个用户交互性更好、功能更加强大的网站。
学习路线:HTML入门→CSS入门→HTML进阶→CSS进阶→JavaScript入门→jQuery入门→ASP.NET入门(或PHP入门)→Ajax→ASP.NET进阶(或PHP进阶)。

二、HTML介绍

1、html基本架构

在这里插入图片描述

2、HTML基本内容
2.1 根元素

<html> 元素是 HTML 页面的根元素,整个网页是从<html>开始到</html>结束。

2.2 头部

<head> 元素包含了文档的元(meta)数据,如 <meta charset="utf-8"> 定义网页编码格式为 utf-8;
<head> 元素包含了所有的头部标签元素。在 <head> 元素中你可以插入脚本(scripts), 样式文件(CSS),及各种meta信息。

可以添加在头部区域的元素标签为: <title>, <style>,
<meta>, <link>, <script>, <noscript> ,<base>

使用场景:

<meta>
为搜索引擎定义关键词:

<meta name="keywords" content="HTML, CSS, XML, XHTML, JavaScript">

为网页定义描述内容:

<meta name="description" content="免费 Web & 编程 教程">

定义网页作者:

<meta name="author" content="Runoob">

每30秒钟刷新当前页面:

<meta http-equiv="refresh" content="30">

<style> 标签定义了HTML文档的样式文件引用地址.

<style> 元素中你也可以直接添加样式来渲染 HTML 文档:

<head>
<style type="text/css">
body {
    background-color:yellow;
}
p {
    color:blue
}
</style>
</head>

<base> 标签描述了基本的链接地址/链接目标,该标签作为HTML文档中所有的链接标签的默认链接:

<head>
<base href="http://www.runoob.com/images/" target="_blank">
</head>

<link> 标签定义了文档与外部资源之间的关系。

<link> 标签通常用于链接到样式表:

<head>
<link rel="stylesheet" type="text/css" href="mystyle.css">
</head>

<base> :标签描述了基本的链接地址/链接目标,该标签作为HTML文档中所有的链接标签的默认链接:

<head>
<base href="http://www.runoob.com/images/" target="_blank">
</head>
标签描述
<head>定义了文档的标题
<base>定义了页面链接标签的默认链接地址
<link>定义了一个文档和外部资源之间的关系
<meta>定义了HTML文档中的元数据
<script>定义了客户端的脚本文件
<style>定义了HTML文档的样式文件

代码展示

<!DOCTYPE html>
<html lang="zh-CN"> 
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>你的微光</title>
    <base href="http://www.runoob.com/images/" target="_blank">
    <link rel="stylesheet" type="text/css" href="mystyle.css">
    <style type="text/css">
body {
    background-color:blue;
}
p {
    color:blue
}
</style>
</head>
</html>

效果
在这里插入图片描述

2.3 身部

三、HTML编辑器

可以下载subline text3 代码编辑好工具,博主目前使用的。

<!DOCTYPE html>
<html lang="zh-CN">
 
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>你的微光</title>
</head>
 
<body>
    
    <h1>我是一级标题</h1>
    <p> 我的第一个段落。</p>
    正常正文
    换行标签<br>
    强制换行标签效果<br>
    <strong>加粗标签</strong><b>加粗但不是很常用</b>
    <em>倾斜</em><i>倾斜</i>
    <del>删除</del>
    <s>删除</s>
    <ins>下划线</ins>
    <u>下划线</u>
    <h2>我是二级标题</h2>
    <h3>我是三级标题</h3>
    <h4>我是四级标题</h4>
    <h5>我是五级标题</h5>
    <h6>我是六级标题</h6>
   
   
</body>
 
</html>

在这里插入图片描述
在这里插入图片描述

在这里插入图片描述
按照如上步骤保存为.HTML,双击打开后在浏览器中呈现的页面如图所示
在这里插入图片描述

css标签,网页模板/* Author: W3layout Author URL: http://w3layouts.com License: Creative Commons Attribution 3.0 Unported License URL: http://creativecommons.org/licenses/by/3.0/ */ /* reset */ html,body,div,span,applet,object,iframe,h1,h2,h3,h4,h5,h6,p,blockquote,pre,a,abbr,acronym,address,big,cite,code,del,dfn,em,img,ins,kbd,q,s,samp,small,strike,strong,sub,sup,tt,var,b,u,i,dl,dt,dd,ol,nav ul,nav li,fieldset,form,label,legend,table,caption,tbody,tfoot,thead,tr,th,td,article,aside,canvas,details,embed,figure,figcaption,footer,header,hgroup,menu,nav,output,ruby,section,summary,time,mark,audio,video{margin:0;padding:0;border:0;font-size:100%;font:inherit;vertical-align:baseline;} article, aside, details, figcaption, figure,footer, header, hgroup, menu, nav, section {display: block;} ol,ul{list-style:none;margin:0;padding:0;} blockquote,q{quotes:none;} blockquote:before,blockquote:after,q:before,q:after{content:'';content:none;} table{border-collapse:collapse;border-spacing:0;} /* start editing from here */ a{text-decoration:none;} .txt-rt{text-align:right;}/* text align right */ .txt-lt{text-align:left;}/* text align left */ .txt-center{text-align:center;}/* text align center */ .float-rt{float:right;}/* float right */ .float-lt{float:left;}/* float left */ .clear{clear:both;}/* clear float */ .pos-relative{position:relative;}/* Position Relative */ .pos-absolute{position:absolute;}/* Position Absolute */ .vertical-base{ vertical-align:baseline;}/* vertical align baseline */ .vertical-top{ vertical-align:top;}/* vertical align top */ .underline{ padding-bottom:5px; border-bottom: 1px solid #eee; margin:0 0 20px 0;}/* Add 5px bottom padding and a underline */ nav.vertical ul li{ display:block;}/* vertical menu */ nav.horizontal ul li{ display: inline-block;}/* horizontal menu */ img{max-width:100%;} /*end reset*/ body, html { font-size: 100%; height: 100%; } body { font-family:Arial, Helvetica, sans-serif; background:url(../images/bg2.jpg)no-repeat; background-color:#FFF; -webkit-background-size: cover; -moz-background-size: cover; background-size: cover; background-attachment: fixed; background-position:100% center; } .wrap{ width:95%; margin:0 auto; } /***** Header ****/ .header{ border-top:5px solid #111; } .logo{ text-align:center; margin:10px 0; } .menu { text-align:center } .menu li a{ font-size:0.8em; padding:10px; display:block; color:#FFF; text-transform: uppercase; background-color:rgba(70, 70, 70, 0.47); border-bottom: 1px solid rgba(255, 255, 255, 0.08); margin-bottom: 5px; } .menu li a:hover{ background:#222; } .bl-content{ background:rgba(0, 0, 0, 0.58); } .bl-main > section { display:inline-block; width:24%; } .bl-box { position: relative; width: 100%; height: 100%; cursor: pointer; } .bl-box h2 a{ font-family:Verdana, Geneva, Arial, Helvetica, sans-serif; color:#FFF; text-align: center; margin: 0; padding:15px 0; width: 100%; font-size:0.8em; display: block; text-transform: uppercase; background-color:rgba(70, 70, 70, 0.45); } .bl-box h2:hover { background:#222; color:#FFF; } /* Custom content */ .works > ul { list-style: none; padding: 0; margin: 0; } .works > ul li { display: inline-block; width:48.5%; padding:0%; } .works > ul li a { display: block; padding: 0; border:3px solid #FFF; } .works > ul li a img { display: block; max-width: 100%; width:100%; } .works p{ font-size:0.8em; color:#FFF; line-height:1.6em; padding:5px 0; } /* Panel Items */ div.bl-panel-items, div.bl-panel-items > div { width: 100%; height: 100%; } div.bl-panel-items > div > div { margin: 0 auto; opacity: 1; padding:0 10px; } div.bl-panel-items > div > div h3 { font-size:1.2em; color:#000; margin: 0 0 5px 0; } div.bl-panel-items > div > div p { font-size:0.8em; color:#5A5A5C; line-height:1.6em; } div.bl-panel-items > div > div img { float:none; margin:20px 0px 5px 0; max-width: 100%; } div.bl-panel-items { top: 100%; z-index: 9999; } div.bl-panel-items > div { background:rgba(252, 252, 252, 0.760784); } /**** About ***/ .bl-content h2 { font-size:1.2em; color:#FFF; padding: 5px 0; margin-top:20px; text-transform:uppercase; } .about_img img{ padding:2px; background:#FFF; border:1px solid #DBDBDB; margin:5px 0; width:98%; } .about_data p{ font-size:0.9em; color:#FFF; line-height:1.6em; padding:5px 0; } .content_bottom_right { margin-top:80px; padding-bottom:20px; } .posts{ padding:10px 0 20px; border-bottom: 1px dashed #EEE; } .date{ float:left; width:40px; } .posts figure{ font-weight:bold; font-size:10px; color: #FFF; text-align:center; border-right:1px solid #EEE; padding:0 10px 2px 0; } .posts figure span{ font-size:3em; line-height: 52px; color:#F18D05; display:block; margin-bottom:-10px; letter-spacing:-1px; } .post_desc{ float:left; padding-left:4%; width:77%; } .post_desc p{ color:#FFF; font-size:0.9em; line-height:1.6em; } /***** Blog*****/ .image { clear: both; padding: 0px; margin: 0px; padding:10px 0; } .group:before, .group:after { content:""; display:table; } .group:after { clear:both; } .group { zoom:1; } .grid { display: block; float:none; margin: 0% 0 0% 0%; } .grid:first-child { margin-left: 0; } .images_3_of_1 { width:100%; position:relative; margin-bottom:10px; } .blog-leftgrids{ padding-top:10px; } .blog-desc{ width:100%; } .images_3_of_1 img { max-width:100%; display:block; padding:2px; background:#FFF; border:1px solid #FFF; width:98%; } .blog-desc h3{ padding-bottom:5px; } .blog-desc h3 a{ color:#FFF; font-size:0.9em; font-weight:bold; } .blog-desc p { color:#FFF; font-size:0.823em; line-height:1.6em; } /*** Buttons ****/ .button { float:right; font-size:0.9em; text-transform:uppercase; margin-top: 15px; display: inline-block; font-weight: bold; line-height: 18px; padding:8px 10px; background-color: #f18d05; border-color: #bf7004; color: white; } .button:hover { background-color: #f18d05; } .button:active { background: #d8891e; color: #8d5303; } /*----artical-links---*/ .artical-links{ padding: 10px 0px; border: 1px solid rgba(255, 255, 255, 0.19); border-left: none; margin-top: 5px; border-right: none; } .artical-links ul li{ display:inline-block; } .artical-links ul li img{ vertical-align:middle; padding-right:10px; } .artical-links ul li a{ font: 400 14px/22px Arial; color:#F18D05; padding-right: 20px; } .artical-links ul li a:hover{ color:#FFF; } /*** Page numbers ***/ .content-pagenation{ padding:35px 0; } .content-pagenation li { display: inline-block; } .content-pagenation li a { color:#F18D05; font-size: 0.8em; font-family:Verdana, Geneva, Arial, Helvetica, sans-serif; background:#FFF; padding:8px 10px; } .content-pagenation li a:hover{ background:#F18D05; color:#FFF; } /* Contact Form ============================================================================= */ .section { clear: both; padding: 0px; margin: 0px; } .group:before, .group:after { content:""; display:table; } .group:after { clear:both; } .group { zoom:1; } .col{ display: block; float:left; margin: 2% 0 2% 0%; } .col:first-child{ margin-left:0; } .span_2_of_3 { width:100%; padding:0%; } .span_1_of_3 { width:100%; padding:0%; margin-top:10px; } .span_2_of_3 h3, .span_1_of_3 h3 { color:#FFF; font-size:1.5em; margin-bottom:10px; } .contact-form{ position:relative; padding-top:15px; } .contact-form div{ padding:5px 0; } .contact-form span{ display:block; font-size:0.9em; color:#F18D05; padding-bottom:5px; font-family :verdana, arial, helvetica, helve, sans-serif; } .contact-form input[type="text"],.contact-form textarea{ padding:6px; display:block; width:94%; background: rgba(252, 252, 252, 0); border:1px solid rgba(255, 255, 255, 0.38); outline:none; font-size:1.2em; font-family:Arial, Helvetica, sans-serif; color:#FFF; -webkit-appearance:none; } .contact-form textarea{ resize:none; height:120px; } .myButton { text-transform:uppercase; display: inline-block; font-weight: bold; line-height:18px; border:none; background: #465467; color: #fff; font-size:1em; padding:8px 12px; background-color: #f18d05; border-color: #bf7004; cursor:pointer; } .myButton:hover { background-color: #f18d05; } .myButton:active { background: #d8891e; color: #8d5303; } .company_address p{ color:#FFF; font-size:0.9em; line-height:1.8em; } .company_address p span{ text-decoration:underline; color:#EEE; cursor:pointer; } .contact_info{ padding-top:30px; } .map{ border:1px solid #CCC; margin-bottom:10px; } .copy_right{ padding:25px 0 10px 0; text-align:center; font-family:Verdana, Geneva, Arial, Helvetica, sans-serif; } .copy_right p{ font-size:0.8123em; color: #FFF; line-height:1.8em; } .copy_right p a{ color: #FFF; font-size:1em; text-decoration:underline; } .copy_right p a:hover{ color:#FD9200; text-decoration:none; }
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值