On 2010-10-18, Vinay Sajip wrote: > On Oct 17, 9:14 pm, Guenter Milde <mi...@users.berlios.de> wrote:
>> Using a rubric instead? ... > I got it close to how I wanted it, but here's a problem: the <pre> > containing the included content has margins at top and bottom (it > seems to be a browser default, as there seems to be no CSS reset). The > DOM looks like this: ><p class="precaption rubric">My precaption</p> ><div class="highlight-python"><pre>This is an example file</pre></div> ><p class="postcaption rubric">My postcaption</p> > Now, I don't see an easy way of specifying a CSS rule which turns off > the top margin for the <pre> when there's a precaption, and the bottom > margin when there's a postcaption. Perhaps your CSS-fu is greater than > mine, can you suggest a selector for the <pre> based on "grandparent > has class precaption" and/or "parent's sibling has class postcaption"? > I thought > p.precaption > pre > should work at least to give a zero top margin for the pre, but that > has no effect (at least in Firefox). How about ".precaption.rubric > div > pre"? > Also - the paras have the style "rubric" as well as the style applied > via :class: if the attributes on the .rubric and .precaption > or .postcaption clash, I'm not sure the results will be predictable > and consistent across browsers. The selector "p.precaption.rubric", is more specific than "p.rubric" and hence gets precedence in all conformant browsers. Günter -- You received this message because you are subscribed to the Google Groups "sphinx-dev" group. To post to this group, send email to sphinx-...@googlegroups.com. To unsubscribe from this group, send email to sphinx-dev+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/sphinx-dev?hl=en.