博主信息
博文 5
粉丝 0
评论 0
访问量 3846
热门教程
更多>
最新下载
更多>
网站特效
网站源码
网站素材
前端模板
html及css基础知识-2018年8月11日18点13分
牛牛的博客
原创
651人浏览过

<!DOCTYPE html><!-- 定义文档类型 -->

<html>

<head><!-- 定义网页头部 -->

<title>php中文网-视频教程</title>

<meta charset="utf-8"><!-- 设置字符集编码 -->

<link rel="stylesheet" type="text/css" href="static/style.css"><!-- 连接外部css样式表 -->

<link rel="shortcut icon" type="image/x-icon" href="images/footlogo.png">

<style type="text/css"> /*内部样式:只针对当前页面*/

body{}/*标签选择器*/

#box{width:100px;/*id选择器*/

height: 100px;

background: pink; }

.main{width:100px;/*类选择器*/

height: 100px;

background: green; }

a[href="http://www.php.cn"]{color: red;}

a{color: blue;}/*属性选择器*/

div a{color: black;}/*派生选择器 根据文档上下文关系来定义样式*/

</style>

</head>

<body >

<img src="">

<a href="http://www.baidu.com">百度</a><!-- 连接到外部网站 -->

<a href="http://www.php.cn">php中文网</a>

<a href="demo2.html">demo2</a><!-- 连接到内部文件 -->

<div id="box">

<a href="http://www.baidu.com">百度</a>

</div>

<div class="main"></div>

<div></div>

<div></div>

</html>

IMG_20180811_182535.jpg

知识点:

1、html常用标签

<!DOCTYPE html><!-- 定义文档类型 -->

<head></head><!-- 定义网页头部 -->

<style></style>层叠样式表标签

<a></a>超连接标签

2、css选择器

body{}/*标签选择器*/

#box    /*id选择器*/

.main    /*类选择器*/

a[href="http://www.php.cn"]{color: red;}    /*属性选择器*/

a{color: blue;}/*属性选择器*/

div a{color: black;}/*派生选择器 根据文档上下文关系来定义样式*/


批改状态:合格

老师批语:代码没有高亮哦!
本博文版权归博主所有,转载请注明地址!如有侵权、违法,请联系admin@php.cn举报处理!
全部评论 文明上网理性发言,请遵守新闻评论服务协议
0条评论
作者最新博文
关于我们 免责申明 意见反馈 讲师合作 广告合作 最新更新 English
php中文网:公益在线php培训,帮助PHP学习者快速成长!
关注服务号 技术交流群
PHP中文网订阅号
每天精选资源文章推送
PHP中文网APP
随时随地碎片化学习

Copyright 2014-2025 https://www.php.cn/ All Rights Reserved | php.cn | 湘ICP备2023035733号

  • 登录PHP中文网,和优秀的人一起学习!
    全站2000+教程免费学