• Resolved bobblehat

    (@bobblehat)


    Hi

    I am having problems with trying to justify the alignment of my collection. I have applied some inline css to a div tag which encloses the short tag.

    <div style="text-align: justify;">[zotpress collection="F5PD7ZC9"]</div>

    But this only justifies the right hand side of the collection.
    https://phd.hciresearchgroup.com/?page_id=386

    The first line of each citation is fine but subsequent lines are indented. I am unsure of what else to try (I am new at CSS!).

    Thank you
    p.s. This is a fab plugin.

Viewing 9 replies - 1 through 9 (of 9 total)
  • the plugin is outputting inline styles with text-indent:

    <div class='zp-Entry'>
    <div xmlns="https://www.w3.org/1999/xhtml" class="csl-bib-body" style="line-height: 2; padding-left: 2em; text-indent:-2em;"><div class="csl-entry">Wells, J. K. (2011). A NEW FRONTIER IN HEALTH TECHNOLOGY: The Role of SMS Text-Based&nbsp; Messaging as a Smoking Cessation Intervention. <i>University of Toronto Medical Journal</i>, <i>88</i>(3). Retrieved from <a title='A NEW FRONTIER IN HEALTH TECHNOLOGY: The Role of SMS Text-Based  Messaging as a Smoking Cessation Intervention' rel='external' href='https://utmj.org/ojs/index.php/UTMJ/article/viewArticle/1342'>https://utmj.org/ojs/index.php/UTMJ/article/viewArticle/1342</a></div></div>
    </div><!--Entry-->

    either there are some options/settings to control this, or you might need to hack the plugin code.

    possibly, you can try to forcefully overwrite these inline-styles;
    try and add this to the bottom of style.css of your theme:

    .csl-bib-body { padding-left: 0!important; text-indent: 0!important; }

    Thread Starter bobblehat

    (@bobblehat)

    Hi Alchymyth,

    You are a genius!
    I put the css code you suggested in my theme css and it didn’t work. So I tried putting it in zotpress.shortcode.css and it worked! I guess I am going to have to keep adding it everytime there is a new version of zotpress but it is only 1 line of code I can live with that.

    Thanks again.

    Plugin Author Katie

    (@kseaborn)

    When Zotero styles the citation according to the reference style you choose, it adds inline styles. You can overwrite these in CSS in your own theme’s stylesheet: you shouldn’t modify zotpress.shortcode.css (I highly recommend that you don’t, because if/when you next update Zotpress, it will overwrite your changes). You will probably have to use the !important modifier for these. Otherwise, you can use the Zotpress classes that come with the citation wrapper.

    Thread Starter bobblehat

    (@bobblehat)

    Hi Katie,

    I agree, but for some reason the following code in the theme.css does not work:

    div.csl-bib-body {
        padding-left: 0!important; text-indent: 0!important;
        }

    I am not sure why. I’ll keep trying…..

    Plugin Author Katie

    (@kseaborn)

    I took a look at the link, and it seems like the left padding and text indent has been removed … is it not showing for you?

    Thread Starter bobblehat

    (@bobblehat)

    Thats because I still have the code in zotpress.shortcode.css. If I take it out the padding + indent return. I have tried placing it in various places in my theme.css and it still wont work. I am quite fustrated by it.

    Plugin Author Katie

    (@kseaborn)

    Random idea: Can you try “div.zp-Zotpress div.csl-bib-body”? Might be a cascading/hierarchy problem.

    Thread Starter bobblehat

    (@bobblehat)

    Hi Katie,

    Something very strange has happened – the original

    div.csl-bib-body {
        padding-left: 0!important; text-indent: 0!important;
        }

    is working in my theme css. I was attempting to try the new code above but I didn’t need to…. I don’t know why it was not working before….

    I have a question though, with each update of zotpress the files are overwritten so I understand that it is not a good idea to put any css in the plugin files, but does theme css get overwritten with wordpress updates? If it does do I need to keep adding this code to themecss? Is there a work around for this?

    Plugin Author Katie

    (@kseaborn)

    Might have been a browser cache issue then. Glad to hear it’s working now!

    My understanding is that WordPress core updates won’t affect themes, but I imagine that if you update your theme, your changes will be overwritten.

Viewing 9 replies - 1 through 9 (of 9 total)
  • The topic ‘Display of Collection’ is closed to new replies.