Thursday 11 January 2024

Testing

I had some trouble with vertical spacing on the last post (reference 1) and suspected that it was connected with whether it was using <div> or <p> for paragraph breaks. It shows around the picture inserts. It also seems to make a difference whether I am on the Windows 10 desktop or the Windows 11 laptop. And then, is one in edit post mode or view post mode? As things stand, the snap above is held in a <div> section, which I think is the default, while the three that follow, this text section and the two reference sections, are <p> sections.

Plus both <p>  and <div> sections seem to come with space before and after the end of the text. With this section being a <div> section.
And this section being another. So perhaps the space before the last section is really the space after the one before that.


And this section being another, with a hard break in the form of hitting RETURN twice. A touch more space than that given by a <p> section? Certainly made a lot worse by replacing the '<div><br /></div>' used by Blogger to implement the line feed (a hang-over from printer terminology, on the scene before the arrival of screens for users), with a '<p><br /></p>.

Back with <p>.

Now, we add another picture but change this paragraph from <p> to <div> and we lose the vertical space after the snap. As above, adding a break (here '<div><br /></div>') makes too much space.

A <p> section after the zoom of the top of the Christmas tree, with the added break in the HTML removed. All this being helped along by being able to flip between HTML and compose mode (more wysiwyg than raw HTML) when editing a post in Blogger.

At this point I ask Bard who gives me the following story:

So maybe it is all down to the Blogger editor being a bit idiosyncratic about whether it goes for <p> or <div> sections. I try asking Bard about that, what I thought was a fairly complicated question:

The Blogger software sometimes seems to go for <div> (which I don't like) and sometimes for <p> (which I do). Can you say anything about this?

And he seems to do pretty well, with the start of his answer snapped below.

Which is enough for now. In fact one might go so far as to say too much information. So at 09:50, it being a bright, cold and frosty morning, time for a walk. Straight white pudding to follow.

PS 1: the opening snap is our with-roots Christmas tree from Sainsbury's, seemingly not a Baby Blue this year. We did not plant out last year, but this year I thought I would compromise on putting it in a pot. To find that the root ball is very small indeed, much less than a foot in diameter, and it is hard to see how it is going to grow. Particularly in a pot which will be prone to drying out when I forget to water it. We shall see. See also, for example, reference 2.

PS 2: later that morning: being rather picky, most of the offending '<div>' stuff has now been stripped out of reference 1. I was helped along initially by helpful red flags in the HTML highlighting where I had got to, but they faded away after a bit. There was also the odd complaint about invalid HTML, but the post now looks OK, at least on the Windows 11 laptop.

PS 3: still later, checking the post on Samsung, picked up another error. Was it something funny about the Android environment? No, just common-or-garden human error back in edit post, probably the cause of the various error messages I had been getting. Now corrected.

References

Reference 1: https://psmv5.blogspot.com/2024/01/boreal-landscapes.html.

Reference 2: https://psmv5.blogspot.com/2022/01/baby-blue.html.

No comments:

Post a Comment