Allow <style> tags in posts
-
I've been toying with trying to add some CSS to just one specific post on my site. Apparently it's not possible, as the editor strips out
<style>
tags. Being able to do that would be nice.I wanted to try writing a blog post in japanese, and seeing if I could make it vertical. It only takes 2 css rules and a selector, (with some extras just to make it nicer), but I can't do that.
-
Can you not
<div style="...">(the content)</div>
? I know it can get really messy, but at least it works…PS: Tried something like this earlier, IDK what exactly I was trying to achieve.
-
I've got a Wordpress(.com) blog.
Although I'm a free user and I can't import directly CSS files, but I can use
<style>
tag in almost things, just place it inside any HTML tag.
Ie.<div style="...">bla, bla, bla</div> <p style="...">bla, bla, bla</p> <img src="..." style="..." />
This helps me to create especial adverts on posts, define margins, borders, apply special effects on imgs (like shadows), use sprites, etc.
Actually we use a block editor for easy coding, but choosing custom HTML it's possible. I figure will be similar on Vivaldi's blogs
-
@potmeklecbohdan @Obiwan2208 This is what I've had to do previously, but there are a number of problems which make that an intractable solution:
- It's awkward to have to do it to every single block you want to style
- The editor only allows certain CSS rules it seems
- That only works per-block, so if you tried to make everything vertical it would just makes each paragraph vertical, but lays them each out on their own horizontal line, which defeats the whole purpose for wanting to style like that. Inline rules are not a substitute for the real thing.
-
@LonM Can you give me an example of styled (via
<style>
) HTML, so I can play with it?I know it’s veering OT from the original request, but… I just want to try it.
-
To illustrate my point better: Real styling lets me do this:
Per-block hacking with style attributes WOULD let me do this (see how each paragraph still fills its own block):
Except even that doesn't work because it only allows a subset of all CSS rules for some stupid reason.
-
@potmeklecbohdan The rule I want to add is this:
.entry-content { writing-mode: vertical-rl; text-orientation: upright; max-height: 500px; margin-top: 20px !important; }
I
-
@LonM Dammit, you’re right. I have no idea why it strips this kind of style rules…
-
@potmeklecbohdan Yeah. I don't know if this is intentional or just a bug.
-
It's as it's. It's how Wordpress work at least 11 years ago that I'm blogging.
It's free, so are applies some restrictions...
You can't use
<script>
,<link>
nor any element that must be placed outside<body>
. Each CSS style must be written inside on each HTML element, or use the element<span style="..."></span>
.It's not a bug.
-
Ppafflick moved this topic from Done on