-
philipperoussel
Hi,
I am curious.
How is it that </div> elements can exist on their own on my website, without the corresponding <div> at the beginning of the HTML block? Or is it that <div> simply isn’t a valid element to be used?
<!– /wp:paragraph –></div>
<!– /wp:generateblocks/element –></div>Thanks for your help,
Philippe
-
Alvind
Hi Philippe,
In this context,
<div>is a perfectly valid HTML element. It’s just a container for grouping content on a page.What you’re seeing is normal for WordPress/Gutenberg. The opening
<div>usually gets generated earlier by the block system, so if you’re only looking at part of the code, you might just see the closing</div>without its match nearby.The
<!-- /wp:paragraph -->bits are Gutenberg’s own comments for the editor. They don’t show up as actual content on the page.So unless the layout is visibly broken, this isn’t anything to worry about.
-
philipperoussel
Hi Alvind,
“In this context, <div> is a perfectly valid HTML element.”
This is my concern. There is *no* <div> in any of the website’s posts. Yet, there is systematically on </div> at the end of each.
How can this be explained?
-
Alvind
Can this be seen on the frontend of the site? If so, could you provide the link so we can take a look?
-
philipperoussel
That doesn’t impact the frontend. See as an example: https://onehomeplanet.com/plan-your-way-to-victory/
Here is the HTML:
<p><strong>"But regardless of your opinion of Occupy’s people [activists from Occupy Wall Street], studying its planning, or lack thereof, is a valuable lesson for activists everywhere." (Srdja Popovic)</strong></p> <p><!--more--></p> <!-- wp:table {"hasFixedLayout":false,"style":{"typography":{"fontSize":"14px"}}} --> <figure style="font-size:14px" class="wp-block-table"><table><tbody><tr><td>This post is part of a reading series on <em>Blueprint for Revolution</em>, by Srdja Popovic. To <strong>quickly access</strong> all chapters, open the book title tab on the <a href="https://onehomeplanet.com/authors/" target="_blank" rel="noreferrer noopener"><span style="text-decoration: underline;">Authors & Books</span></a> page.<br><br><span style="text-decoration: underline;">Disclaimer</span>: This chapter summary is personal work and an invitation to read the book itself for a detailed view of all the authors' ideas.</td></tr></tbody></table></figure> <!-- /wp:table --> <!-- wp:paragraph --> <p>"Instead of dubbing themselves 'The 99 Percent,' which would have implied that the movement was based on a group identity, the American activists named themselves after a single tactic." A tactic, moreover, that tends to invite only a certain type of dedicated person instead of drawing in more casual participants, as all successful movements need to do.</p> <!-- /wp:paragraph --> <!-- wp:paragraph --> <p>Besides, "You urge the masses to march in the streets when you know you have enough of the masses on your side, and only when you’ve already done all the preparations necessary to bring your campaign to a showdown." As for the Occupy movement, "It seemed to have taken the wrong lessons from the Arab Spring and elsewhere. And not only did it begin as a mass gathering, but it quickly lost whatever organizational unity it had through all sorts of internal discussions, clarifications, and the inevitable bouts of infighting. As a result, its philosophy was muddled, and the only way it could go was down."</p> <!-- /wp:paragraph --> <!-- wp:paragraph --> <p>What could have been done differently?</p> <!-- /wp:paragraph --> <!-- wp:pmpro/membership {"segment":"logged_in","show_noaccess":"1"} --> <div class="wp-block-pmpro-membership"><!-- wp:paragraph --> <p>"The first principle of planning is timing. Like comedy and sports and sex, timing is everything when it comes to activism, and for the same reasons. People are fickle, easily distracted, and largely irrational. Hit them when they’re paying attention to something else and all the best planning will be lost, but strike when the hour is right and you are guaranteed to win." A few weeks before New Year's Eve 2000, Otpor! told everybody they knew that they had had serious expectations that the Red Hot Chili Peppers would give a concert that day. A few minutes before midnight, the dense crowd gathered in Republic Square in Belgrade saw a large screen descending behind the stage. Everyone was guessing that the beloved rock stars were probably going to rip through it in typical rock star fashion. The countdown began... "And then came sad music, followed by photographs of dead Serbian soldiers and policemen, all of whom had been slain in a decade of war, projected onto the screen." The stunned audience heard a voice saying, "We have nothing to celebrate. . . . So I am inviting you to leave this square and celebration in order to show everybody that this year has been a year of war and oppression. But it doesn’t have to be that way. Let’s make the coming year count. Because 2000 is <em>the </em>year. This year <em>life </em>must finally win in Serbia."</p> <!-- /wp:paragraph --> <!-- wp:paragraph --> <p>"As the people in Republic Square stood before that empty stage, there was an energy in the air that no rock band could ever recreate," adds the author. "Everybody felt that they had something important to do. The message was sent, and the stage was set for a final confrontation with Milošević." The coming year was an election year, and everyone that night felt they were the real star. The lesson? "This is what great planning does. It takes an ordinary and inevitable event, comes up with a tactic, and executes to perfection."</p> <!-- /wp:paragraph --> <!-- wp:paragraph --> <p>That said, Srdja Popovic had little to show for himself regarding strategic planning. This is why he likes to defer on that front to Bob Helvey, a friend and retired U.S. Army colonel. Helvey told him about the "goose egg." As the author explains, "The phrase comes from the army, where officers poring over large-scale maps never surround their target with a neat black circle; instead, they draw a fast and furious shape that looks a lot like a goose egg. The goose egg is the ultimate target, and before you begin planning anything, you have to know exactly what it is." Toppling a dictator, for instance, is not the goal; democracy is, including all the conditions for it to sustain itself.</p> <!-- /wp:paragraph --> <!-- wp:paragraph --> <p>And once you know where you want to go, there is a method that Bob Helvey swears by: <em>inverse sequence planning.</em> "For example, Bob told me that all the supporters of the jailed Burmese dissident Aung San Suu Kyi imagined her eventual triumphant emergence after more than fifteen years of house arrest even during the dark days of their struggle in the 1990s. But the Burmese didn’t just picture her opening the front door and stepping out into freedom. Rather, they thought about where her welcoming party might take place, what dignitaries would be invited, and where they would sit. This might seem like a bad case of putting the cart before the horse, but the point of such detailed planning is that it then allows you a much clearer understanding of what it is that you really want. In thinking about the seating arrangements for Suu Kyi’s party, for example, her supporters soon realized that they wanted the press and a handful of sympathetic opposition politicians right there in the front row, which led to another, far more important realization: that what they really wanted the party to be was not merely a celebration of their leader’s freedom but also an announcement that she would soon be challenging her jailors and running for president."</p> <!-- /wp:paragraph --> <!-- wp:paragraph --> <p>Gene Sharp[efn_note]American political scientist known for his extensive writings on nonviolent struggle, which have influenced numerous anti-government resistance movements around the world.[/efn_note] (1928-2018) breaks this down into three main categories:</p> <!-- /wp:paragraph --> <!-- wp:list --> <ul class="wp-block-list"><!-- wp:list-item --> <li><span style="text-decoration: underline;">Grand Strategy</span>: It includes "consideration of the rightness of the cause, assessment of other influences in the situation, and selection of the technique of action to be used," as well as evaluations of "how the objective will be achieved, and the long-term consequences."</li> <!-- /wp:list-item --></ul> <!-- /wp:list --> <!-- wp:list --> <ul class="wp-block-list"><!-- wp:list-item --> <li><span style="text-decoration: underline;">Strategy</span>: This, Sharp tells us, is “the conception of how best to achieve objectives in a conflict … Strategy is concerned with whether, when, or how to fight, and how to achieve maximum effectiveness in order to gain certain ends. Strategy is the plan for the practical distribution, adaptation, and application of the available means to attain desired objectives.”</li> <!-- /wp:list-item --></ul> <!-- /wp:list --> <!-- wp:list --> <ul class="wp-block-list"><!-- wp:list-item --> <li><span style="text-decoration: underline;">Tactics</span>: These are the very limited plans of action you devise at any point.</li> <!-- /wp:list-item --></ul> <!-- /wp:list --> <!-- wp:paragraph --> <p>Last but not least, <em>momentum </em>is everything. "You spend the first half of your struggle building it up, and the second half keeping it up. . . . This, I think, was the true reason for Otpor!’s success. . . . we always knew how to stay ahead of the game, realizing that the moment we started playing defense, our defeat was only a matter of time. And so we followed up a prank with a concert, a concert with a march, a march with an election, and election fraud with civil disobedience and strikes. We treated activism like an action movie. . . . Think of it this way, and planning kind of takes care of itself, with everything falling into place."</p> <!-- /wp:paragraph --> <!-- wp:block {"ref":37696} /--></div> <!-- /wp:pmpro/membership --> -
George
Hi Philippe,
Looking at the source you shared, those
</div>tags do have matching opening tags — they belong to your Paid Memberships Pro membership block. The block opens with:<div class="wp-block-pmpro-membership">…and closes with
</div>at the end of the protected content section. Because the opening tag appears much earlier in the post than the closing one, they can look unmatched when scanning the code.Since there’s no visible frontend issue, everything is working as expected — the HTML is valid.
-
philipperoussel
Hi George,
Mystery solved. I should have looked for “div” instead of <div>…
Thank you.
-
George
Ok, no problem!
- You must be logged in to reply to this topic.