line-height

博客园页面定制 CSS 代码

僤鯓⒐⒋嵵緔 提交于 2019-12-04 04:58:14
<!DOCTYPE html> <html> <head> <meta charset="UTF-8"> <title>Page title</title> </head> <body> </body> </html> #EntryTag { margin-top: 20px; font-size: 9pt; color: #808080 } .topicListFooter { text-align: right; margin-right: 10px; margin-top: 10px } #divRefreshComments { text-align: right; margin-right: 10px; margin-bottom: 5px; font-size: 9pt } * { margin: 0; padding: 0 } html { height: 100% } body { color: #999; background-color: #21252b; font-family: "Helvetica Neue",Helvetica,Verdana,Arial,sans-serif; font-size: 12px; min-height: 101%; } table { border-collapse: collapse; border-spacing: 0

line-height 行高的使用

跟風遠走 提交于 2019-12-04 02:12:29
line-height:normal; 默认 字体 line-height:1.5; line-height:200%; line-height:50px; ps : 固定的值 line-height:5em;. 不同浏览器的字体行高不一样(ps : 行高 = font-size 的值 * 属性值 为实际的行高) 平常使用的为 line-height : 1.5; 子元素将会继承这个1.5 (PS:其他属性继承的为 计算后px 的值) 来源: https://www.cnblogs.com/guyuedashu/p/11828003.html

css实现单行、多行文本超出显示省略号

