The Forums Are Now Closed!

The content will remain as a historical reference, thank you.

'XML Code View' CSS is broken. Major pain to Elemental modders!

By on September 7, 2010 6:41:11 AM from Elemental Forums Elemental Forums

The .alt css command in line 102 of style.css is over-riding the .codeblock li.alt command on line 24.

To give this (and the other .codeblock backgrounds) higher precedence you should add #aspnetForm in front.

Eg:

#aspnetForm .codeblock li.alt

As it stands right now the code blocks are illegible.

+58 Karma | 12 Replies
September 7, 2010 2:56:38 PM from Elemental Forums Elemental Forums

Hi again.

This can be solved in just a few minutes.

The XML display is seriously broken in the forums and the fix I mentioned above works (I tested it). Can someone please simply add #aspnetForm to the start of line 24 in the styles,css file?

September 7, 2010 3:48:48 PM from WinCustomize Forums WinCustomize Forums

What URL are you specifically having an issue with?  Depending on the site, the CSS changes drastically so unfortunately I am unable to help unless I know which site is the one with the problem.

Bara

September 7, 2010 3:57:53 PM from Elemental Forums Elemental Forums

Try testing from Elemental boards. Specifically, posting XML code from the game files does very funky things (every other line with black background).

September 7, 2010 6:10:59 PM from Elemental Forums Elemental Forums

Yes. It is the Elemental forum.

But all my suggested change does is force the code to give precedence to the id rather than the class.

September 7, 2010 6:13:15 PM from Elemental Forums Elemental Forums
September 8, 2010 6:23:20 AM from Elemental Forums Elemental Forums

Quoting GunslingerBara,
What URL are you specifically having an issue with?  Depending on the site, the CSS changes drastically so unfortunately I am unable to help unless I know which site is the one with the problem.

Bara

I had assumed that their was only a single stylesheet called 'style.css'. Now I can see you have a master stylesheet http://forums.elementalgame.com/css/Base/style.css

And a theme style sheet http://forums.elementalgame.com/Themes/Elemental%20v2/css/style.css

My earlier suggestion was to change the master stylesheet so I understand your reluctance.

However, there is an equally easy fix within the theme stylesheet.

The problem is that the class 'alt' is used both in the forum posting AND in the alternate rows of the code editor. The alt class in the forum is specified in the theme stylesheet while the alt class in the code view is specified in the master stylesheet.

The alt class in the forum (line 102) is always applied to a div so instead of:

Code: css
  1. .body .forum .post .replies .alt {background:none repeat scroll 0 0 #151510;}

if a div qualifier is added it corrects the problems:

Code: css
  1. .body .forum .post .replies div.alt {background:none repeat scroll 0 0 #151510;}

or you could use the 'reply' class instead of the div:

Code: css
  1. .body .forum .post .replies .reply.alt {background:none repeat scroll 0 0 #151510;}

Tested both of these and they work.

September 8, 2010 7:33:47 AM from Elemental Forums Elemental Forums

Awesome, man! You've spread joy to modders everywhere who want to be able to add readable XML blocks in "reply" posts.
 

Gnilbert

September 8, 2010 5:21:46 PM from Elemental Forums Elemental Forums

*Bump*

Please, with Elemental being soooooo XML heavy in modding this is really important. Particularly as modding will be focussed on more heavily in the very near future. It is such an easy fix as well.

If this is a problem is there any way we can put our own style tags in the editor to over-ride the formatting? I tried this but it didn't stick.

September 12, 2010 3:19:28 PM from Elemental Forums Elemental Forums

If modders using the Elemental forums want to fix this I found a reasonably simple work-around through a Firefox plugin.

Details are here:

http://forums.elementalgame.com/396187


BTW, Bara or whoever else will fix this, the default font colour also needs to be corrected as well. I see that the style sheet was worked on recently so the old line numbers are a little out.

Suggest now adding the .codeblock overrides back in to the Theme style.css as a new entry because of the font colour change.

Code: css
  1. #aspnetForm .codeblock li {
  2. color:#000;
  3. }
  4. #aspnetForm .codeblock li.alt {
  5. background:none repeat scroll 0 0 #F8F8F8;
  6. }

Just adding the 'aspnetForm' id to the .codeblock class gives it precedence.

September 13, 2010 11:56:36 AM from Elemental Forums Elemental Forums

I've fixed the alternate background and changed the text color to black.  However, I've kept the alternate background to a light grey to help differentiate between multiple-line XML and single-line XML.

Note that it may require a hard refresh (Ctrl + F5) for the CSS to update.

Bara

September 13, 2010 1:41:16 PM from Elemental Forums Elemental Forums

Awesome news! 

One less thing for Das123 to complain about. (J/K)

September 13, 2010 3:02:15 PM from Elemental Forums Elemental Forums

Quoting Gravedancer,
One less thing for Das123 to complain about. (J/K)

Lol  

Thanks Bara. Working great.

Stardock Forums v1.0.0.0    #108435  walnut2   Server Load Time: 00:00:00.0000219   Page Render Time:

Stardock Magazine | Register | Online Privacy Policy | Terms of Use

Copyright ?? 2012 Stardock Entertainment and Gas Powered Games. Demigod is a trademark of Gas Powered Games. All rights reserved. All other trademarks and copyrights are the properties of their respective owners. Windows, the Windows Vista Start button and Xbox 360 are trademarks of the Microsoft group of companies, and 'Games for Windows' and the Windows Vista Start button logo are used under license from Microsoft. ?? 2012 Advanced Micro Devices, Inc. All rights reserved. AMD, the AMD Arrow logo and combinations thereof are trademarks of Advanced Micro Devices, Inc.