Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

How do I centre a single line of text in a passage?

Completely bamboozled by the Harlowe documentation on this, and I can't find much on the forum either.

I want to centre single lines of text in a number of passages and I cannot for the life of me work it out.

Let's say the line of text is: Put me in the middle of this line

I am confused about whether I need to add some css to the story style sheet (which I've used to change the font and size) or if I'm just supposed to use special characters in the actual body copy (which I've used to bold and italicise).

My knowledge of CSS is absolutely zero so please bare in mind you're explaining something to someone with the understanding of a stone.

I need to centre a number of lines of text that are also bolded and italicised, if that makes any difference.

Thanks in advance.

Comments

  • You could try the aligner syntax?
  • Yes indeed, I've tried marking the line of text with the aligner syntax in multiple ways, but nothing happens. The thing is, I don't understand from that guide where these syntaxes should be placed. I don't even know whether I should start with a tw- before using them, which I've also tried and flopped with.
  • edited April 2016
    https://twinery.org/forum/discussion/5906/css-for-start-only#latest

    This might help you. I asked it a couple of days ago and it helped me a lot.

    Basically, this is how you use it. First of all, you will place THIS around the text you want centered.

    <div id="first-passage"> TEXT
    <div>

    This is in your passage. Give it any id, like 'centered' or 'giraffe' or 'banana'

    Then, in your CCS place this:

    #first-passage {
    text-align: center;
    }

    #ID, so #centered #giraffe #banana #whateverwordyouuse


    I have no idea how to make the fancy yellow box and all that, but it should help.
  • nsnro wrote: »
    https://twinery.org/forum/discussion/5906/css-for-start-only#latest

    This might help you. I asked it a couple of days ago and it helped me a lot.

    Basically, this is how you use it. First of all, you will place THIS around the text you want centered.

    <div id="first-passage"> TEXT
    <div>

    This is in your passage. Give it any id, like 'centered' or 'giraffe' or 'banana'

    Then, in your CCS place this:

    #first-passage {
    text-align: center;
    }

    #ID, so #centered #giraffe #banana #whateverwordyouuse


    I have no idea how to make the fancy yellow box and all that, but it should help.

    Thanks Nsnro, I'll try this out and let you know how it goes.
  • nsnro wrote: »
    https://twinery.org/forum/discussion/5906/css-for-start-only#latest

    This might help you. I asked it a couple of days ago and it helped me a lot.

    Basically, this is how you use it. First of all, you will place THIS around the text you want centered.

    <div id="first-passage"> TEXT
    <div>

    This is in your passage. Give it any id, like 'centered' or 'giraffe' or 'banana'

    Then, in your CCS place this:

    #first-passage {
    text-align: center;
    }

    #ID, so #centered #giraffe #banana #whateverwordyouuse


    I have no idea how to make the fancy yellow box and all that, but it should help.

    Woohoo, it worked! (A little caveat for anyone else reading this looking for answers, don't name your div id= an actual number like 8, it doesn't like that. Took a while to work that one out) I can't thank you enough, nsrnro. This should help point me in the right direction of many other appearance problems.
  • Oh, one other thing, while trying to work out what was wrong when I'd given the div id as "8" instead of "eight", I stuck a / inside the closing <div> (thus </div>). I don't know if it's absolutely necessary but I left it in and once it was working, a quick look up for the text command to indent suggested it should be in closing <XXX> statements (syntax? god knows what you'd call that).
  • @Mondayding

    To answer your comment about where to place the aligner syntax, it goes on the line before the text that you want to start effecting with it. The aligner will effect all lines of text after it until you use a different aligner.
    This line should be aligned to the left
    
    =><=
    Put me in the middle of this line
    
    This line should also be centred
    
    <==
    This line should be aligned to the left again
    
  • greyelf wrote: »
    @Mondayding

    To answer your comment about where to place the aligner syntax, it goes on the line before the text that you want to start effecting with it. The aligner will effect all lines of text after it until you use a different aligner.
    This line should be aligned to the left
    
    =><=
    Put me in the middle of this line
    
    This line should also be centred
    
    <==
    This line should be aligned to the left again
    

    You know what, after I read your comment, greyelf, I went back to look at the harlow manual, because I was convinced that it was wrong and had <==> as entered. Turns out I was reading it wrong all the time. A burning shame sears each cheek. Thank you, greyelf.
Sign In or Register to comment.