一,效果图。

二,代码。

<!DOCTYPE html>
<html> <head>
<meta charset="utf-8">
<title>html css</title>
<!--html使用样式-->
<style type="text/css">
h1 {
color: red;
} p {
color: blue;
}
</style>
<!--链接到一个外部样式表-->
<link rel="stylesheet" type="text/css" href="styles.css">
<!--内部样式表-->
<style type="text/css">
body {
background-color: yellow;
} p {
color: blue;
}
</style>
<!--外部样式表-->
<link rel="stylesheet" type="text/css" href="mystyle.css">
</head> <body style="">
<h1>This is heading</h1>
<p>This is paragraph</p>
<!--style属性制作一个没有下划线的链接-->
<a href="http://www.baidu.com" style="text-decoration:none">百度</a>
<h1>I am formatted with an external style sheet</h1>
<p>Me too</p>
<!--内联样式-->
<p style="color:blue;margin-left=20px;">this is a paragraph</p>
<!--背景颜色-->
<h2 style="">this is a heading</h2>
<p style="">this is a paragraph.</p>
<!--字体,字体颜色,字体大小-->
<h1 style="font-family:verdana;">A heading</h1>
<p style="font-family:arial;color:red;font-size:20px;">A paragraph.</p>
<!--文本对齐方式-->
<h1 style="text-align:center;">Center-aligned heading</h1>
<p> this is a paragraph</p>
</body> </html>

参考资料:《菜鸟教程》

最新文章

  1. 利用 Django REST framework 编写 RESTful API
  2. 真机测试无缘无故finish了。程序也没有启动
  3. const,static,extern简介(重要)
  4. activiti搭建(五)BPMN介绍
  5. Virtualizing WrapPanel VS toolkit:WrapPanel
  6. 通过一个简单的数据库操作类了解PHP链式操作的实现
  7. hdu 4937 Lucky Number
  8. 用php生成word文档
  9. [原创]# 玩转nginx系列
  10. 安装CDH
  11. RandomAccessFile类进行文件加密
  12. ORA-01034: ORACLE not available问题
  13. Express全系列教程之(五):Express的中间件
  14. MyEclipse创建Web项目入门指南
  15. java学习笔记6(面向对象1:概念,private)
  16. guns使用注意问题
  17. gateio API
  18. javascript之构造函数的继承(引用网络)
  19. 十一、curator recipes之联锁InterProcessMultiLock
  20. git团队操作

热门文章

  1. 使用 IncrediBuild 提升 VisualStudio 编译速度
  2. Codeforces gym102152 K.Subarrays OR
  3. 利用phpcms后台漏洞渗透某色情网站
  4. react小知识2
  5. 如何设置 sass 全局变量,js如何使用 sass 变量
  6. JS应用实例1:注册页面表单校验
  7. 分布式控制系统Git学习
  8. hystrix降级初步学习
  9. LeetCode:105_Construct Binary Tree from Preorder and Inorder Traversal | 根据前序和中序遍历构建二叉树 | Medium
  10. web自动化测试---第一个自动化测试用例