In my first column, the last link in my initial for
loop leads to the header in the second column where another for
loop is present. Oddly enough, the link for Broccoli
also creates a hyperlink in the text Previous Ads
, which is not intended.
https://i.sstatic.net/ajofo.png
There should be no link within the header
of Previous Ads
. I suspect this issue stems from an HTML problem within a Flask template. Here's a snippet of my code:
{% extends "layout.html" %}
{% block main %}
<form action="{{ url_for('searched') }}" method="post">
<div class="form-group">
<input placeholder="Search food" type ="search" name="search"/>
<button class="btn btn-success" type="submit" name="action"><span class="glyphicon glyphicon-search"></span></button>
</div>
</form>
<div class="row">
<div class="column">
<h2>Live Ads</h2>
<dl class="desc-info" style ="text-indent: 15%">
{% for ad in ads %}
<a href="{{ url_for('ads', image_key = ad.image_key, posts = ad.image_key)}}">{{ad.title}}
{% endfor %}
</dl>
</div>
<div class="column">
<h2>Previous Ads</h2>
<dl class="desc-info" style ="text-indent: 15%">
{% for inactive_ad in inactive_ads %}
<dt><a href="{{ url_for('ads', image_key = inactive_ad.image_key, posts = inactive_ad.image_key)}}">{{inactive_ad.title}}</dt>
{% endfor %}
</dl>
</div>
</div>
All other links are functioning correctly. The desc-info
class merely aligns text to the left. A similar code structure works fine on another page, with the only variance being that the for
loop is within the second column instead of containing rows of href
links.