Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Centre on screen vertically #115

Open
Drmillsy opened this issue Aug 2, 2023 · 1 comment
Open

Centre on screen vertically #115

Drmillsy opened this issue Aug 2, 2023 · 1 comment
Labels
enhancement New feature or request good first issue Good for newcomers

Comments

@Drmillsy
Copy link

Drmillsy commented Aug 2, 2023

*I would love an option to centre the front and back of the cards on teh centre of the screen vertically, its already horizontally aligned but it sits at the top of the screen.

@3ter
Copy link
Collaborator

3ter commented Aug 18, 2023

You could use something like this: https://www.reddit.com/r/Anki/comments/ek60gl/gif_a_way_to_center_the_contents_on_your_cards/

You have to edit the note type:

  • For both front and back you enclose the contents with divs e.g. like this on the front
<div class="vertically_centered">

{{#Title}}<h3 id="myH1">{{Title}}</h3>{{/Title}}
{{#Question}}<p>{{Question}}</p>{{/Question}}

<div class="tappable">
    <table style="border: 1px solid black" id="qtable"></table>
</div>

<div class="hidden" id="Q_solutions">{{Answers}}</div>
<div class="hidden" id="Card_Type">{{QType (0=kprim,1=mc,2=sc)}}</div>

<div class="hidden" id="Q_1">{{Q_1}}</div>
<div class="hidden" id="Q_2">{{Q_2}}</div>
<div class="hidden" id="Q_3">{{Q_3}}</div>
<div class="hidden" id="Q_4">{{Q_4}}</div>
<div class="hidden" id="Q_5">{{Q_5}}</div>

</div>
  • And in the styling tab you add the respective css class
.vertically_centered:not(.mobile) {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  display: -webkit-box;
  -webkit-box-align: stretch;
  -webkit-box-pack: center;
  -webkit-box-orient: vertical;
}

@3ter 3ter added good first issue Good for newcomers enhancement New feature or request labels Aug 18, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request good first issue Good for newcomers
Projects
None yet
Development

No branches or pull requests

2 participants