站长百科 | 数字化技能提升教程 数字化时代生存宝典
首页
数字化百科
电子书
▼
建站程序
开发
服务器
办公软件
开发教程
▼
服务器教程
软件使用教程
运营教程
热门电子书
▼
CSS教程
WordPress教程
导航
程序频道
推广频道
网赚频道
人物频道
网站程序
网页制作
云计算
服务器
CMS
论坛
网店
虚拟主机
cPanel
网址导航
WIKI使用导航
WIKI首页
热点词条
最新资讯
网站程序
站长人物
页面分类
使用帮助
编辑测试
创建条目
网站地图
站长百科导航
站长百科
主机侦探
IDCtalk云说
跨境电商导航
WordPress啦
站长专题
网站推广
网站程序
网站赚钱
虚拟主机
cPanel
网址导航专题
云计算
微博营销
虚拟主机管理系统
开放平台
WIKI程序与应用
美国十大主机
编辑“
WordPress:Finding Your CSS Styles
”(章节)
人物百科
|
营销百科
|
网赚百科
|
站长工具
|
网站程序
|
域名主机
|
互联网公司
|
分类索引
跳转至:
导航
、
搜索
警告:
您没有登录。如果您做出任意编辑,您的IP地址将会公开可见。如果您
登录
或
创建
一个账户,您的编辑将归属于您的用户名,且将享受其他好处。
反垃圾检查。
不要
加入这个!
==启动 CSS 检测== 让我们从启动 CSS 检测开始。你知道了问题在哪,你只是不能''找出''问题,在上面的例子中,你需要找的是不定边线。 Begin by carefully examining a generated page (or test page) and look for some identifying text in the sidebar, near the errant border. Let's say that listed in the sidebar, you have a post title called "All About Harry". You know you'll find that title in your sidebar when you view the page's source code. 从仔细检查生成的页面(或者是测试页面)开始,在边栏中不定边线旁边寻找一些识别文本。比方说在边栏的列表中有一个文章名为"All About Harry",你在查看页面源代码时就知道在边栏中也同样会看到它。 To view a page's source code, go up to the '''menu bar''' of your browser and choose '''VIEW > PAGE SOURCE or VIEW > SOURCE'''. A page will pop up featuring the source code of the page. 想查看源代码,找到浏览器上部的'''menu bar''',选择'''VIEW > PAGE SOURCE or VIEW > SOURCE'''。源代码页面就会显示出来了。 Use your handy detective tool, '''Ctrl+F''', to activate your search. Type in "all about harry" and click '''FIND'''. Odds are, unless you have the words "all about harry" in your post, it will take you to the first showing of the phrase "all about harry" which is probably in your sidebar. If not, hit FIND again until you've found the right phrase in the right area. 使用手边的检测工具,'''Ctrl+F''',来激活你的搜索,输入"all about harry"然后单击'''FIND'''.除非"all about harry"这句话在你的帖子内,否则它会显示出第一个出现"all about harry"的地方,很可能是你的边栏。如果没有,请再次点击FIND直到你在正确的地方找到合适的词。 If you are using Internet Explorer, an alternate method is to use the Internet Explorer Developer Toolbar, which allows you to visually see and select the elements, IDs, and classes on the page. It displays the elements within the hierarchy of the page, their CSS attributes, and can outline DIVs, tables, etc. You can download the Toolbar from [http://www.microsoft.com/downloads/details.aspx?FamilyID=e59c3964-672d-4511-bb3e-2d5e1db91038&DisplayLang=en Microsoft]. 如果你正在使用Internet Explorer,另一种方法就是使用Internet Explorer扩展工具条,你可以在页面上看见并且可以选择元素,ID,类别。它分层显示出页面的元素,它们的CSS属性,和DIVs, tables, 等等的轮廓。你可以从[http://www.microsoft.com/downloads/details.aspx?FamilyID=e59c3964-672d-4511-bb3e-2d5e1db91038&DisplayLang=en Microsoft]下载这个工具条。 Once you've found the phrase, it's time to play CSS detective. Look up through the code from the phrase "All About Harry" for one of two things. It will look something like either of these, using words like '''sidebar''', '''menu''', or '''sidecolumn''': <pre><div id="sidebar"> or <div class="sidebar"></pre> This is the main section that contains your sidebar menu. You've found the first suspect. 你一旦找到这个词语之后,就是启动CSS检测的时候了。查找从"All About Harry"开始的代码,它会检查一些类似的词,使用如'''sidebar''', '''menu''', 或者'''sidecolumn'''这些词语: <pre><div id="sidebar"> 或 <div class="sidebar"></pre> Now, open your <tt>style.css</tt> file and do another search for '''sidebar''' or whatever the resulting name was that you uncovered. It is usually identified in two ways: <pre>#sidebar or .sidebar</pre> 现在,打开你的<tt>style.css</tt>文件,然后再做一次对'''sidebar'''的搜索,或者别的什么你没有涵盖的词语,通常有两种结果: <pre>#sidebar 或 .sidebar</pre> Look in the styles under these CSS '''selectors''' and see if there is a mention of border, often looking something like this: <pre>#sidebar {position: relative; float: right; width: 170px; color: blue; font-size: 90%; border-right: solid 1px blue; }</pre> 查看CSS'''selectors'''中的样式,看是否有提到边线,通常会看到这样的结果: <pre>#sidebar {position: relative; float: right; width: 170px; color: blue; font-size: 90%; border-right: solid 1px blue; }</pre> There is your border, the criminal! If this is the guilty party, delete the reference to the border and you are good to go. 那就是你的边线,问题的根源。如果这就是问题的来源,那么把这段有关边线的代码删除,一切就正常了。 If it isn't, the hunt continues. 如果不是,搜索继续。 Sometimes the culprit is the one you least suspect. Maybe the border is not caused by the obvious suspect, the ''sidebar'', but by the '''content''' section. Return to the generated page source code and search for the first words of your post. Look above that for something like: <pre><div id="content"></pre> 有时问题就出在你最最忽略的地方。可能边线不是由某些明显的东西''sidebar''造成的,而是由于'''content'''这部分造成的。回到生成页面的代码,找到你的文章的第一句话,然后向上查看如下内容: <pre><div id="content"></pre> It could be called '''content''', '''page'''. '''post''', '''maincolumn''', '''widecolumn''', or have another alias, but it should be the CSS ''container'' that holds your post information. Now, go back to the style sheet and check to see if there is a border in that section. 可能会被叫做'''content''', '''page'''. '''post''', '''maincolumn''', '''widecolumn'''或者别的名字,但是都应该是CSS ''容器''掌握着你的文章的信息。现在回到样式表,查看在那部分里是否有边线。
摘要:
请注意,您对站长百科的所有贡献都可能被其他贡献者编辑,修改或删除。如果您不希望您的文字被任意修改和再散布,请不要提交。
您同时也要向我们保证您所提交的内容是您自己所作,或得自一个不受版权保护或相似自由的来源(参阅
Wordpress-mediawiki:版权
的细节)。
未经许可,请勿提交受版权保护的作品!
取消
编辑帮助
(在新窗口中打开)