一个页面弄懂 CSS 样式选择器
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Insert title here</title>
<style>
<!-- 某一类标签的样式 -->
div {background-color:#b0c4de;}
p { font-size:24px; text-align:left; color:red;}
<!-- 根据标签中的 class 属性来设置标签的样式 -->
.master {font-size:18px;color:red; text-align:center;}
.item { border-style:red;}
<!-- 根据某一类标签的 class 属性来设置标签元素样式 -->
p.item { color:black; font-size:14px;}
div.item { text-align:center;font-size:; color:blue;width:100px;}
<!-- id选择器样式 -->
#dvi { color:black;font-size:24px; width:200px;margin: auto;}
#title { font-size:28px;text-align:center; }
</style>
</head>
<body>
<div class="master">
<div id="title">
welcome to java web!
</div>
<p class="item">css style test h2</p>
<div class="item">css style test h2</div>
<div id="dvi">css style test div </div>
</div>
</body>
</html>
一个页面弄懂 CSS 样式选择器的更多相关文章
- CSS样式选择器
<!-- css样式选择器 HTML选择器 类选择器 ID选择器 关联选择器 组合选择器 伪元素选择器 selector{ /* selector是样式选择器 property:value; / ...
- 前端基础:CSS样式选择器
前端基础:CSS样式选择器 CSS概述 CSS是Cascading Style Sheets的简称,中文意思是:层叠样式表,对html标签的渲染和布局.CSS规则由两个主要的部分组成:1.选择器:2. ...
- 使用chrome查看页面元素的css样式
使用chrome查看页面元素的css样式 我们在写页面的时候,可能总是不知道怎么回事,就发现某个元素出现了问题,但是不知道为什么会这样,这时候,就需要使用强大的chrome了!!! 举例说明: 1. ...
- CSS样式选择器优先级
CSS样式选择器分为4个等级,a.b.c.d,可以以这四种等级为依据确定CSS选择器的优先级. 1.如果样式是行内样式(通过Style=””定义),那么a=12.b为ID选择器的总数3.c为Class ...
- JS实战 · 仿css样式选择器
代码如下: <html> <head> <meta http-equiv="Content-Type" content="text/ ...
- css样式——选择器(三)
https://www.cnblogs.com/haiyan123/p/7552235.html 1.怎么找到标签 2.如何操作标签的对象 一.css概述 CSS是Cascading Style Sh ...
- Web前端新人之CSS样式选择器
最近在学习css样式.那么我就想先整理一下css样式的选择器 规则结构: 每个规则都有两个基本部分:选择器和声明块.声明块由一个或者多个声明组成,每个声明则是一个属性—值对(property-valu ...
- 一个可以自动生成css样式的插件happycss
一直在页面写css, 重复写着样式,发现布局中,特别是h5,大量的样式都是margin,padding,width,height, 而,当我们需要给一个标签写样式的时候,避免内联样式,我们又需要取cl ...
- html添加css——样式选择器
如何给html添加样式.两种方法: 一.新建立一个css样式表,与原html同目录,然后通过link标签链接.如:<link type="text/css" rel=&quo ...
随机推荐
- CodeForces - 986C AND Graph
不难想到,x有边连出的一定是 (2^n-1) ^ x 的一个子集,直接连子集复杂度是爆炸的...但是我们可以一个1一个1的消去,最后变成补集的一个子集. 但是必须当且仅当 至少有一个 a 等于 x 的 ...
- Codeforces 920 G List Of Integers
题目描述 Let's denote as L(x,p)L(x,p) an infinite sequence of integers yy such that gcd(p,y)=1gcd(p,y)=1 ...
- HDOJ 4903 The only survival
Discription: There is an old country and the king fell in love with a devil. The devil always ask th ...
- Spring Boot企业微信点餐系统-第一章-课程介绍
一.项目简介——技术要点 前端和后端: 后端主要技术: 微信接口技术 微信支付 微信扫码登录 微信模板消息推送 开发环境 但实际上我用的环境和这上面还是有点不一样,我服务器用的是win,到时候我会详细 ...
- Android之startActivityForResult
作用:当aAty跳转之bAty时,需要bAty回传数据,使用startActivityForResult. 相关的函数: aAty:--跳转至bAty(intent可以传递数据) void andro ...
- Java下List使用subList实现分页获取
java.util.List中有一个subList方法,用来返回一个List的一部分的视图. List<E> subList(int fromIndex, int toIndex); 它返 ...
- winform TreeView树节点上下移动
/// <summary> /// 上移 /// </summary> /// <param name="sender"></param& ...
- C# 7 新特性-1
来源https://www.kenneth-truyers.net/2016/01/20/new-features-in-c-sharp-7/ Tuples What Tuples是数据的临时分组.区 ...
- webpack 打包压缩 ES6文件报错UglifyJs + Unexpected token punc «(», expected punc
- php简单常用的API
1.var_dump($x),查看数据类型,以及数据 var_dump($x); //string(12) "就是就是" 2.memory_get_usage()到当前这一步为止一 ...