格式化CP文章 [英] Formatting CP articles

查看:108
本文介绍了格式化CP文章的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

有人知道如何为代码段块创建标签吗?我希望该代码块(< pre>)的左侧带有标签(例如文件名),并且它应该与右侧的折叠"文本处于同一级别,并且其尺寸也应相同. & lt; pre& gt;上有"title"属性标签,但着色器将忽略它.我记得我前一段时间在CP上看到过这种格式,但是现在我找不到任何具有这种标签布局的文章.有什么帮助吗? :((<

Anybody know how to create label for code snippet block? I want that code block (<pre>) have label attached (say the filename) on the left and it should be on the same level as the "Collapse" text on the right, and also it should be the same small size. There is "title" attribute on &lt;pre&gt; tag but it is ignored by colourizer. I remember that I saw such formatting on CP some time ago but now I can''t find any article that have such label layout. Any help? :((

推荐答案

您可能需要调整HTML.例如,我能够实现类似您想要的功能(并非完全如此):


测试:
You might have to tweak the HTML. For example, I was able to achieve something like what you want (not exactly though):


Test:
int x = 5;


使用此代码:

<br />
Test: <pre lang="text" style="width: 70%; float: right; display: inline;">int x = 5;</pre>
<div style="clear: left;"></div>


我不是CSS专家,所以其中有些也许很奇怪,但是您明白了.我不确定CP有什么便利的方法可以让您为代码块指定标题/标题,因此您可能必须自己修改它.您也可以在文章写作论坛中提问.如果该功能不存在,您可以在网站错误/建议论坛中提问.


I''m not a CSS guru, so some of that is probably weird, but you get the idea. I''m not sure there is a way that CP facilitates that allows you to give a code block a title/header, so you may have to hack it yourself. You could also ask in the article writing forum. And if the functionality doesn''t exist, you could ask in the site bugs/suggestion forum.


这篇关于格式化CP文章的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