<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>html基础复习</title>
</head>
<body>
<!-- 前端: 用户可见的所有界面均是前端(PC端/移动端) -->
<!-- html: 页面架构搭建 | css: 页面布局样式 | js: 页面交互渲染 -->
<!-- 编辑器: webstrom | sublime | atom | pycharm --> <!-- 标签: <字母开头 + 合法字符(数字|-)> => (标签具有作用域,有头有尾) <abc> | <num1> | <nav-title> -->
<!-- 指令: <!doctype html> 注释 -->
<!-- 转移字符: &gl; &nbsp; --> <!-- 基本标签: div | span | hn | p | ul>li | hr | br | form>input | table>tr>th(td) | a | img | b | i | meta | link | script | style --> <!-- 分类: 单双 | dispaly -->
<!-- inline: span | b | i | a -->
<!-- inline-block: img | input -->
<!-- block: div | hn | p | ul | hr | br -->
</body>
</html> <!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>css复习</title>
</head>
<body>
<!-- 1.css三种引入: 行间式 | 内联式 | 外联式 -->
<!-- 选择器 作用域 样式块 --> <!-- 2.长度单位: px | em | rem | cm | mm | vw | vh | in --> <!-- 3.颜色: rgb(0, 255, 189) | rgba(0,0,0, 0~1) | red | #000000~#FFFFFF --> <!-- 4.文本样式 -->
<style>
span {
font: 900 normal 30px/100px '首选字体', '备用字体1', '备用字体2';
text-align: center;
color: red;
text-decoration: underline;
letter-spacing: 3px;
word-spacing: 10px;
text-indent: 2em;
}
</style> <!-- 5.选择器 -->
<style type="text/css">
/*选择器: css连接html标签的桥梁,建立连接后就可以控制标签样式*/
/*标签 类 id*/
/*组合选择器*/
/*伪类选择器*/ /*优先级:*/
/*基础选择器: !important > id > 类[属性] > 标签 > 通配*/
/*组合选择器: 权重(同类型个数比较)*/
.b > .s {}
.b .s {}
.b + .s {}
.b.s {}
.b[class] {} #ss { font-size: 50px; }
span.s2 { font-size: 40px; }
[class] { font-size: 35px; }
.s1 { font-size: 30px; }
span { font-size: 20px!important; } /* 标签名 | . | # */
/*后代"空格"(子代) | 兄弟"~"(相邻) | 群组"," | 交集"紧挨着"*/
/* [属性名="属性值"] */ </style> <span class="s1 s2" id="ss" style="font-size: 60px;">12345</span> <style type="text/css">
/* 伪类选择器 */
/* :link :hover(鼠标悬浮) :active(鼠标点击中) :visited */
/* :nth-child() 先位置后类型 :nth-of-type() 先类型后位置 */
/* :not() */
/* :before(盒子渲染前) :after(盒子渲染后) :focus(表单标签获取焦点) */
p:nth-child(3) { font-size: 100px }
p:nth-of-type(2n) { font-size: 50px }
</style>
<div class="box">
<span>span</span>
<p>pp1</p>
<p>pp2</p>
</div> <!-- 6.精灵图 -->
<style type="text/css">
.pg {
width: 200px;
height: 200px;
border: 1px solid black;
position: absolute;
top: 10px;
left: calc(50vw - 100px);
}
.pg {
background: url('img/bg.png') no-repeat;
/*将背景图片的具体位置移至显示区域*/
background-position: -300px -350px;
}
</style>
<div class="pg"></div>
</body>
</html> <!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>盒模型复习</title>
<style type="text/css">
abc {
display: inline-block;
} .box {
background: orange; /*文本类型的样式具有继承关系*/
font-size: 30px;
font-weight: 900;
/*inline-block不会继承*/
text-decoration: underline;
text-indent: 2em;
line-height: 60px;
}
</style>
</head>
<body>
<!-- 文本属性通过拥有继承关系: 子标签没有设置文本属性时,值会从父级中获取(父级如果没有设置,会找到html) --> <div class="box">
<span>inline</span>
<div>block</div>
<abc>inline-block</abc>
</div> <!-- 1.盒子的四个组成部分 -->
<!-- content | padding | border | margin -->
<!-- display: inline | inline-block | block --> <!-- content: 提高给内容(文本,图片,子标签整个盒子)的显示区域 --> <!-- padding: 介于border与content之间的距离, 可以撑开border与content之间的距离, 没有自身颜色(透出背景颜色),只有区域 -->
<!-- 注: padding-top可以将自身与自身第一个子级分离 -->
<style type="text/css">
.p {
width: 20px;
height: 20px;
background: red;
}
.b {
width: 100px;
padding-bottom: 100px;
border-bottom: 1px solid black;
}
.c {
background: pink;
/*border: 1px solid black;*/
border-style: solid;
padding-left: 32px;
padding-bottom: 32px;
margin-left: 32px;
/*text-indent: 2em;*/
}
</style>
<div class="b">
<div class="p"></div>
</div>
<div class="c">123</div> <!-- border: 边框, 有宽度颜色样式, 如果给颜色设置透明也可以透出背景颜色 --> <!-- margin: 控制盒子位置 => 盒模型布局 --> <!-- 2.边界圆角 -->
<style type="text/css">
.bj {
width: 100px;
height: 100px;
background: pink;
}
.bj {
/*border-radius: 20px;*/
/*border-radius: 40%;*/
/*border-radius: 10px 30px 50px;*/
border-radius: 10px / 50px;
}
</style>
<div class="bj"></div> <!-- 3.display --> <!-- 4.margin布局 -->
<!-- i) margin-top | margin-left 完成自身布局, 右下两个方向影响兄弟 -->
<style type="text/css">
.hh {
width: 30px;
height: 30px;
background: black;
/*display: inline-block;*/
float: left;
/*自身动,控制自身布局*/
/*margin-top: 30px;*/
/*margin-left: 30px;*/ /*右兄弟动,辅助兄弟布局*/
margin-right: 100px;
/*下兄弟动,辅助兄弟布局*/
/*margin-bottom: 30px;*/
}
.xx {
width: 30px;
height: 30px;
background: red;
/*display: inline-block;*/
float: left;
}
</style>
<div class="hh"></div>
<div class="xx"></div> <!-- ii) 上下间距会重叠取大值, 左右间距会叠加 -->
<!-- 坑1: 父子联动 坑2: 上兄弟下margin和下兄弟上margin重叠取大值 -->
<style type="text/css">
.x, .z {
width: 50px;
height: 50px;
background: blue;
}
.x {
/*margin-bottom: 40px;*/
}
.z {
margin-top: 10px;
background: yellow;
}
.y {
width: 10px;
height: 10px;
background: red;
/*margin-top: 10px;*/
}
/*坑1解决方案*/
.y {
/*方案1*/
/*float: left;
margin-top: 10px;*/ /*方案2*/
/*position: relative;*/
position: absolute;
/*top: auto;*/
/*top: 20px;*/
margin-top: 20px;
}
.z {
/*position: relative;*/
}
</style>
<div class="x"></div>
<div class="z">
<div class="y"></div>
</div>
</body>
</html>