此生再无相见时 提交于 2019-12-03 21:09:04
前言:项目中我们经常遇到这种需求,需要对单行、多行文本超出显示为省略号。这篇文章主要总结了小编解决此问题的方法,有不足之处欢迎大家指正。 单行文本省略 .ellipsis-line { border: 1px solid #f70505; padding: 8px; width: 400px; overflow: hidden; text-overflow: ellipsis; //文本溢出显示省略号 white-space: nowrap; //文本不会换行 } 语法: text-overflow:clip/ellipsis; 默认值:clip 适用于:所有元素 clip: 当对象内文本溢出时不显示省略标记(...),而是将溢出的部分裁切掉。 ellipsis: 当对象内文本溢出时显示省略标记(...)。 在使用的时候,有时候发现不会出现省略标记效果,经过测试发现,使用ellipsis的时候,必须配合overflow:hidden; white-space:nowrap; width:具体值;这三个样式共同使用才会有效果。 多行文本省略 直接用css属性-webkit-line-clamp:n;设置 在WebKit浏览器或移动端(绝大部分是WebKit内核的浏览器)的页面实现比较简单,可以直接使用WebKit的CSS扩展属性(WebKit是私有属性)-webkit-line

分享下我的博客园美化的模板代码

大城市里の小女人 提交于 2019-12-03 20:48:28
模板美化教程 这个代码是在网上找的一套,然后稍加修改,还添加了一点我喜爱的小物件儿。如果你喜欢这套模板就拿走吧,别忘了点个赞哦! 主页 文章页 设置步骤: 1.更改博客皮肤 2.页面定制css代码: #EntryTag{margin-top:20px;font-size:9pt;color:gray}.topicListFooter{text-align:right;margin-right:10px;margin-top:10px}#divRefreshComments{text-align:right;margin-right:10px;margin-bottom:5px;font-size:9pt}*{margin:0;padding:0}html{height:100%;max-height:100%;font-size:62.5%;-webkit-tap-highlight-color:rgba(0,0,0,0)}body{background-color:#fff;font-size:12px;max-height:100%;font-family:"Merriweather","Open Sans","Microsoft Jhenghei","Microsoft Yahei",sans-serif;color:#3a4145;-moz-font-feature

CSS(2)---css字体、文本样式属性

喜欢而已 提交于 2019-12-03 12:13:18
css字体、文本样式属性 这篇主要讲CSS文本属性中的: 字体样式属性 和 文本样式属性 。 一、字体样式属性 CSS 字体属性主要包括: 字体设置(font-family) 、 字号大小(font-size) 、 字体粗细(font-weight) 、 字体风格(font-style) 、 字体颜色(color) 。 1、字体设置(font-family) 网页中常用的字体有 宋体、微软雅黑、黑体 等,例如将网页中 所有p标签的字体设置为微软雅黑 ,可以使用如下CSS样式代码: p { font-family:"微软雅黑";} 可以同时指定多个字体,中间以 逗号 隔开,表示如果浏览器不支持第一个字体,则会尝试下一个,直到找到合适的字体。 p {font-family:"微软雅黑",“宋体”,arial;} 注意 1、英文字体不需要加双引号,如:选择器{font-family:arial;} 2、如字体中包含特殊符号必须用双引号括起来,如:选择器{font-family:"Microsoft yahei";} 3、尽量使用系统默认字体,保证在任何用户的浏览器中都能正确显示。 2、字号大小(font-size) p {font-size:15px;} 该属性的值可以使用相对长度单位,也可以使用绝对长度单位。较常用,推荐使用相对长度像素单位px。 建议 1

Image to the left from a justified text

匿名 (未验证) 提交于 2019-12-03 09:13:36
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: I’m trying to align a logo’s image and text. I cannot justify the second line to the width of the block. Here is the expected result: I tried this: @import url(http://fonts.googleapis.com/css?family=Ubuntu:300,500); h1 { line-height:30px; font-size:30px; background:#eee; color: #333333; } h2 { line-height:10px; font-size:12px; background:#eee; text-transform: uppercase; color: #434343; } img#logo { margin-right:10px; margin-top: 0px; float:left; } #logo_text{ font-family: 'Ubuntu', sans-serif; width: 230px; } #logo_text h2{ text-align:

Easy Pie Chart : Bug percentage not centered?

匿名 (未验证) 提交于 2019-12-03 08:54:24
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: I have a symfony project, I use bootstrap for style, and I want to use Easy Pie Chart for a dashboard page. So, in base.html.twig : <html> <head> <meta charset="UTF-8" /> <title>{% block title %} Website {% endblock %}</title> {% block stylesheets %}{% endblock %} {% block javascripts %} {% javascripts 'js/jquery-1.10.2.min.js' 'js/bootstrap.min.js' 'js/typeahead.min.js' 'js/jquery.easypiechart.min.js' 'js/jquery.sparkline.min.js' %} <script type="text/javascript" src="{{ asset_url }}"></script> {% endjavascripts %} {% endblock %} <link rel=

CSS 常用技巧

空扰寡人 提交于 2019-12-03 02:45:47
本文转载于: 猿2048 网站➸ https://www.mk2048.com/blog/blog.php?id=hikii1c2ab 概述 相信大家在写css属性的时候,会遇到一些问题,比如说:垂直对齐,垂直居中,背景渐变动画,表格宽度自适应,模糊文本,样式重置,清除浮动,通用媒体查询,自定义选择文本,强制出现滚动条,固定头部和页脚,自己在网上看到的一篇关于css的文章,感觉这里边一些常用的css代码片段对大家很有帮助,所以我就把这篇文章分享给大家,希望大家能够喜欢。 css代码片段 1、垂直对齐 如果你用 CSS ,则你会有困惑:我该怎么垂直对齐容器中的元素?现在,利用 CSS3 的 Transform ,可以很优雅的解决这个困惑: .verticalcenter{ position: relative; top: 50%; -webkit-transform: translateY(-50%); -o-transform: translateY(-50%); transform: translateY(-50%); } 使用这个技巧,从单行文本、段落到box,都会垂直对齐。目前浏览器对 Transform 的支持是需要关注的, Chrome 4 , Opera 10 , Safari 3 , Firefox 3 , and Internet Explorer 9 均支持该属性

Wrap a text within only two lines inside div

匿名 (未验证) 提交于 2019-12-03 02:44:02
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: I want to wrap a text within only two lines inside div of specific width. If text goes beyond the length of two lines then I want to show elipses. Is there a way to do that using CSS? e.g. Sample text showing wrapping of text in only two line... Thanks 回答1: Limiting output to two lines of text is possible with CSS, if you set the line-height and height of the element, and set overflow:hidden; : #someDiv { line-height: 1.5em; height: 3em; /* height is 2x line-height, so two lines will display */ overflow: hidden; /* prevents extra lines from

2019.10.29 笔记

旧时模样 提交于 2019-12-03 02:29:45
一、网页分层效果 <!DOCTYPE html> <html> <head> <meta charset="utf-8"> <title></title> <link rel="stylesheet" type="text/css" href="2019.10.29.css"/> </style> </head> <body> <div id="big"> <div id="left"> <div id="l1">穷游体验馆</div> <div id="l2"> <div id="wenzi">免费体验名额20个</div> <div id="tiyan"></div> <div id="yincang">申请已结束</div> <img src="../image/111.png" > </div> <div id="l3">穿越时空的旅行者 猫王旅行体验官招募(开奖啦)</div> <div id="l4"> <div id="sz">499</div> <div id="jz"> 价值               元 </div> <div id="ckxq">查看详情</div> </div> <div id="l5"> <div id="ll1">近期参与</div> <div class="ll2"><img src="../image/头像1.jpg" ></div