text-align

CSS学习笔记一

匿名 (未验证) 提交于 2019-12-02 20:32:16
id选择器可以为标有特定 id的HTML元素指定特定的样式 id选择器是以 “#” 来定义的 <!DOCTYPE html> <html> <head> <title>Node</title> <style type="text/css"> #red {color: red;} #green {color: green;} </style> </head> <body> <p id="red">id选择器:red -- 红色</p> <p id="green">id选择器:green -- 绿色</p> </body> </html> id选择器常建立 派生选择器 #sidebar p { font-style: italic; text-align: right; margin-top: 0.5em; } #sidebar p { font-style: italic; text-align: right; margin-top: 0.5em; } #sidebar h2 { font-size: 1em; font-weight: normal; font-style: italic; margin: 0; line-height: 1.5; text-align: right; } 如上,在使用sidebar选择器时,应用在p标签上会使用第一个CSS样式 单独的选择器

组件 顶部常见布局类型

依然范特西╮ 提交于 2019-12-02 20:16:45
<template> <div> <el-header> <el-row> <el-col :span="12"> <div class="grid-content bg-purple header-left-content"> <img class="header-left-img" src="../assets/image/banner-test-1.jpg" /> <ul class="header-left-menu-ulbox"> <li v-for="(item,index) in headermenu" :key="index"> <router-link :to="item.url">{{item.name}}</router-link> </li> </ul> <i class="el-icon-edit header-top-icon-edit"></i> </div> </el-col> <el-col :span="12"> <div class="grid-content bg-purple-light header-right-content"> <i :class="[itemicon.icon]" v-for="(itemicon,indexicon) in icondata" :key="indexicon"></i> </div> </el

display:table-cell实现水平垂直居中

微笑、不失礼 提交于 2019-12-02 16:51:29
如果查看css手册,会发现display有许多带table字样的可选属性,有table、inline-table、table-row-group、table-row、table-cell等10个之多,可以赋予div类似于<table>等标签的布局特性。大多数浏览器(IE6/7除外)对其支持良好,其实现原理参考《 匿名表格元素 》。   组合使用display:table-cell和vertical-align、text-align,使父元素内的所有行内元素水平垂直居中(内部div设置display:inline-block即可)。这在子元素不确定宽高和数量时,特别实用! 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 <! DOCTYPE html> < html lang="en"> < head > < meta charset="UTF-8"> < meta http-equiv="X-UA-Compatible" content="ie=edge"> < title >Demo001_displayTable</ title > < style > /*** table-cell middle center组合使用 ***/ .cell { display:

怎样让一个元素居中,详解!

烂漫一生 提交于 2019-12-02 15:06:36
css 居中 方法1:table-cell html结构: <div class="box box1"> <span>垂直居中</span> </div> css: .box1{ display: table-cell; vertical-align: middle; text-align: center; } 方法2:display:flex .box2{ display: flex; justify-content:center; align-items:Center; } 方法3:绝对定位和负边距 .box3{position:relative;} .box3 span{ position: absolute; width:100px; height: 50px; top:50%; left:50%; margin-left:-50px; margin-top:-25px; text-align: center; } 方法4:绝对定位和0 .box4 span{ width: 50%; height: 50%; background: #000; overflow: auto; margin: auto; position: absolute; top: 0; left: 0; bottom: 0; right: 0; } 这种方法跟上面的有些类似,但是这里是通过margin

pandas模块

浪子不回头ぞ 提交于 2019-12-02 08:46:43
[TOC] pandas模块简介 pandas是python数据分析的核心模块。它主要提供了五大功能: 支持文件存取操作,支持数据库(sql)、html、json、pickle、csv(txt、excel)、sas、stata、hdf等。 支持增删改查、切片、高阶函数、分组聚合等单表操作,以及和dict、list的互相转换。 支持多表拼接合并操作。 支持简单的绘图操作。 支持简单的统计分析操作。 Series数据结构 Series是一种类似于一维数组的对象,由一组数据和一组与之相关的数据标签(索引)组成。 Series比较像列表(数组)和字典的结合体 import numpy as np import pandas as pd Series创建方式 第一种: 直接传入一个列表,此时由于没有指定数据索引,则会自动创建一个0~N-1(N为数据的长度)的整型索引,可以通过索引进行取值 df = pd.Series([i for i in range(4, 8)]) df 0 4 1 5 2 6 3 7 dtype: int64 df[1] 5 df.values array([4, 5, 6, 7], dtype=int64) 第二种:传入一个列表,自定义索引列表(索引列表长度需要和数据的长度一致),此时就可以通过自定义的索引进行取值, 但还是可以通过默认索引进行取值 df1 = pd

text-align:center 与 的区别

点点圈 提交于 2019-12-02 02:43:23
下面通过一个例子来说明: 先贴代码: < div style = "text-align:center" > 我是文字居中 < < p > 我也居中 </ p > < div style = "display:block; width:200px; background-color:yellow;border:2px solid #F00;" > 我是块元素我不居中 </ div > </ div > < center > 我居中了 < p > 我也居中了 </ p > < div style = "display:block; width:200px; background-color:yellow" > 我也不得不居中了 </ div > </ center > 运行效果图: 如果要令div块元素居中,可以添加这个代码margin:0 auto 贴代码: < div style = "text-align:center" > 我是文字居中 < < p > 我也居中 </ p > < div style = "display:block; width:200px; background-color:yellow;border:2px solid #F00;margin:0 auto" > 我是块元素我不居中 </ div > </ div > < center > 我居中了 <

正确的使用margin:0 auto与body{text-align:center;}实现元素居中

时光怂恿深爱的人放手 提交于 2019-12-02 02:43:07
body{text-align:center}与margin:0 auto的异同?这是一个对齐上的迷惑,刚开始的时候或许大家对它们都不是很理解。我们通过下面的一些小例子来了解他们到底有什么区别,应该在什么样的情形下正确的使用body{text-align:center}与margin:0 auto。我们首先了解一下它们的基本概念: % _* m4 b* ~/ {: L8 P * B& M1 }, F% v) U: o   text-align是用于设置或对象中文本的对齐方式。一般情况下我们设置文本对齐方式的时候需要用此属性进行设置,如: . j' j* w0 @5 q& w0 _+ L 2 B- Y& A( X. d Example Source Code - K; G( _& F: [: k1 J * C. G5 y/ n j; @! h1 A) }   div { text-align: left; } 表示文本居左对齐。 i& J% B2 x- z, L8 e , h- L F9 `! m1 c- S* }- Y' @ ) i3 I! Q" } w. ^8 F ?9 t. I; ^   margin是设置对象四边的外延边距,被称为外补丁或外边距。如: ) k V# p5 T: U0 Y0 i. c1 ?, ` + J3 c0 i9 C6 z% g* Z$ E0 L

