Div Box BB Code Help

Status
Not open for further replies.

Absyinthe_Artica

Creator of Worlds
Original poster
FOLKLORE MEMBER
Invitation Status
  1. Not accepting invites at this time
Posting Speed
  1. One post per day
  2. 1-3 posts per week
  3. One post per week
Online Availability
Everyday
Writing Levels
  1. Intermediate
  2. Adept
  3. Advanced
  4. Adaptable
Preferred Character Gender
  1. Male
  2. Female
Genres
Fantasy, Modern, Magical, Sc-fi, Horror, Steampunk, anything really
When I make my div box it gets all wonky like below:
iVJo9Hx.png

That middle section isn't suppose to be there. And every time I try to edit the code, it shows up a random div box that I didn't put there that I can't erase because when I check after I have deleted it and saved, it's still there. What do?
 
Most likely, it has something to do with the bbCode parse bug, where it attempts to correct unresolved tags. I would take a look through the current code and find any places where a bbTag's effect begins outside of a div and ends inside of it, or vice versa, as these are the cause of that bug.

The extra [/div]s are likely a result of the same feature in the parser, but incorrectly appearing due to the aforementioned bug. Use the counting trick to spot obvious errors (opening tags are +1, closing tags are -1; you end with 0 when you're good).
 
What if it is a div box inside another div box? How can you fix the bug?
 
I don't think that's the issue. So this is basically the structure of your post as you posted it originally (after the parser was through with it):

Code:
[COLOR=#979797]
	[FONT=Verdana]
		[div]
			[div]
				[B]
					Character Full Name
				[/B] 
				Text
			[/div]
		[/div]
	[/FONT]
	[div] <<<
	[/div] <<<
[/div] <<<
... ...[/COLOR]
... ...[div]
[FONT=Calibri] <<<
[/FONT] <<<
[COLOR=#979797]
	[FONT=Verdana]
		[B]
			Pronunciation
		[/B]
		Text
	[/FONT]
[/COLOR]
[FONT=Calibri] <<<
[/FONT] <<<
[COLOR=#979797]
	[FONT=Verdana]
		[B]
			Personality
		[/B]
		Text
	[/FONT]
[/COLOR]
[FONT=Calibri] <<<
[/FONT] <<<
[COLOR=#979797]
	[FONT=Verdana]
		[B]
			Memory
		[/B]
		Text ... Underscores
	[/FONT]
[/COLOR]
[FONT=Calibri] <<<
[/FONT] <<<
[COLOR=#979797]
	[FONT=Verdana]
		[B]
			Species
		[/B]
		[B]
			Class
		[/B]
		[B]
			Cogs
		[/B]
		[B]
			Inventory
		[/B]
	[/FONT]
[/COLOR]
... ...[/div]
... ...[COLOR=#979797]
[FONT=Verdana] <<<
[/font]
... ...[/color]
...[/div]
...[COLOR=#979797] <<<
... ...[FONT=Verdana] <<<
... ...[/FONT] <<<
...[/COLOR] <<<
...[CENTER] <<<
...[/CENTER] <<<


The chevrons point out some of the things the bug is causing. I gave up because it was so mangled. To ease your styling in the future, I wouldn't mix bbCode and inline styling very much. If you're going to use divs to structure your post, also use them to style blocks of text.

I mean, if you're just [i]ing a couple of words in a line, sure, but don't format your whole post with a bbTag when you could add color: #979797; font-family: "Calibri"; instead. It should reduce the frequency of this issue popping up.

The bug only occurs when you write invalid bbCode, but it punishes you for the mistake by spitting out ruined source code. I've had very little success in the past with correcting a post that started off as more than one syntax error, so I would make a point to preview your post a million times before ever hitting the send button.
 
I fixed it ^.^ Thanks
 
  • Love
Reactions: SamIO
Status
Not open for further replies.