• When posting, please be aware that artistic nudity is still nudity and not allowed under RpNation rules. Please edit your pictures accordingly!

    Remember to credit artists when using work not your own.

Tutorial Using Div Boxes

IctoraPost

You've got mail
BBCode is great. You can do a lot of stuff with it, making everything look pretty and nice without risking accidentally destroying the site, like with HTML. However, the options for it are pretty limited and you can only do so much using it. Enter Slightly Hacky BBCode (coined by me).

This is a slightly hacky way to extend the choices of using BBCode by exploiting the system and adding in extra CSS styling tags where there shouldn't be any. Keep in mind that this whole thing could be fixed and become obselete later, as none of this is supposed to happen.


With the advent of the [div] tag, there's no need for any of this trickery any more. It's become obselete. I hereby change this guide from a slightly hacky one to a completely legitimate guide to the [div] tag (but maybe with some slightly hacky stuff as well)!

You can do many things with this, such as

larger text sizes

smaller text sizes

rounded corners

background images

gradients

set widths and heights

circles

scroll boxes
scroll boxes
scroll boxes
scroll boxes
scroll boxes
scroll boxes
scroll boxes
scroll boxes
scroll boxes are kind of redundant here with there being a specific tag for it now, but I'll keep this here anyway

box shadows

text shadows and glows

text borders



transformations

transparency

positioning


And MORE!

Simply get a [border=none; ] tag, put in some stuff after the ';', then off you go!* For the HTMLers out there - when you input, say, [border=none; border-radius: 10px;], the thing that outputs is <div style="border:none; border-radius: 10px;">. You can work out how to apply more inline CSS from here.*I recommend using [border] tags over [bg] tags, as the bg ones create additional unnecessary elements that may mess up the code.
Lyro Lyro has a much more professional post on this 'CSS property injection' phenomenon here, if you want to know a bit more about it.

This thread will give only a basic explanation on all these tricks. If you want to learn more, go to W3Schools for well-documented guides to everything HTML and CSS, as well as reference sheets. Also, make sure to check out @mayhem TR4NQU1L17Y 's very helpful chart here.

Code:
[div=padding: 10px; font-size:50px; padding:0;]larger text sizes[/div]

[div=padding: 10px; font-size:8px; padding:0;]smaller text sizes[/div]

[div=padding: 10px; border: 5px solid grey; background-color:lightgrey; border-radius:10px;]rounded corners[/div]

