LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Slackware (http://www.linuxquestions.org/questions/slackware-14/)
-   -   Changing the parameter of an inline style declaration in HTML? (I know... off topic) (http://www.linuxquestions.org/questions/slackware-14/changing-the-parameter-of-an-inline-style-declaration-in-html-i-know-off-topic-4175430871/)

sombragris 10-06-2012 02:59 PM

Changing the parameter of an inline style declaration in HTML? (I know... off topic)
 
Hi fellow Slackers,

I know this is off-topic but I would like to ask this in this forum since it's home for me as a Slackware user, and also because its members are highly knowledgeable. So, please bear with this little question:

There's a webpage where a section with material I would like to see is surrounded by a <div> tag. Now, the problem is that this tag has an inline style that prevents it from being displayed, e.g., <div id="Whatever" display:none>

My question is: how could I alter that particular inline style without disrupting anything else on the page? I'm using Chrome and Firefox.

Thanks!

odm4286 10-06-2012 03:11 PM

Quote:

Originally Posted by sombragris (Post 4798935)
Hi fellow Slackers,

I know this is off-topic but I would like to ask this in this forum since it's home for me as a Slackware user, and also because its members are highly knowledgeable. So, please bear with this little question:

There's a webpage where a section with material I would like to see is surrounded by a <div> tag. Now, the problem is that this tag has an inline style that prevents it from being displayed, e.g., <div id="Whatever" display:none>

My question is: how could I alter that particular inline style without disrupting anything else on the page? I'm using Chrome and Firefox.

Thanks!

<div id="whatever" display:none><span style="blahh blah blah"> stuff you want to have styled</span></div>

That should do it

sombragris 10-06-2012 03:37 PM

odm4286: Thanks. But perhaps I didn't explain myself correctly.

The page is on the Web and I cannot edit it. What I would like is for the browser to alter singlehandedly, client-side, the inline style declaration so that display:none gets changed into something like display:screen (or simply gets deleted).

I want to do it transparently and automatically, every time I access the page. It would be something like AdBlock plus, but only for this particular style declaration.

Thanks :)

Didier Spaier 10-06-2012 04:10 PM

This could help if you use Firefox.

Or try the Stylish add-on for Firefox.

WetDreams 10-06-2012 04:27 PM

You could change it with javascript. on Firefox open the console with Ctrl+Shift+K and paste this line(change "whatever" with the id you need).
Code:

document.getElementById("whatever").style.display = "screen";
I am not very familiar with javascript but I believe the above should work.

If this works, you could install greasemonkey and install as a userscript in order to execute this automatically every time you visit the page.

I am not sure about chrome, but I guess something similar should work.

You could also use the Stylish addon that Didier Spaier suggested.

sombragris 10-06-2012 05:28 PM

Thanks, I'm going to try all the suggestions. I might go with stylish or the per-site CSS that Didier suggested.

sombragris 10-06-2012 06:00 PM

I'm happy to report that the Stylish add-on is available for both Chrome and Firefox and a simple userstyle fixed my problem. THANK YOU!!! Marking the thread as solved.


All times are GMT -5. The time now is 09:38 PM.