CSS to add paragraph on home page
-
Hello!
I would like to add a paragraph or two of text on my home page but as its not part of the theme, I need the css code. I would like to add them underneath the tagline.
My site is:
https://landasourteacher.wordpress.com/thank you!!!
The blog I need help with is: (visible only to logged in users)
-
Hi there,
This can be done with the following CSS code:
.site-description:after { content: ' Your text goes here' ; white-space: pre; }
Let me know if there’s anything else I can do for you. I’m happy to help.
-
that’s great, thank you!
the paragraph is long and is trailing off the page so i need to insert some hard returns. how would i do this?
also, if i want to make the text smaller and not in caps, just regular text?
:D
-
I’ve made some tweaks to the code:
.site-description:after { content: 'This is the first line. \A This is the second line.'; display: block; white-space: pre; text-transform: lowercase; font-size: 10pt; }
You’ll have to use the
\A
escape sequence to insert a line break.If you want to capitalize the first letter of each word, use the
capitalize
value.Adjust the value in
font-size
to your liking. -
ok thank you! is it possible to make the lines closer together as well as some padding above the first line?
-
Just add those two lines at the end (bellow
font-size
and before}
):line-height: 2; padding-top: 20px;
The
line-height
property value can take decimals for more fine-tuning (e.g. 1.5).If you’re interested in learning more CSS to make any adjustement yourself you can read this article:
- The topic ‘CSS to add paragraph on home page’ is closed to new replies.