I'm using Python to make an HTML. Basically, my code loads 5 images into a row if a search has results and returns 2 strings if there's no result depending on what the error might be. If I do get 5 images, I want them to be evenly aligned in a row. The following is one HTML I got.
<!DOCTYPE html>
<html>
<head>
<title>DC Menu</title>
<style> * {
box-sizing: border-box;
}
.column {
float: left;
width: 20%;
padding: 5px;
}
/* Clearfix (clear floats) */
.row::after {
content: "";
clear: both;
display: table;
}</style>
</head>
<body>
<h1>Today's DC Menu</h1>
<p>
<h3>>>> Today's Breakfast has: apple</h3>
</p>
<p>
<a href="https://www.google.co.in/search?q=apple&source=lnms&tbm=isch">apple</a>
</p>
<div class="row">
<div class="column">
<img alt="('https://www.apple.com/ac/structured-data/images/knowledge_graph_logo.png?201606271147', 'png')" src="https://www.apple.com/ac/structured-data/images/knowledge_graph_logo.png?201606271147" style="width:100%">
</div>
<div class="column">
<img alt="('https://www.apple.com/ac/structured-data/images/knowledge_graph_logo.png?201606271147', 'png')" src="https://as-images.apple.com/is/image/AppleInc/aos/published/images/o/g/og/default/og-default?wid=1200&hei=630&fmt=jpeg&qlt=95&op_usm=0.5,0.5&.v=1525370171638" style="width:100%">
</div>
<div class="column">
<img alt="('https://www.apple.com/ac/structured-data/images/knowledge_graph_logo.png?201606271147', 'png')" src="https://www.apple.com/ac/structured-data/images/open_graph_logo.png?201809210816" style="width:100%">
</div>
<div class="column">
<img alt="('https://www.apple.com/ac/structured-data/images/knowledge_graph_logo.png?201606271147', 'png')" src="https://cdn.vox-cdn.com/thumbor/DqZ_YBYBAVZtBF1PFi2fj4DOszM=/0x0:1280x800/1200x800/filters:focal(538x298:742x502)/cdn.vox-cdn.com/uploads/chorus_image/image/61897327/apple8.0.png" style="width:100%">
</div>
<div class="column">
<img alt="('https://www.apple.com/ac/structured-data/images/knowledge_graph_logo.png?201606271147', 'png')" src="https://upload.wikimedia.org/wikipedia/commons/thumb/f/fa/Apple_logo_black.svg/250px-Apple_logo_black.svg.png" style="width:100%">
</div>
</div>
<p>
<h3>>>> Today's Lunch has: xdgbdgtnstnjseth</h3>
</p>
<p>
<a href="https://www.google.co.in/search?q=xdgbdgtnstnjseth&source=lnms&tbm=isch">xdgbdgtnstnjseth</a>
</p>
<div class="row">
<div class="column">
<img alt="Your search has no return." src="Y" style="width:100%">
</div>
</div>
<p>
<h3>>>> Today's Dinner has: hateç</h3>
</p>
<p>
<a href="https://www.google.co.in/search?q=hateç&source=lnms&tbm=isch">hateç</a>
</p>
<div class="row">
<div class="column">
<img alt="The dish name has weird letters that cannot be searched directly." src="T" style="width:100%">
</div>
</div>
</body>
</html>
And I got the webpage looks like this:
I'm satisfied with the first several lines. However, for the line of "Today's Dinner..." and the line below it, why they didn't start from a new paragraph but stick to the end of the previous "Your search has no return"? I think my misunderstanding is on the HTML structure and I don't really worry about the Python part once I know what the correct HTML should look like. Thank you!
tag right above the opening of the
tag
– VG98 Jan 01 '19 at 21:09` tags. – Aaditya Maheshwari Jan 01 '19 at 21:11