Click here to Skip to main content
15,881,600 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
I am trying to learn django and had create a simple website but the problem is when I try to insert bootstrap the layout is display incorrectly and then I found out the problem is with this empty:

HTML
<style type="text/css"></style>


which automatic inserted( I had tried to insert empty html and the style is still there) and here is my django template html code:

HTML
    <!DOCTYPE html>
    <html lang="en">
    <head>
        <meta charset="UTF-8">
        {% include 'news/includes/header.html' %}
        {% block title %}
            <title>News</title>
        {% endblock %}
    </head>
    <body>

    {% include 'news/includes/nav.html' %}

    <div class="row">
        <div id="top-ads" class="col-md-12">fsdfsdf</div>
    </div>
    <div class="row">
        <div id="left-ads" class="col-md-2">sdf</div>
        <div id="container" class="col-md-8">
                        {% block container %}
                            {% if news_list %}
                                <ul>
                                    {% for new in news_list %}
                                        <li> <a href="{% url 'news:new' new.id %}"> {{ new.title }}</a></li>
                                    {% endfor %}
                                </ul>
                            {% endif %}
                        {% endblock %}
        </div>
        <div id="right-ads" class="col-md-2">yodsfddf</div>
    </div>

<div class="row">
    <div id="footer" class="col-md-12">sdfsdfsd</div>
    </div>

</body>
</html>


edit:
OK this is getting weirder and weirder if I try to move the <style> tag even I drop at the same position all the layout work again.

What I have tried:

-i tried delete everything the style tag is still there
-move the style tag to any position make everything work and move it back to old position is not producing the old bug
- delete id and everything work can anyone explain me why ._.
Posted
Updated 7-May-16 2:11am
v3
Comments
Sergey Alexandrovich Kryukov 7-May-16 12:06pm    
"Display incorrectly" and "weirder" is not informative. It looks like simple HTML and CSS problem, not Django.
You need to describe what you want to achieve, perhaps prototype on static HTML, and so on.
—SA
Member 12508489 8-May-16 11:09am    
oh sorry i was adding element in html using bootstrap or other css framework but the element will disappear if it on the right side and it is very random. and if i dont render in django but in plain html it work just fine.
Member 12508489 8-May-16 11:11am    
i forget to mention i move the style tag in inspect element and everything just work again. or i delete my place holder id it will also work again. which from what i think is unrelated that i don't understand how it make my element disappear

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900