What I'm trying to accomplish here is having some content, in this case the word 'NO' (font-size big enough for the idea of course) and surround it with Master Yodas quote as some kind of 'border'.
#boxContent {
font-size: 55px;
font-weight: normal;
}
body {
text-align: center;
font-size: 10px;
font-weight: bold;
}
#bodyFormat {
margin: 100px;
padding: 10px;
background-color: salmon;
width: 250px;
height: 125px;
}
.boxSides {
display: inline-block;
border: solid 2px darkGreen;
/*height: 100px*/
}
#LeftBorder {
transform: rotate(-90deg);
/*margin: 40px 0 0 0;*/
}
#RightBorder {
transform: rotate(90deg);
/*margin: -80px 0 0 100px;*/
}
#bottomBorder {
transform: rotate(180deg);
}
<div id=bodyFormat>
<!--Close Box top-->
<div>DO OR DO NOT</div>
<!--Close Box left side-->
<span class="boxSides" id="LeftBorder">BE WITH YOU</span>
<!--Inside Box-->
<span id="boxContent">NO</span>
<!--Close Box right side-->
<span class="boxSides" id="RightBorder">MAY THE FORCE</span>
<!--Close Box bottom-->
<div id="bottomBorder">THERE IS NO TRY</div>
</div>
```
This is the closest I got, but you can guess it's not close enough.
This is how it looks (if you wonder, yes it's cut out)
I'd like it to be real tight, border-like, more or less in this dimensions (font-size)
I already tried changing properties from <span>
to <div>
to <p>
with display changed from block, inline-flex/grid/block back and forth. Just as changing padding and margin values back and forth. Every other constellation got me to something like this:
Doesn't look bad but not what I want for now.
The only thing I found in search was this: How to create Border with text
And this answer: https://codepen.io/mrigankvallabh/pen/LYNYoMq
But first of all, I don't really get what is happening in the code (if someone is eager enough, feel free to explain :) And secondly, the parts I do understand show me it's a solution for this particular problem. Having a border around a paper, oriented rather on the outside, not the inside.
I read about fieldset and legend too, as well as moving text-blocks around on absolute onto a border with changing background but don't see an approach that would make this work, since there shall not be a line around the content.
And another thing, I wrote the solid border for the sides out of curiosity because the background (#bodyFormat - salmon) seems to stretch as wide as the text before transformation (rotation) would have been, if you catch my drift. But it looks like the box around the border text is shaped around content not consuming the space of rotation. Changing margins or width just shuffles everything again. (For width it changes exactly at 218px if you wonder too). How do I eliminate the background excess?