【代码笔记】Web-CSS-CSS id和Class选择器
2024-10-18 19:27:22
一,效果图。
二,代码。
<!DOCTYPE html>
<html> <head>
<meta charset="utf-8">
<title>CSS id和class选择器</title>
<style>
#para1 {
text-align: center;
color: red;
} .center {
text-align: center;
} p.center {
text-align: right;
}
</style>
</head> <body>
<p id="para1">hello</p>
<p>this paragraph is not affected by the style.</p>
<h1 class="center">标题居中</h1>
<p class="center">段落居中</p>
</body> </html>
参考资料:《菜鸟教程》
最新文章
- Spring MVC重定向和转发及异常处理
- (四)新建Maven项目
- python下编译py成pyc和pyo
- Odoo Graph 指定默认 类型
- 批处理ODBC配置
- mysql存储过程性能监控和分析
- iOS开发UIScrollView的底层实现
- SQL语句查找重复记录
- MVC权限模块
- shiro中CacheManager相关的类结构介绍,提供redis Cache实现
- iOS 数组问题
- Centos 6.5 安装和使用docker
- idea 集成sonarLint检查代码bugs
- centos6.7环境之kvm虚拟化quem工具配置及使用详解
- 维护keepalived与mysql漂移脚本
- java中六个时间类的使用和区别
- 国家代号(CountryCode)与区号
- Java基础-逻辑运算符Logic Operators
- 使用Python的turtle(海龟)模块画图
- SharePoint 2013 EventHanlder工具
热门文章
- Android 音视频开发(六): MediaCodec API 详解
- java前后分离使用fetch上传文件失败500
- Python爬虫4-URLError与HTTPError
- 2种不同方式实现背景图里加入文字的简单CSS样式
- [Swift]LeetCode67. 二进制求和 | Add Binary
- [Swift]LeetCode637. 二叉树的层平均值 | Average of Levels in Binary Tree
- 非对称加密技术中,iFace [ 爱妃链 ]人脸密钥技术排名第三,将弥补区块链现有不足
- angularJS学习(二)
- 关于ML.NET v0.7的发布说明
- 软件性能测试技术树(三)----数据库(MySQL)性能