Python-HTML CSS 练习的更多相关文章

  1. Python flask+css+js+ajax 综合复习

    flask 基本语法结构 注:这里练习的时候把装饰器的@给忘记了,导致访问404 下面练习一下在前段向后端传递参数 get请求需要用   request.args.get('变量') 去接收, get ...

  2. 048.Python前端css

    一 CSS介绍 1.1  CSS语法 CSS 规则由两个主要的部分构成:选择器,以及一条或多条声明. selector { property: value; property: value; prop ...

  3. python html css 初识

    ##################总结############ 浏览器发请求 --> HTTP协议 --> 服务端接收请求 --> 服务端返回响应 --> 服务端把HTML文 ...

  4. python 前端 css

    CSS(Cascading Style Sheet,层叠样式表) 是一种用来表现HTML或XML等文件样式的计算机语言. 作用:是用来美化HTML标签的,相当于给页面化妆. 每个css 都是有两部分组 ...

  5. Selenium2+python自动化-CSS定位语法

    前言 一些人在使用selenium定位元素时,用的是xpath定位,因为xpath基本能解决定位的需求.css定位往往被忽略掉了,其实css定位也有它的价值,css定位更快,语法更简洁.这一篇css的 ...

  6. Python 前端 Css基础

    CSS样式存在的位置 1.放置在标签内,局部生效 <div style="color: red;font-size: 18px;">hello world</di ...

  7. python 46 css组合选择器 及优先级 、属性选择器

    一:css组合选择器 特性:每个选择器位可以为任意基本选择器或选择器组合 选择器分为以下几类: 群组选择器,子代(后代)选择器,相邻(兄弟)选择器,交集选择器,多类名选择器 1.群组选择器:    d ...

  8. Python 45 css三种引入方式以及优先级

    一:css三种引入方式 三种方式为:行间式 | 内联式 | 外联式 行间式   1.在标签头部的style属性内  2.属性值满足的是css语法  3.属性值用key:value形式赋值,value具 ...

  9. python : HTML+CSS (左侧菜单)

    左侧菜单 <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3 ...

  10. python : HTML+CSS (定时器轮寻)

    定时器轮寻 <!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF ...

随机推荐

  1. 多线程状态下调用SimpleDateFormat.format()抛出 ArrayIndexOutOfBoundsException 异常

    本来想在类的顶部设置一个 静态的SimpleDateFormat常量 public final static DateFormat dateFormatGMT = new SimpleDateForm ...

  2. 有趣的async

    在项目的开发过程中,同步异步是一个很重要的概念.但是在js中,又会有稍微的不同. 依据微软的MSDN上的解说: (1) 同步函数:当一个函数是同步执行时,那么当该函数被调用时不会立即返回,直到该函数所 ...

  3. 线程的加入.join()

    格式:以加入A线程为例 线程对象B.join()   无参数,则A线程一直暂停,直到B线程运行结束. 线程对象B.join(时间t)   有参数,则A线程每隔t时间暂停一次,直到B线程运行结束. 关于 ...

  4. mysql存储过程变量的拼接

    存储过程变量的拼接   有时候我们需要模糊查询,但是同时我们又要 在模糊查询的时候使用变量,我们又想在变量的后面拼接一个%去匹配模糊查询   那么就会用到 concat函数   示例如下:  www. ...

  5. 解决IIS8中 URLRewriter 不能使用的方法

    1.把应用程序池改成集成 2.的web.config 加入代码 <system.webServer> <validation validateIntegratedModeConfig ...

  6. frp中的json模块

    预备知识 Go中的接口的数据结构可以分为两部分: 其中一部分指向或者存储了原始数据的值 另一部分指向或者存储了原始数据的类型描述符(其中包含类型,以及对应于接口中的方法) 所以大体上我们可以粗略的认为 ...

  7. 1021. Deepest Root (25)

    A graph which is connected and acyclic can be considered a tree. The height of the tree depends on t ...

  8. 多目标遗传算法 ------ NSGA-II (部分源码解析)父、子种群合并 merge.c

    /* Routine for mergeing two populations */ # include <stdio.h> # include <stdlib.h> # in ...

  9. 设计模式---对象创建模式之抽象工厂模式(Abstract Factory)

    一:概念 抽象工厂模式是所有形态的工厂模式中最为抽象和最具一般性的.抽象工厂模式可以向客户端提供一个接口,使得客户端在不必指定产品的具体类型的情况下,能够创建多个产品族的产品对象 二:动机 在软件系统 ...

  10. mysql 缓存机制

    了解mysql缓存吗(顺丰) mysql缓存机制就是缓存sql 文本及缓存结果,用KV形式保存再服务器内存中,如果运行相同的sql,服务器直接从缓存中去获取结果,不需要在再去解析.优化.执行sql. ...