嗯, 目前只是改了一下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. Shader编程教程

    2010-05-13 11:37:14|  分类: DirectX 3D学习|举报|字号 订阅     Shader编程教程1-环境光照 您好,欢迎来到XNA Shader教程1.我的名字叫Petri ...

  2. oracle查看用户有哪些权限和角色

    select * from dba_sys_privs t where t.grantee='HR';select * from dba_role_privs t where t.grantee='H ...

  3. [译]GLUT教程 - 每秒帧数

    Lighthouse3d.com >> GLUT Tutorial >> Extras >> Frames per Second 你的程序实际上跑得多快? 有时我们 ...

  4. 搭建属于你的家庭网络实时监控–HTML5在嵌入式系统中的应用&#183;高级篇

    *本文已刊登在<无线电>2014年第6期 <搭建属于你的在线实时採集系统>中已经对HTML5平台有了初步的认识,并基于此向大家展示了怎样将採集到的数据上传至网络.实现实时观測. ...

  5. CIA 读书笔记

    对此书的评价只有八个字:粗制滥造,到处粘贴. 对于通过表情识别人情绪的教程,最好要有图,图很重要,也最好有案例.

  6. 在mac上独立安装PHP环境

    1.http://dditblog.com/blog_418.html 2.http://www.jianshu.com/p/0456dd3cc78b

  7. python高级-------python2.7教程学习【廖雪峰版】(四)

    2017年6月9日17:57:55 任务: 看完高级部分 笔记:1.掌握了Python的数据类型.语句和函数,基本上就可以编写出很多有用的程序了.2.在Python中,代码不是越多越好,而是越少越好. ...

  8. 【BZOJ4548】小奇的糖果 set(链表)+树状数组

    [BZOJ4548]小奇的糖果 Description 有 N 个彩色糖果在平面上.小奇想在平面上取一条水平的线段,并拾起它上方或下方的所有糖果.求出最多能够拾起多少糖果,使得获得的糖果并不包含所有的 ...

  9. URAL 1010 Discrete Function【简单暴力】

    链接:  http://acm.timus.ru/problem.aspx?space=1&num=1010 http://acm.hust.edu.cn/vjudge/contest/vie ...

  10. iOS开发之获取系统相册ALAssetLibrary

    注:当你选择看这篇博客时想必你的应用还支持iOS8一下系统,如果你的应用要求最低版本大于iOS8,建议使用PhotoKit框架,效率更高 ALAssetsLibrary包含,ALAssetsLibra ...