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
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
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
androidjavaxmlxml-comments
<!-- 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?
Best Solution
Comments are not allowed inside tags. You have to close the tag first with «>» or «/>» and then you can add your comment there.
Related Solutions
C# – XML multiline comments in C# – what am I doing wrong
Try this
/// <summary>
/// this comment is on line 1 in the tooltip
/// <para>this comment is on line 2 in the tooltip</para>
/// </summary>
Xml – How to comment attributes inside an XML tag
No, this isn’t possible. Comments are not allowed in an XML open tag. Depending on your application, you might get away with «commenting out» the attributes by prefixing their names with «_», or you might not (if the XML is validated against a schema or all attributes are parsed). Because whitespace is allowed, and most editors support line operations, you can «comment» multiple attributes easily this way:
<element
_attr1="value1"
_attr2="value2"
_attr3="value3"
>
But these attributes are still part of the document.
Get the Reddit app
Scan this QR code to download the app now
Or check it out in the app stores
Go to django
r/django
r/django
News and links for Django developers.
Members
Online
•
by
[deleted]
Tag start not closed error DJango
Apps
[removed]
Sorry, this post was removed by Reddit’s spam filters.
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
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.
<!-- 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?
Does XML have a closing tag?
All XML Elements Must Have a Closing Tag This is not an error.
How do you end a tag in XML?
The end tag functions exactly like a right parenthesis or a closing quotation mark or a right curly brace. It contains no data of its own; it simply ends the most recent (innermost) tag with the same name. XML requires a matching end tag for each start tag.
What is start tag in XML?
XML data is a serial stream. The start tag informs the receiving software that all the incoming data will belong to this element until the matching end tag is encountered. Very often, more start tags are encountered before the end tag.
Comments are not allowed inside tags. You have to close the tag first with «>» or «/>» and then you can add your comment there.