[div=padding: 10px; background: url(https://static.pexels.com/photos/9694/pexels-photo.jpeg) 50%; border-radius:50px;][COLOR=#ffffff]background images[/COLOR][/div]

[div=padding: 10px; background: red;  background: -webkit-linear-gradient(left, red , yellow);   background: -o-linear-gradient(right, red, yellow);  background: -moz-linear-gradient(right, red, yellow);  background: linear-gradient(to right, red , yellow); border-radius:50px;][COLOR=#ffffff]gradients[/COLOR][/div]

[div=padding: 10px; background-color: khaki; border-radius:30px 0; width: 40%; height: 40px;]set widths and heights[/div]

[div=padding: 10px; border: 3px dashed blue; background-color:skyblue; border-radius:100%; height:50px; width:50px;]circles[/div]

[div=padding: 10px; border-radius:5px; background-color: olive; height:100px; overflow:auto;][COLOR=#ffffff]scroll boxes
scroll boxes
scroll boxes
scroll boxes
scroll boxes
scroll boxes
scroll boxes
scroll boxes
scroll boxes[/COLOR][/div]

[div=padding: 10px; background-color: gold; box-shadow: 2px 2px 3px black, 4px 4px 0px 2px pink; border-radius:10px;]box shadows[/div]

[div=padding: 10px; text-shadow: 1px 1px 1px orange;]text shadows and glows[/div]

[div=padding: 10px; border: 1px solid violet; display:inline-block; border-radius:50px;]text borders[/div]



[div=padding: 10px; border: 1px solid grey; border-radius:10px; transform: rotate(1deg);]transformations[/div]

[div=padding: 10px; border: 5px dotted maroon; background-color:brown; opacity:0.6; border-radius:10px;][COLOR=#ffffff]transparency[/COLOR][/div]

[div=padding: 10px; background-color:silver; display:inline-block; border-radius:50px; position:relative; left: 30%;]positioning[/div]

Sorry if anything looks bad on the dark theme - I use the lighter ones, so things might be a bit wonky.
 
Last edited:
Rounded Corners
Rounded corners are probably the thing I want the most in vanilla BBCode. It's so simple, yet it instantly makes things look so much better! Here's how to do it:

[div=padding: 10px; border-radius: 10px;]whateverstuftextearlnkearg[/border]

Easy!

[div=padding: 10px; border: 5px solid olive; border-radius: 10px;]

[div=padding: 10px; background-color: goldenrod; border-radius: 10%;]

[div=padding: 10px; border: 2px solid green; background-color: limegreen; border-radius: 50px;]

You can also choose each corner individually, like
[div=padding: 10px; background-color: royalblue; border-radius: 15px 10px 5px 2px;]

More info in the link in the title.
 
Last edited:
Backgrounds are essential in everything related to visual design. They provide a backdrop for most of the content up front and create an overall tone in whatever you're making. So, without further ado:

A simple solid background. Very basic.
You could use the slightly hacky [div=padding: 10px; background-color: pink;]
Or you could just use the traditional [bg=pink]

However, if you want an image to be the background, you'll have to use the newer method.
[div=padding: 10px; background-image: url(https://images.freecreatives.com/wp-content/uploads/2016/04/Cool-Pink-Plain-Background.jpg);]

You can resize them using
background-size: width height;
[div=padding: 10px; background-image: url(https://kingofwallpapers.com/parchment/parchment-002.jpg); background-size: 400px;]
You don't need to put in a height.

You can also use a percentage.
[div=padding: 10px; background-image: url(https://kingofwallpapers.com/parchment/parchment-002.jpg); background-size: 50%;]

You can choose to have it repeat or not. Options are repeat (default), repeat-x, repeat-y, and no-repeat.
[div=padding: 10px; background: url(https://kingofwallpapers.com/parchment/parchment-002.jpg) no-repeat; background-size: 50%;]
Notice how I changed the background-image to background, and added the no-repeat? That's just doing it shorthand, sticking everything under one heading. Much easier than writing the whole thing out every time. Note that background-size can't be shorthanded.

You can position the background wherever you want. Options are left/right/center and top/bottom/center, or either percentages (%) or pixels (px).
[div=padding: 10px; background: url(https://kingofwallpapers.com/parchment/parchment-002.jpg) no-repeat center right; background-size: 50%;]

One really cool thing you can do is to have the image 'stick', so that it won't move even if you scroll.
[div=padding: 10px; background: url(https://kingofwallpapers.com/parchment/parchment-002.jpg) fixed;]





More info in the links in the title.
 
Last edited:
Please, please... this makes HTML not a waste of time yes, please! Thank you for figuring this out!
 

been playing around with it. learning html and css kinda paid off

 
Last edited:

Grace Rivers​
Mood:
Location:
With:
Outfit:


Tagging:



I played around with it and made a code for formatting posts for a roleplay I'm in. Thank you my guy, thank you.


























 
I LOVE YOU SO MUCH!!!?!?!
I was super distressed about the taking of html and HAHHHGH ILY.
 
ewolf20 ewolf20
I pretty much just made three columns and put a lot of spaces for the image so it came out the size I wanted it to. I turned off rich text editor to do it so that the site wouldn't make a bunch of extra code.
 
You can choose to have it repeat or not. Options are repeat (default), repeat-x, repeat-y, and no-repeat.
https://kingofwallpapers.com/parchment/parchment-002.jpg[/URL]) no-repeat; background-size: 50%;]

Notice how I changed the background-image to background, and added the no-repeat? That's just doing it shorthand, sticking everything under one heading. Much easier than writing the whole thing out every time. Note that background-size can't be shorthanded.

I legitimately copy and pasted this code into a slide title and the image isn't showing up. Is it because it's being used as a slide title?
 
I legitimately copy and pasted this code into a slide title and the image isn't showing up. Is it because it's being used as a slide title?

That's because it copies the URL code as well. You have to go into the plain text editor and delete that. Annoying, I know.

Tietal
ainfiawoef

Code:
[accordion]{slide=[div=padding: 10px; background: url('https://kingofwallpapers.com/parchment/parchment-002.jpg') no-repeat; background-size: 50%;]Tietal[/div]}ainfiawoef{/slide}[/accordion]


...I should probably update this guide.
 
Backgrounds are essential in everything related to visual design. They provide a backdrop for most of the content up front and create an overall tone in whatever you're making. So, without further ado:

A simple solid background. Very basic.
You could use the slightly hacky [div=padding: 10px; background-color: pink;]
Or you could just use the traditional [bg=pink]

However, if you want an image to be the background, you'll have to use the newer method.
[div=padding: 10px; background-image: url(https://images.freecreatives.com/wp-content/uploads/2016/04/Cool-Pink-Plain-Background.jpg);]

You can resize them using
background-size: width height;
[div=padding: 10px; background-image: url(https://kingofwallpapers.com/parchment/parchment-002.jpg); background-size: 400px;]
You don't need to put in a height.

You can also use a percentage.
[div=padding: 10px; background-image: url(https://kingofwallpapers.com/parchment/parchment-002.jpg); background-size: 50%;]

You can choose to have it repeat or not. Options are repeat (default), repeat-x, repeat-y, and no-repeat.
[div=padding: 10px; background: url(https://kingofwallpapers.com/parchment/parchment-002.jpg) no-repeat; background-size: 50%;]
Notice how I changed the background-image to background, and added the no-repeat? That's just doing it shorthand, sticking everything under one heading. Much easier than writing the whole thing out every time. Note that background-size can't be shorthanded.

You can position the background wherever you want. Options are left/right/center and top/bottom/center, or either percentages (%) or pixels (px).
[div=padding: 10px; background: url(https://kingofwallpapers.com/parchment/parchment-002.jpg) no-repeat center right; background-size: 50%;]

One really cool thing you can do is to have the image 'stick', so that it won't move even if you scroll.
[div=padding: 10px; background: url(https://kingofwallpapers.com/parchment/parchment-002.jpg) fixed;]





More info in the links in the title.

Hyee! So uhm.. you've been helping me out a ton, so its a lil embarrassing for me to keep asking you stuff, but uhm.. I was just wondering how you made that last div box (with a fixed image) without any perceivable content? I tried making an empty content div box and it just became a no show.

Thanks so damn much for your willingness to help dis por noob >//<

Edit: NVM!! i FUGURED IT OUT! Went back and checked again >..< You used an 'enter' paragraph. Thanks so much thoooo...!
 
Hyee! So uhm.. you've been helping me out a ton, so its a lil embarrassing for me to keep asking you stuff, but uhm.. I was just wondering how you made that last div box (with a fixed image) without any perceivable content? I tried making an empty content div box and it just became a no show.

Thanks so damn much for your willingness to help dis por noob >//<

BBCode is like that, unfortunately. Putting in some text and adding a color:transparent; to the div will fix it.
 
Finally posted another section. Sorry for the non-existant updates. So, the basics. Many people here don't know how to use div boxes so I'll be explaining things here. This should probably have been the first post that everyone sees, but I can't really do anything now. Anyway, enough ooc. Onwards!

Div boxes are a powerful tool in BBCode. They allow you to do so much that none of the other tags cannot, as seen in the first post of the thread. Use [div][/div] tags, you can impliment code in them with [div=codehere]. The code is just inline CSS properties, which is why I've been linking to CSS guides throughout the thread. Most of the understanding of divs come from understanding these properties.

For further reading, you can check out this reference for an in-depth look into every single official property, most of which you, a user of BBCode, will never use. Alternatively, @mayhem TR4NQU1L17Y has a great chart outlining the more commonly-used ones.

I'll be using this format:

[div=property: option1;]
(option1 | option2 | option3)


Here's a list of basic properties. Some may be explained in more depth in the future.
A border may be added or a text color changed for clarity.


[div=color: red;]
(colorName | HEX | RGB | RGBA | HSL | HSLA)

[div=text-align: center]
(left | right | center | justify)

[div=font-size: 20px;]
(size)

[div=background-color: orange;]
(colorName | HEX | RGB | RGBA | HSL | HSLA)

[div=border: 5px solid green;]
(width lnone | dotted | dashed | solid | double | ridge | groove | inset | outset lcolor)

[div=padding: 10px;]
(width)

[div=margin: 10px;]
(width)

[div=width: 50%;]
(width)

[div=height: 70px;]
(height)

[div=float: right;]
(left | right)




More info in the link in the title.
 

Users who are viewing this thread

Back
Top