PHP -> HTML tags are not rendering in html code-ThrowExceptions

Exception or error:

Screenshot

I am a high school student who is trying to make own website. If I write only block element, it works properly but If it is in html code, not working. That is like inline elements. Sometimes works, sometimes not. No idea what happened.

That is what I have written:

<?php
echo "<div>test</div><div>test</div><div>test</div><div>test</div><div>test</div>";
?>

Sorry for bad English.

How to solve:

Assuming you want it to be a vertical list instead of a horizontal one, the reason it’s going horizontal is your newsfeed class has display: flex; set, removing this will make it the same as the one at the top

enter image description here

Inside your index.css file, this is the section that’s affecting it becoming a vertical list

.newsfeed{
    width: 100%;
    height: 100%;
    padding: 1rem;
    display: flex; // this line
    flex-wrap: wrap;
    flex-flow: row wrap;
}

This should be tagged under #html or #css, as it’s not the PHP that’s causing the issue.

Leave a Reply

Your email address will not be published. Required fields are marked *