question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Cannot center-justify text in nodes?

See original GitHub issue

I’m trying to replicate part of the diagram found here:

http://echo.mpiwg-berlin.mpg.de/content/scientific_revolution/harriot/harriot_manuscripts/maps/9.2.3_colour.pt

(which I myself made with a graphical editor).

Here is how I started:

graph LR;
      189[Add MS<br/>6789<br/>f. 189];
      188[Add MS<br/>6789<br/>f. 188];
      189-->188;

classDef page text-align:center;
class 188,189 page;

But I cannot get the text in each box to align in the center. I’ve been able to pass on all kinds of other CSS attributes using this format; but none of the text-align attributes seem to have any effect.

Issue Analytics

  • State:closed
  • Created 7 years ago
  • Comments:8 (1 by maintainers)

github_iconTop GitHub Comments

2reactions
RobertGouldingcommented, Oct 18, 2016

Thank you! But how do I do that with the stand-alone mermaid? That is, I’m just running it from the command line to produce images.

1reaction
mlbernauercommented, Aug 15, 2017

@RobertGoulding you can use <center> for example… A[<center>My centered text</center>]-->B[<center>Some other text<br>with a line break</center>]

Read more comments on GitHub >

github_iconTop Results From Across the Web

Cannot center-justify text in nodes · Issue #958 · mermaid-js ...
This does not provide a solution to how to center-justify text in nodes and, it appers to be, there is none. It's just...
Read more >
text-align: center not working - Stack Overflow
text -align: center affects pure text nodes as well as child elements that have display: inline; or display: inline-block; .
Read more >
Centering text in TikZ tree node - TeX - LaTeX Stack Exchange
The culprit seems to be text width . If you change it to minimum width , then the texts will be centered properly....
Read more >
[upstream] Alignment/justify buttons not appearing for ... - Drupal
we have an issue with patch for that but I can't find it anymore sadly. :( ... <p class="text-align-left text-align-center text-align-right ...
Read more >
Text Align in CSS – How to Align Text in Center with HTML
In this article, I will show you how to use the text-align property in CSS and show you how to vertically align text....
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found