嗯, 目前只是改了一下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的更多相关文章

  1. 重置默认样式 css reset

    html { overflow-x:auto; overflow-y:scroll; } body, dl, dt, dd, ul, ol, li, pre, form, fieldset, inpu ...

  2. 页面重置样式reset.css

    我把经常用到的一些页面重置样式归类到了一个.css文件中,这样可以减少代码冗余.当然还有其他的很多用处,比如h1~h5的样式全部统一的话,下面写东西很清晰很多. @charset 'utf-8'; h ...

  3. css reset重置样式有那么重要吗?

    在以前写html代码的时候,一般都会在head里添加重置样式reset.css,其内容如下: @charset "utf-8"; html, body, div, span, ap ...

  4. CSS 重置默认样式

    1. 概述 1.1 说明 css重置样式主要是为了让各个浏览器的CSS样式有一个统一的基准,使HTML元素样式在跨浏览器时有一致性的效果. 备注:浏览器的兼容问题,不同浏览器对有些标签的默认值是不同的 ...

  5. CSS工具、CSS重置(CSS Reset)

    样式重置的目的是减少浏览器的不一致性,例如line-height,margin,标题的font-size大小等等.样式重置经常在CSS框架中出现. 这里的重置样式故意写的很一般,例如没有为body元素 ...

  6. 什么是CSS重置,有些什么作用?

    CSS重置是什么? 简单的说就是重置浏览器的CSS默认属性. 为什么要重置它,有什么作用? 因为浏览器的品种很多,每个浏览器的默认样式也是不同的,比如<button>标签,在IE浏览器.F ...

  7. 这些HTML、CSS知识点,面试和平时开发都需要 No1-No4

    系列知识点汇总 这些HTML.CSS知识点,面试和平时开发都需要 No1-No4(知识点:HTML.CSS.盒子模型.内容布局) 这些HTML.CSS知识点,面试和平时开发都需要 No5-No7(知识 ...

  8. 【转】}目前比较全的CSS重设(reset)方法总结

    在当今网页设计/开发实践中,使用CSS来为语义化的(X)HTML标记添加样式风格是重要的关键.在设计师们的梦想中都存在着这样的一个完美世界:所有的浏览器都能够理解和适用多有CSS规则,并且呈现相同的视 ...

  9. Normalize.css 初识

    一. 用来干嘛的 一个现代的.准备好了支持 HTML5 技术,并且要替代 CSS Reset 处理样式的理念. Normalize.css 使浏览器渲染所有元素更加一致,并且符合现代标准.它只是针对那 ...

随机推荐

  1. stage3D基础三------什么是AGAL(转)

    原文链接 http://www.adobe.com/cn/devnet/flashplayer/articles/hello-triangle.html 在本文中,你将研究一个能够正常运行的基于Sta ...

  2. Unity3D占用内存太大怎么解决呢?

    最近网友通过网站搜索Unity3D在手机及其他平台下占用内存太大. 这里写下关于Unity3D对于内存的管理与优化. Unity3D 里有两种动态加载机制:一个是Resources.Load,另外一个 ...

  3. Unity动态字体在手机上出现字体丢失问题解决

    在我们游戏的开发过程中,在部分手机上运行游戏的时候,出现了字体丢失的问题,出问题的手机似乎用的都是高通芯片. 使用的unity是4.2.0版本,ngui是3.4.9版本. 在unity的论坛及unit ...

  4. [转]const指针与指向const的指针

    经常忘记,保存一下.. #include <iostream> using namespace std; int main(int argc, char *argv[]) { ; int ...

  5. mapreduce学习资料

    http://blog.csdn.net/tianjun2012/article/category/6794531 http://blog.csdn.net/tianjun2012/article/d ...

  6. C++11 并发指南三(Lock 详解)(转载)

    multithreading 多线程 C++11 C++11多线程基本使用 C++11 并发指南三(Lock 详解) 在 <C++11 并发指南三(std::mutex 详解)>一文中我们 ...

  7. 从零开始学android -- notification通知

    目前有三种通知 第一种是普通通知 看看效果 布局什么的太简单了我就不放在上面了给你们看核心的代码就行了 里面的   int notificationID = 1; //设置点击通知后的意图 Inten ...

  8. 中国版Office 365混合部署功能

    中国版Office 365混合部署功能已经正式上线了(原计划6月份推出),虽然支持的类型不如国际版的Office 365全面,但这也标志了该功能与之前相比,已经迈出了重要一步.目前中国版Office ...

  9. Warning: (3719, “‘utf8’ is currently an alias for the character set UTF8MB3, which will be replaced by UTF8MB4 in a future release. Please consider using UTF8MB4 in order to be unambiguous.”)

    [1]本地版本 Mysql 8.0.12 创建表SQL: DROP TABLE IF EXISTS students; CREATE TABLE `students` ( `sId` ) UNSIGN ...

  10. mysql windows安装

    http://blog.csdn.net/tossgoon/article/details/44412491 1.从该地址http://dev.mysql.com/downloads/mysql/中选 ...