SimplePortal

Customization => Themes and Graphics => Topic started by: ncoded on December 16, 2015, 08:56:28 AM

Title: custom styling of HTML Block
Post by: ncoded on December 16, 2015, 08:56:28 AM
I stumbled upon this way of styling my custom HTML blocks: I write up a custom .css file to my liking and load it from within the <head>.

This way, the content of each block (not the block itself) gets its own styling. One advantage of this approach, in my opinion, is that it does not interfere in any way with other styling (such as index.css, portal.css) and that makes for an easy upgrade. I did not yet run the file through a css validator, but I do not expect it to fail, either.

My question is: does anyone see a problem with this approach? Is it posing a security risk? Is there a better way to do this?

Regards.
Title: Re: custom styling of HTML Block
Post by: ♦ Ninja ZX-10RR ♦ on December 16, 2015, 09:05:14 AM
You could also target it using the block id, but it works anyway.
There is no way to hack css, since it's just graphic stuff, you can't inject executable code in it.

Regards
Title: Re: custom styling of HTML Block
Post by: ncoded on December 17, 2015, 12:46:55 AM
Thanks, Ninja, I will then push this idea further to customize the look of my blocks.
Title: Re: custom styling of HTML Block
Post by: ♦ Ninja ZX-10RR ♦ on December 17, 2015, 08:48:40 AM
One of my old first topics in here might be useful :)
http://simpleportal.net/index.php?topic=13732
Title: Re: custom styling of HTML Block
Post by: ncoded on December 17, 2015, 01:20:42 PM
Yes, helpful especially with better understanding the portal and its "hidden" power. Though in this particular care I still prefer my way only because I fell more comfortable navigating between different blocks and custom stylings without having to change anything on the portal or smf files; I am completely segregated, which gives me peace of mind.
SimplePortal 2.3.8 © 2008-2024, SimplePortal