重置 oschina 的CSS
嗯, 目前只是改了一下OSChina的几个主要DIV宽度而以,还是很粗糙, 以后会慢慢改进的.
------------------------------------------------------------------------------------------------------------
确实, 把一个连半成品都算不上的东西放出来, 是一种很傻逼的行为.
而昨晚,我刚好这么做了. 哪怕我早已经声明 "目前...很粗糙".
一开始,我加载远程css, 由于缓存和延时的原因, 操作起来并不方便.
一堆的 "+=" , 那是因为我经常神经发作,用 firebug, 看哪太小, 就改哪.没有头绪,没有计划. 仅仅只是为了效果早点出来而已.
好吧, 骂声一片, 我也只好计划一下, 一步步来.
1. 先计算好宽度,再调整, 而不是随便写上 500px 之类.
2. 还是会继续使用 css+= ....
3. 宽度调整到自己满意之后, 调整配色, 以 douban 为参考.
4. 压缩 css, 保持简洁.
5. 把 css 分离出来, 放到自己的服务器上,动态加载.
js 会被压缩到3行.
声明:
它只是用来重置OSChina默认的CSS.
它只是写来自己用而已, 我不对任何人负责.
如果你用得上, 你可以拿走.
如果你有建议, 请留言.
如果你看着不爽, 请飞过.
1. [代码][JavaScript]代码 http://www.huiyi8.com/ppt/
// ==UserScript==
// @name OSC
// @namespace osc
// @include http://www.oschina.net/question*
// @include http://www.oschina.net/news/*
// @include http://www.oschina.net/
// @include http://my.oschina.net/*
// ==/UserScript==
function addOscStyle() {
var head, style;
head = document.getElementsByTagName('head')[0];
if (!head) { return; }
style = document.createElement('style');
style.type = 'text/css';
style.id = 'zhi';
var css = '';
css += 'body{font-size:14px;}';
css += '.QuestionList ul li.question .qstat ul li.answer{color:#000;background:none;}';
css += '#OSC_Screen{min-width:1000px;width:98%;}';
css += '.QuestionList{min-width:770px;width:1200px;}';
css += '.QuestionListRight{width:500px;}';
css += 'a.tag{background-color:none;border:none;}';
css += '.QuestionList ul li.question h2{font-size:18px;}';
css += '.QuestionList ul li.question a.user{width:55px;height:55px;margin:auto 10px;}';
css += '.QuestionList ul li.question a.user img{width:50px;height:50px;border-radius:8px;}';
css += '.QuestionList ul li.question .Tags{width: auto; float: right;}';
css += '.QuestionList ul li.question .qbody{width:940px;}';
css += '#CatalogTags ul li a{border-radius:5px;}';
css += '.QuestionList ul li.question .Date{float:left;font-size:14px;width:auto;}';
css += '.QuestionList ul li.question h2 a{color:#333;}';
css += '.QuestionListRight .TopUsers ul li{font-size:14px;width:90px;height:76px;}';
css += '.QuestionListRight .TopUsers ul li img{width:53px;height:53px;border-radius:8px;}';
css += '.QuestionListRight #QuestionWizard{float:left;display:block;}';
css += '.QuestionListRight #TopUsers{display:block;float:left;}';
css += '.QuestionListRight #PopularTags{float:right;display:block;width:248px;display:none;}';
css += '.Question .Body{width:1200px;font-size:16px;}';
css += '.Question .Body .Content{width:1200px;}';
css += '.Question .Body .Content .detail{font-size:16px;}';
css += '.Question .Body .Vote{width:202px;}';
css += '.Question .Body .Vote a{width:200px;float:left;}';
css += '.Question .Body .Vote .vote-count-post{width:50px;float:left;width:120px;}';
css += '.QuestionReplies .Answer .user{width:55px;height:55px;margin:auto 10px;}';
css += '.QuestionReplies .Answer .user img{width:50px;height:50px;border-radius:8px;}';
css += '.QuestionReplies .Answer .body{width:1120px;margin-top:10px;}';
css += '.Question .QuestionRelations{width:500px;}';
css += '.Question .QuestionRelations #Similarity ul li a{font-size:18px;}';
css += '.Question .Title .QTitle{width:1000px;}';
css += '.Question .Title .QTitle h1{width:900px;}';
css += '.Question .Title .Asker{width:55px;height:55px;margin:auto 10px;}';
css += '.Question .Title .Asker img{width:50px;height:50px;border-radius:8px;}';
css += '.QuestionReplies .Best{background: url("../img/2011/best.gif") no-repeat scroll 80px 10px #EEFFEE}';
css += '.QuestionList ul li.question{padding:10px 0;margin:0px;}';
css += '.QuestionList ul li.question:nth-child(2n){background-color:#DDD;}';
css += '.QuestionReplies .Answer .replies ul li{padding-left:5px;}';
css += '.QuestionReplies .Answer .replies ul li:nth-child(2n-1){background-color:#DDD;border-radius:3px;}';
css += '.QuestionReplies .Answer .replies ul li a.p{font-size:14px;width:60px;height:60px;margin:10px;padding-right:10px;border-right:1px solid #555;}';
css += '.QuestionReplies .Answer .replies ul li a.p img{width:53px;height:53px;border-radius:8px;}';
css += '.QuestionReplies .Answer .replies ul li .b{padding-top:10px;width: 1000px;}';
/* news */http://www.huiyi8.com/ppt/
css += '#OSC_Content td.left{width:1200px;}';
css += '.Comments ul li .portrait{padding:10px 0 0 10px;width:80px;height:80px;}';
css += '.Comments ul li .portrait img{width:50px;height:50px;border-radius:8px;}';
css += '.Comments ul li.row_0 {background-color:#DDD;border-radius:8px;}';
/* 空间 */ppt模板
css += '#LSpace{width:450px;background-color:#DDD;border-left-width:5px;padding:10px;border-radius:8px;}';
css += '#MSpace{width:800px;}';
css += '#RSpace{width:440px;}'
css += '#Logs .Log .post{width:700px;font-size:16px;line-height:20px;}';
css += '#Logs .userlogs li.Tweet{margin-bottom:30px;}';
css += '#Logs .portrait{width:80px;height:80px;}';
css += '#Logs .portrait img{width:50px;height:50px;border-radius:8px;}';
css += '#Owner #img img{border-radius:8px;}';
css += '#Owner #oimg img{border-radius:8px;}';
css += '.Users ul li{width:80px;height:75px;}';
css += '.Users ul li img{width:50px;height:50px;border-radius:8px;}';
css += '.Users ul li a em{font-size:14px;}';
css += '.TweetRpls .p{width:80px;}';
css += '.TweetRpls .p a{width:80px;height:80px;}';
css += '.TweetRpls .p img{width:50px;height:50px;border-radius:8px;}';
css += '.TweetRpls .m{width:580px;}';
/* 首页 */
css += '.TodayNews{width:700px;}';
css += '.mod,.mod h2{border-radius:8px;}';
//css += '#DynaInfo{width:400px;}';
css += 'td[width="280"] {width:400px;}';
css += '#DynaInfo ul li .portrait{width:80px;height:80px;}';
css += '#DynaInfo ul li .portrait img{width:50px;height:50px;border-radius:5px;}';
/* 默认字体大小 */
css += '#OSC_Screen{font-size:16px;line-height:20px;}';
css += '#DynaInfo ul li .user a,#DynaInfo ul li .log{font-size:16px;line-height:20px;}';
style.innerHTML = css;
head.appendChild(style);
}
addOscStyle();
重置 oschina 的CSS的更多相关文章
- 重置默认样式 css reset
html { overflow-x:auto; overflow-y:scroll; } body, dl, dt, dd, ul, ol, li, pre, form, fieldset, inpu ...
- 页面重置样式reset.css
我把经常用到的一些页面重置样式归类到了一个.css文件中,这样可以减少代码冗余.当然还有其他的很多用处,比如h1~h5的样式全部统一的话,下面写东西很清晰很多. @charset 'utf-8'; h ...
- css reset重置样式有那么重要吗?
在以前写html代码的时候,一般都会在head里添加重置样式reset.css,其内容如下: @charset "utf-8"; html, body, div, span, ap ...
- CSS 重置默认样式
1. 概述 1.1 说明 css重置样式主要是为了让各个浏览器的CSS样式有一个统一的基准,使HTML元素样式在跨浏览器时有一致性的效果. 备注:浏览器的兼容问题,不同浏览器对有些标签的默认值是不同的 ...
- CSS工具、CSS重置(CSS Reset)
样式重置的目的是减少浏览器的不一致性,例如line-height,margin,标题的font-size大小等等.样式重置经常在CSS框架中出现. 这里的重置样式故意写的很一般,例如没有为body元素 ...
- 什么是CSS重置,有些什么作用?
CSS重置是什么? 简单的说就是重置浏览器的CSS默认属性. 为什么要重置它,有什么作用? 因为浏览器的品种很多,每个浏览器的默认样式也是不同的,比如<button>标签,在IE浏览器.F ...
- 这些HTML、CSS知识点,面试和平时开发都需要 No1-No4
系列知识点汇总 这些HTML.CSS知识点,面试和平时开发都需要 No1-No4(知识点:HTML.CSS.盒子模型.内容布局) 这些HTML.CSS知识点,面试和平时开发都需要 No5-No7(知识 ...
- 【转】}目前比较全的CSS重设(reset)方法总结
在当今网页设计/开发实践中,使用CSS来为语义化的(X)HTML标记添加样式风格是重要的关键.在设计师们的梦想中都存在着这样的一个完美世界:所有的浏览器都能够理解和适用多有CSS规则,并且呈现相同的视 ...
- Normalize.css 初识
一. 用来干嘛的 一个现代的.准备好了支持 HTML5 技术,并且要替代 CSS Reset 处理样式的理念. Normalize.css 使浏览器渲染所有元素更加一致,并且符合现代标准.它只是针对那 ...
随机推荐
- [译]GLUT教程 - 弹出菜单基础
Lighthouse3d.com >> GLUT Tutorial >> Pop-up Menus >> Popup Menus 弹出菜单也是GLUT的一部分.虽然 ...
- RocketMQ 4.3正式发布,支持分布式事务
冯嘉 作者 | 冯嘉 近日,Apache RocketMQ 4.3 版本宣布发布,此次发布不仅包括提升性能,减少内存使用等原有特性增强,还修复了部分社区提出的若干问题,更重要的是该版本开源了社 ...
- hibernate 注解之 SequenceGenerator
hibernate 注解之 SequenceGenerator https://blog.csdn.net/zgf19930504/article/details/54694807 JPA @Id 和 ...
- CSDN--字体颜色--markdown
在写blog时,想高亮某些字,但是发现markdown更改字体颜色不像word里那么方便,于是查了一下,要用一下代码进行更改字体颜色,还可以更改字体大小,还有字体格式 <font 更改语法> ...
- Hp服务器 iLO3 使用方法
首先iLO3 和ipmi什么关系?如下是我摘自:hp官网 的一段话 With HP iLO3, you can: Experience a fast Remote Console incorpora ...
- iOS 蓝牙功能 bluetooth
现将创建蓝牙工程的要点总结一下,由于工程主要涉及中心模式,所以只总结中心模式的用法 1,引入CoreBluetooth.framework 2,实现蓝牙协议,如: .h文件如下 @protocol C ...
- iOS ARC也会有内存泄露
本文转载至 http://blog.csdn.net/allison162004/article/details/38753219 iOS提供了ARC功能,很大程度上简化了内存管理的代码. 但使用A ...
- Residual (numerical analysis)
In many cases, the smallness of the residual means that the approximation is close to the solution, ...
- 2017-2018-1 20179209《Linux内核原理与分析》第九周作业
理解进程调度时机 进程调度时机 中断处理过程(包括时钟中断.I/O中断.系统调用和异常)中,直接调用schedule(),或者返回用户态时根据need_resched标记调用schedule(): 内 ...
- MAC 脚本批量启动应用
1.touch batchStart.sh 2. #!/bin/bash cd /xxx open 1.app open 2.app 3.chmod +x batchStart.sh 4.ok