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

RichTextFields are not getting css #57

Open
HenryMehta opened this issue Dec 1, 2021 · 0 comments
Open

RichTextFields are not getting css #57

HenryMehta opened this issue Dec 1, 2021 · 0 comments

Comments

@HenryMehta
Copy link

I have an email I'm sending which includes some django-ckeditor RichTextFields.

My file is of the form

{% load static css_inline thumbnail cms_tags scoring_tags inlinecss %}
<!doctype html>
<html lang="en">

<head>
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    ...
</head>
{% inlinecss 'dist/css/shortlist.css' %}
<body>
    <table align="center">
        <tbody>
            <tr>
                <td  class="shortlist">
                    <a href="some_url" class="shortlist"><img id="site-logo" src="path_to_image.png" alt="alt text" width="180px"></a>
                </td>
            </tr>
        </tbody>
    </table>
    <table width="591" border="0" align="center" cellpadding="6" cellspacing="3">
        <tbody>
            <tr>
                <td  class="shortlist" style="padding:10px 0px 0px 5px">
                    <span class="shortlist">
                            Dear {{ object.user.first_name }},
                    </span>
                </td>
            </tr>
            <tr>
                <td  class="shortlist" style="padding-bottom:15px;" >
                    <p class="shortlist">{{ object.auto_intro|safe }}</p>
                    {{ object.intro_email_text|safe }}
                </td>
            </tr>
    </table>
</body>
{% endinlinecss %}
</html>

object.intro_email_text is a RichTextField and no style information appears in the fields. object.auto_intro| is a simple text string

The css file is just this

body, p, td, span {
    font-size:12px;
    font-family: Arial, Helvetica, sans-serif;
    line-height: 1.6;
    color: #000000
}

.shortlist {
    font-family: Arial, Helvetica, sans-serif;
    font-size:12px;
}

.btn-email {
    display: block;
    text-decoration: none;
    background-color: #FF7800;
    color: white;
    cursor: pointer;
    line-height: 50px;
    text-align: center;
    margin: 0px;
    height: 50px;
    padding: 0px 33px;
    border-radius: 5px;
    width: 100%;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    font-weight: bold;
}

Is there a way to get the style into the RichTextFields?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant