Tag start is not closed ошибка

In my HTML page, I am getting an error Tag start is not closed after the .jpg
Here’s the code:

{% load staticfiles %}

<figure>
  <img src="{% static "FLC image.jpg" %}" alt="The Pulpit Rock" width="304" height="228">
</figure>

What is wrong with code ?

asked Oct 11, 2019 at 7:00

Yantra Logistics's user avatar

4

You can close the image tag. Try the below code.

{% load staticfiles %}

<figure>
  <img src="{% static "FLC image.jpg" %}" alt="The Pulpit Rock" width="304" height="228"/>
</figure>

answered Oct 11, 2019 at 7:06

Pushprajsinh Chudasama's user avatar

That doesn’t affect the loading of the page, its because of PyCharm IDE. You can still run the runserver command and get the desired output.

If you are using the closing tags then your error will be gone but you wont get the desired output.

{% load staticfiles %}
    </img {% static "FLC image.jpg" %}" alt="The Pulpit Rock" width="304" height="228">

(or)

 {% load staticfiles %}
    <img {% static "FLC image.jpg" %}" alt="The Pulpit Rock" width="304" height="228" />

If you are using recent versions of Django try replacing {% load staticfiles %} with
{ %load static % }

So finally use the below code to get your desired result

{% load static %}
    <img {% static "FLC image.jpg" %}" alt="The Pulpit Rock" width="304" height="228" >

answered Jan 7, 2021 at 7:03

Panyam Praneeth Reddy 's user avatar

<!-- Comment --> is the way to add comments in an XML file. Doesn’t that actually means, that this part is not «compiled»?

However, when I do something like this:

<item android:id="@+id/ss3"
    android:icon="@drawable/some_icon"
    android:title="Blabla Title"
    tools:ignore="AppCompatResource"
    <!-- -->
/>

I get an error «Tag start is not closed». Why?

Andrew T.'s user avatar

Andrew T.

4,6918 gold badges43 silver badges62 bronze badges

asked Sep 7, 2014 at 21:32

user3801167's user avatar

Comments are not allowed inside tags. You have to close the tag first with «>» or «/>» and then you can add your comment there.

answered Sep 7, 2014 at 21:38

Miro Lehtonen's user avatar

2

<!-- Comment --> is the way to add comments in an XML file. Doesn’t that actually means, that this part is not «compiled»?

However, when I do something like this:

<item android:id="@+id/ss3"
    android:icon="@drawable/some_icon"
    android:title="Blabla Title"
    tools:ignore="AppCompatResource"
    <!-- -->
/>

I get an error «Tag start is not closed». Why?

Tag start not closed error DJango

Im trying to load an authentication view and writing the base.html file but on line ten, this errror will not go away. I have tried everything including looking at the source code. I cant figure it out I think i still just have to folder structure wrong which is abit confusing with django. Can anyone help me out. I suppose im suppose to have created a static/css/ folder with a base.css file but it still wont go away. Maybe this picture will help.

Archived post. New comments cannot be posted and votes cannot be cast.

Hi.

the problem I’m having with my code is line 16
<input type=»radio» id=»{{ color }}» name=»colors» value=»{{ color }}»
{% if saves.get(‘color’) == color %}checked{% endif %}>

I get an error saying tag start is not closed. Can some one help me with this?

{% extends "layout.html" %}

{% block content %}
<!--Build Area -->
<form action="" method="POST" class="wrap no-top">
    <div class="grid-100 row">
        <div class="grid-30">
            <div class="title">
                <input type="text" name="name" value="{{ saves.get('name', '') }}">
            </div>
        </div>
        <div class="grid-70">
            <div class="colors">
                {% for color in options['colors'] %}
                    <input type="radio" id="{{ color }}" name="colors" value="{{ color }}"
                           {% if saves.get('color') == color %}checked{% endif %}>
                    <label for="{{ color }}"></label>
                {% endfor %}
                <button class="btn">Update</button>
            </div>
        </div>
        <div id="bear" class="grid-100">
            <div class="bear-body"><img src="/static/img/bear_body.svg" /></div>
            <div class="head"><img src="/static/img/bear_face.svg" /></div>
            <div class="nose"><img src="/static/img/bear_nose.svg" /></div>
        </div>
        <div class="items">
        </div>
    </div>
</form>

{% endblock %}

1 Answer

Mel Rumsey

seal-mask

STAFF

Hey Daniel Mohr!
I am taking a look at the code for the section you are on and it looks like there might be an issue with code that is written in the layout.html file.
I used your code from the builder.html and while the line is red, it isn’t what is throwing the error on my end. Check your layout.html file and see if it looks similar to this:

        <div class="wrap no-bottom messages bg-{{ saves.get('colors', 'black') }}">
            {% with messages = get_flashed_messages() %}
            {% if messages %}
            <ul class="flashes">
                {% for message in messages %}
                <li>{{ message }}</li>
                {% endfor %}
            </ul>
            {% endwith %}
        </div>

If so, there needs to be an endif to close out the if statement right above the endwith. Give that a try. If that doesn’t solve the problem, send over a snapshot link to your workspace and I can dig into your code and see what the issue might be.

Понравилась статья? Поделить с друзьями:
  • Tadano ошибка e500
  • Tadano коды ошибок
  • Tachiyomi ошибка length
  • Tachiyomi ошибка 404
  • Tac код ошибки 50