text-align:center 实现文字居中对齐与 align-items:center 实现div内所有标签对齐

血红的双手。 提交于 2019-12-02 02:41:04
初始化样式: <style> div{ border:solid 1px red; margin-top: 5px; } span{ border:solid 1px blue; } </style> <div style="height:300px;width:300px; "> <div style="height:100px;width:200px;"> <p style="border:blue solid 1px;">hello</p></div> <div style="height:70px;width:80px;">helllll</div> <span style="height:50px;width:50px;">sds</span> </div> 效果: 文字居中:text-align,让文字再所在标签内居中 效果如下: 接下来使用flex布局,让标签居中, display:flex 使用flex布局,flex-direction:column 设置竖向为主轴,align-items:center 设置交叉轴对齐方式为居中 效果如下: 来源: CSDN 作者: 远远_ 链接: https://blog.csdn.net/XyuanL/article/details/90140784

IE7下当position:fixed遇到text-align:center

时光怂恿深爱的人放手 提交于 2019-12-02 02:40:50
啥也不说,先看代码: <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <title>IE7下当position:relative遇到text-align:center</title> <meta http-equiv="Content-Type" content="text/html; charset=utf-8"/> <meta http-equiv="X-UA-Compatible" content="IE=EmulateIE7" /> <style type="text/css"> body{padding:0;margin:0} #wrap{text-align:center} #toolbar{width:100%;height:25px;background:#000;position:fixed;bottom:0;} </style> </head> <body> <div id="wrap"> <div id="toolbar"></div> </div> </body>

HTML中text-align:center,margin:auto,vatical-align以及如何让定位元素居中的方法

梦想与她 提交于 2019-12-02 02:40:26
1、text-align:center 对文本、图片进行水平居中 可配合行高(line-height)对文字进行水平垂直居中 2、margin:auto 对已知宽度的块元素水平居中 3、vartical-align:middle 垂直对齐 只有元素属于inline或是inline-block ,vertical-align属性才会起作用。 默认时baseline基线对齐,可通过改变对齐方式解决图片间隙问题 4、对已知宽高的定位元水平垂直素居中 left:50%; top:50%; margin-left:负的定位元素宽度的一半; margin-top:负的定位元素高度的一半; 来源: CSDN 作者: qiladuo1207 链接: https://blog.csdn.net/qiladuo1207/article/details/81228428