• 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.

Help new to coding need to align

hollow.moon

I'll knuckle punch you right in your gotdam throat
I am trying to center this DIV box but it does not want 2 center pls help


ZcggAtY.jpg
vjPDVvP.jpg
9hqhP0w.jpg

Celeste Aurum Dynastie
"born to be.... an heir of beauty and serenity..."
nXDlSwA.jpg
XgEbIj0.jpg
9QDa2vr.jpg



Code:
[DIV=  background: transparent; background-size: height: 1000px; width: 350px; border: double 4px thistle; padding 4px;]

[CENTER][img]https://i.imgur.com/ZcggAtY.jpg[/img][img]https://i.imgur.com/vjPDVvP.jpg[/img][img]https://i.imgur.com/9hqhP0w.jpg[/img]

[FONT=Alex Brush][SIZE=26px]Celeste Aurum Dynastie[/SIZE][/FONT]

[FONT=Cinzel][SIZE=12px]"born to be.... an heir of beauty and serenity..."[/SIZE][/FONT]

[img]https://i.imgur.com/nXDlSwA.jpg[/img][img]https://i.imgur.com/XgEbIj0.jpg[/img][img]https://i.imgur.com/9QDa2vr.jpg[/img]

[/DIV]
 
Add margin: auto; to the div code to center it. Also, I suggest setting a percentage for the div's width so that it resizes better on mobile. Right now, it's cutting it out a bit...

I normally just add width: 100% to my div container (bigger one, where everything goes inside of)
 
What Necessity said except instead of "width: 100%;" you'd want "width: calc(100% - 8px); max-width: 350px;" just so it doesn't span like 1700px on a larger laptop screen ovo;;; The "100% - 8px" for the width compensates for the border and padding.
 
Last edited:
What Necessity said except instead of "width: 100%;" you'd want "width: 100%; max-width: 350px;" just so it doesn't span like 1700px on a larger laptop screen ovo;;;
Now that's a function I don't use as much and probably should be... I gotta start considering that one
 
you can actually ignore the calculation for the width and just use 100% if you put in box-sizing: border-box;
 

Users who are viewing this thread

Back
Top