css - 如何在 Doxygen 中更改\section,\subsection 等的字体大小?

标签 css formatting doxygen

我想更改 doxygen 的 html 输出的\section 和\subsection 字体大小。此外,我想在样式中的部分和(子)小节中添加数字:

1 第 1 节

1.1 小节 1.1

1.1.1小节

从手册中我发现我应该复制 customdoxygen.css 并更改它以代表我的需要。不幸的是,我对 css 一无所知,无法找到负责\section 和\subsection 字体大小的命令。

this question ,据说应该定义一个 h4 标签。那是对的吗?我该怎么做?

最佳答案

这是你要做的: 在配置doxyfile中:

HTML_EXTRA_STYLESHEET = mystylesheet.css

此样式表中的设置会覆盖其他样式表中的设置。 然后创建文本文件 mystylesheet.css。

要更改字体大小,请将 h1 的样式添加到 mystylesheet.css。例如:

h1 { font-size:1.5em; }

要处理带编号的标题,您可以使用带有 CSS 计数器的样式。这是一个例子:

<!doctype html>
<html>
<head>
<style>
body {counter-reset: h2}
h2 {counter-reset: h3}
h3 {counter-reset: h4}
h4 {counter-reset: h5}
h5 {counter-reset: h6}

h2:before {counter-increment: h2; content: counter(h2) ". "}
h3:before {counter-increment: h3; content: counter(h2) "." counter(h3) ". "}
h4:before {counter-increment: h4; content: counter(h2) "." counter(h3) "." counter(h4) ". "}
h5:before {counter-increment: h5; content: counter(h2) "." counter(h3) "." counter(h4) "." counter(h5) ". "}
h6:before {counter-increment: h6; content: counter(h2) "." counter(h3) "." counter(h4) "." counter(h5) "
</style>
</head>  
<body>
<h1> Demonstration of Numbered Headings</h1>
<p>To create numbered headings, you can use CSS counters. For details search for "CSS counters".</p>
<p>In this example the numbered headings begin from heading level 2. Heading level 1 is reserved for the page title. </p>
<h2>Setting Up the Style</h2>
The css style properties specify when to reset the heading level counter, and when to increment it. 
<h3>Creating the Counter</h3>
<p>You can create a named counter with the counter-reset property.  The value of counter-reset is the name of the counter. For details search for "CSS counter-reset".</p>
<h3>When Does the Value Reset</h3>
<p>It resets when the tag appears of which the counter-reset is a property.</p>
<h2>Displaying the Counters</h2>
<p>The counters are displayed by specifying a before selector for the heading levels, and styling it with content that includes counters for the heading levels preceding the current level, as well as the current level.</p>
<h3>Where is the Example?</h3>
<p>In the style tag of this page.</p>
<h4>I Can't See It</h4>
<p>Use the source, Luke.</p>
</body>
</html>  

关于css - 如何在 Doxygen 中更改\section,\subsection 等的字体大小?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/29970599/

相关文章:

c++ - Doxygen 1.8.13 忽略具有默认值的参数 (C++)

html - 非兄弟元素的 CSS `first of type`

css - 表格中的 TD 边框,在 IE8 中不显示

jquery - 在 setInterval 期间使用键更改变量

formatting - 短信格式

whitespace - 如何在 Doxygen 中的注释中添加空格

shell - 使用 shell 将字符串 "//"替换为 "///"

CSS - 4列(fixed fluid fluid fixed)

c - 在 C 中格式化日历

javascript - 风格化文本区域看起来像单独的输入框