CSS on my note affects the whole screen

Forum for general requests for support for players. Both staff members and veteran players can help new players with problems they encounter. No chatting in this forum, please.

Moderators: Public Relations Department, Players Department, Programming Department

User avatar
Swingerzetta
Posts: 615
Joined: Mon Feb 11, 2013 11:21 pm

CSS on my note affects the whole screen

Postby Swingerzetta » Wed Feb 12, 2014 5:32 am

I have a note in which I use a <style> tag to change the style of td and th elements, and, in particular, makes the background of td's white. When I view this note, I notice that the top of the page, and several other elements, are now on white backgrounds.
User avatar
joo
Posts: 5021
Joined: Fri Jun 17, 2005 2:26 pm
Location: London, UK

Re: CSS on my note affects the whole screen

Postby joo » Wed Feb 12, 2014 6:56 am

You could use the fact that everything in a note is inside a <pre> tag, and everything outside is not, by changing your styles in the following way:

Change:

Code: Select all

td { background: red }


To:

Code: Select all

pre td { background: red }
Last edited by joo on Thu Feb 13, 2014 10:24 pm, edited 1 time in total.
User avatar
Swingerzetta
Posts: 615
Joined: Mon Feb 11, 2013 11:21 pm

Re: CSS on my note affects the whole screen

Postby Swingerzetta » Thu Feb 13, 2014 12:40 am

That works great! Thanks. I didn't know about that.
So, using two items not separated by commas means the style will only be applied to td's inside pre's?
User avatar
EchoMan
Posts: 7768
Joined: Fri Aug 26, 2005 1:01 pm
Location: Stockholm, Sweden

Re: CSS on my note affects the whole screen

Postby EchoMan » Thu Feb 13, 2014 6:22 am

Yes, that is how it works. You could also add a div and an id, e.g.

Code: Select all

<style>
#mystuff ul { background: #fff; }
</style>

...

<div id="mystuff">
<ul>
<li>first item</li>
<li>Second item</li>
</ul>
</div>


... or use specific classes, eg.

Code: Select all

<style>
.my-td { background: #fff; }
</style>

...

<td class="my-td">whatever</td>

...

Return to “General Support”

Who is online

Users browsing this forum: No registered users and 0 guests