Use logical versions of the margin, border, and padding properties so that the edges of the box relate to the text rather than following top, left, bottom and right. You can see how this should look in the image below.
.box {
inline-size: 150px; /*that will set the size in the inline direction to 150 in default which mean the writing mode in horizontal it will be the width unless the writing mode changed to vertical */
block-size: 150px; /*that will set the size in the block direction to 150 in default which mean the writing mode in horizontal it will be the hieght unless the writing mode changed to vertical */
border-block-start: 5px solid rebeccapurple; /*again in default writing mode it will be the top border */
border-inline-end: 5px solid grey; /*again in default writing mode it will be the right border */
border-block-end: 5px dotted red; /*again in default writing mode it will be the bottom border */
border-inline-start: 5px dotted blue; /*again in default writing mode it will be the left border */
padding-block-start: 40px; /*again in default writing mode it will be the top padding */
margin-block-end: 30px; /*again in default writing mode it will be the bottom margin */
}
.vertical {
writing-mode: vertical-rl; /*this will change the wrting mode for the secand box to vertical and start from right to left */
}
I have one question if @justsomeone are seeing this?
However honestly thank you for answering my questions in your own time, very appreciated.
Regarding this? When is this used and how does this work?
For example, below we are using calc() to make the box 20% + 100px wide. The 20% is calculated from the width of the parent container .wrapper and so will change if that width changes. We can’t do this calculation beforehand because we don’t know what 20% of the parent will be, so we use calc() to tell the browser to do it for us.
@justsomeone
I do appreciate this! you have no idea.
Also thank you again for the explanation, I do try and. understand from the doc pages but sometimes I think explanation helps from others too.