I’m making flashcards for the Anki app on my phone, and I’m using them to help me study for Cisco certifications. I wanted to use basic HTML to simulate what a command-line interface looks like. If you look at the following link, you’ll see an example. Just scroll to the bottom of the page and you’ll see “show vtp password”:
I was trying to declare the background color using only HTML and no CSS, but after reading more of Anki’s documentation it appears they do support CSS, and you can specify that only certain cards (in my case it would be the command syntax cards) have specific features.
All that is missing is the background declaration. But since I can do this in CSS, I was hoping someone can point me in the right direction of using CSS.
This isn’t my strong suit, so I appreciate any help. I want to make sure that when I change from purple to green text, it doesn’t begin on a new line. I think I can use a span HTML tag to do this instead of p tags, but how can I do this in CSS? I want to minimize the amount of code on each flashcard.
It’s all good - I was reading the documentation for the program and there is no reason why I can’t use CSS. I’m just trying to figure out the best way to enclose the text in a black box. I wonder if it is more efficient to make the graphic in Photoshop and save it as a low-res gif instead? Probably still more efficient to use HTML/CSS…
Where on your computer is the data for the cards stored and in what format? I downloaded the program to my PC and installed it, but have not had time to figure out the internals such as were one would include CSS files. The cards seem to be in a database of some type.
A link to any online dev files (that explains how to customize the cards) would be a time saver.
Though you generally would not put everything in a span to style it. You should have a default color set and style only what differs from that.
As for your css selectors, you don’t want to state the element as well as the class like you did.
So it’s cmd-p { color:purple;} not span.cmd-p { color:purple; }
Thanks for checking this out ronpat…I’ll check out the documentation now to see where to put the CSS. If it helps, when I create cards, I simply create an excel sheet with two columns (Q and A). I export the Excel to a tab-delimited notepad that is in UTF-8 format, and import this text document into Anki Desktop. That is how I create my cards.
Of course, in the spreadsheet that I use to create my cards I have many more columns, such as the number of the card, the tags, etc., but when it comes time to generating the actual cards, I only use the columns “Question” and “Back Finished”.
It sounds like I should create a new column in my spreadsheet so that I can identify the card as a command-line question, so I can tag it as such, and style it with CSS.
So I should be using a div here with background:#000; ? I don’t want the entire card to have a black background; I want to set a min height and width, and have the box grow to accomodate the text if I need to entet multiple lines.