Is it possible to have text to always be at the end of blog posts by default? I have this at the end of mine,
The hearts. But right now, I’m adding it manually after my blog each time. I don’t want to do that. Want it to be always there. How should I do this?
Oh, and Inspect Element shows that the code is like this :
<p>
~ ♡ 🧡 ♡ ~
<br></p>
SamA74
February 20, 2021, 5:13pm
3
This could be done by adding an ::after
pseudo element in your CSS.
1 Like
@PaulOB awesome, thanks. So something like :
.post-body::after {}
or
.post-body:after {}
Since my writing is in the body section
.post-body { /* edit blog post body font here */
background:rgba(0,0,0,.7);
background-image:url(https://i.ibb.co/zXH2TcZ/564-5644617-cherry-blossom-flower-petal-cherry-blossom-flower-transparent.png), url(https://i.ibb.co/gvQBnrH/cherry-blossom-flower-petal-transparent-flipped3.png);
background-repeat:no-repeat;
background-size:254px 235px;
background-position:top left, 0px 75px;
margin-left:150px;
margin-right:150px;
font-size:15.5px;
font-family:Open Sans, Georgia Pro, Lucida Sans, Verdana;
font-weight:none;
letter-spacing:1.5px;
line-height:1.6;
word-spacing:normal;
color:#fff;
box-shadow:0px 10px 15px 5px rgba(33, 16, 41,1);
border:1px solid black;
z-index:6;
}
SamA74
February 20, 2021, 5:19pm
5
ladans37:
.post-body::after {}
Two semicolons is correct for pseudo elements.
You would use just one for pseudo classes, such as :hover
PS: I’m not @PaulOB
Add the content
property, and any other styling you want. Eg, you may add display: block
to put the extra content on a new line.
5 Likes
@SamA74 so sorry lol I must have misread your name. Right, I always get confused with the single semicolons and doubles. I never knew which to use. Thanks for the heads up on that, and for the info.
Like this?
.post-body::after {
content: '~ ♡ 🧡 ♡ ~';
display:block;
margin-left:150px;
}
Or just use position :
rather than margin :
.
SamA74
February 20, 2021, 5:52pm
8
How does it look when you try it?
Not done it yet. Will try it out now, and let you know.
.post-body::after {
content: '~ ♡ 🧡 ♡ ~';
display:block;
margin-top:150px;
}
Obviously I’ll need to move it up to where the first one is. But it looks great.
SamA74
February 20, 2021, 5:56pm
11
Margin is probably more appropriate than positioning.
Though in your image, it is on the left, a 150px margin seems a lot for that.
1 Like
That’s only for the main .post-body
element though, as I shared earlier
I removed the one I had put in, and moved up the ::after element. Looks ugly though, dunno what to do…
SamA74
February 20, 2021, 6:48pm
14
ladans37:
moved up
How exactly did you move it up?
Maybe I should be asking why you need to move it.
Or rather, why is there a gap above in the first place, if you don’t want one there.
1 Like
@SamA74 I moved it up with this
margin-top:-40px;
Which puts it where the original was.
SamA74
February 20, 2021, 6:58pm
16
But rather than hacking things into place with negative margins, don’t you first stop to ask yourself why is it too low?
2 Likes
Too low, like it was in here?
Is there anything else I can do rather than negative margins? I just tried position:relative, top:
, and that seemed to have made it disappear totally.
SamA74
February 20, 2021, 8:27pm
19
The question you should be asking is: “Why is there a big gap there in the first place?”
Not: “How to I paste over the gap to cover it up?”
4 Likes
Ok, so why is there a big gap?