Why use direct style= anywhere
Request and discussion moved to PITS:01173.
why is a color word not a class class, eg
(:div class="frame green"
style="font-size:smaller":)
This text should be small, green, and
surrounded by a frame
(:divend:)
|
This text should be small, green, and surrounded by a frame
|
In a (:div:) or a (:table:) (:cell:) etc., WikiStyles are not used, what you type are regular HTML attributes class and style. So, if you have a "div.green" defined in your local CSS, it should be applied. We do not have it defined on pmwiki.org, so the text shouldn't be green. :-) It can work this way:
(:div class="frame"
style="font-size:smaller; color:
green;":)
This text should be small, green, and
surrounded by a frame
(:divend:)
|
This text should be small, green, and surrounded by a frame
|
why does this not work?
(:div class="blue rframe" style="font-size:smaller":)
This text should be small, blue, and surrounded by a right floated frame
(:divend:)
|
This text should be small, blue, and surrounded by a right floated frame
|
Because, confusingly, rframe is not a class.
(:div class="blue rfloat frame" style="font-size:smaller":)
This text should be small, blue, and surrounded by a right floated frame
(:divend:)
|
This text should be small, blue, and surrounded by a right floated frame
|
In a (:div:) or a (:table:) (:cell:) etc., WikiStyles are not used, what you type are regular HTML attributes class and style. If your local CSS files have defined the classes .blue and .rframe, your browser should apply them. On pmwiki.org these classes are not defined, so your browser shouldn't apply them.
"rframe" is a WikiStyle, not a CSS style or a CSS class. WikiStyles are implemented differently to be combined and applied differently.
Is a wiki style a class
No, it is a WikiStyle, not a CSS style or a CSS class. WikiStyles are implemented differently to be combined and applied differently.
%define=bclass bgcolor=#ddddff
border="1px dotted green"%
(:table:)
(:cellnr bclass:) test one
(:cellnr class="bclass":) test two
(:cellnr:)%bclass% test three
(:cellnr:)
>>bclass<<
test four
>><<
(:cellnr:)
(:div class="bclass":)
test five
(:divend:)
(:tableend:)
|
| test one
| | test two
| | test three
| |
| |
|
|
It would be helpful to provide more consistency.
%define=zclass block bgcolor=#ddddff
border="1px dotted green"%
(:table:)
(:cellnr zclass:) test one
(:cellnr class="zclass":) test two
(:cellnr:)%zclass% test three
(:cellnr:)
>>zclass<<
test four
>><<
(:cellnr:)
(:div class="zclass":)
test five
(:divend:)
(:tableend:)
|
| test one
| | test two
| | test three
| |
| |
|
|
What happened to test 3?
Why does neither of these apply styles to the contents of the DIV?
(:div class='lfloat' font-size='smaller' color='blue' bgcolor='#eee'
clear='left' :)
{*$Name}
(:divend:)
(:div style="font-size:'smaller'; color:'blue'; background-color:'#eee';
float:left; clear:'left';" :)
{*$Name}
(:divend:)
|
|
|
The first example defines HTML attributes of which only "class" is understood by browsers -- if there is a css class "lfloat", it should be respected. The second example contains invalid CSS styles so your browser ignores them -- you should remove the apostrophes.
(:div class='frame lfloat':)
{*$Name}
(:divend:)
(:div style="font-size:smaller; color:blue; background-color:#eee;
float:left; clear:left;" :)
{*$Name}
(:divend:)
|
|
|
... or these
%define=mytrail div font-size='smaller' background-color='#eee'
float='right' clear='right' %
(:div:)
%mytrail%{*$Name}
(:divend:)
(:div mytrail:)
{*$Name}
(:divend:)
|
|
|
Remove apostrophes from style definition like this
(:div style="font-size: smaller ; color: blue ; background-color: #eeeeee ;
" :)
{*$Name}
(:divend:)
|
|
|
How do I specify background-color?
%bgcolor=green% green
%bgcolor=#faf0b4% #faf0b4
%bgcolor:brown% brown
%bgcolor:#b4e6b4% #b4e6b4
%background-color=pink% pink
%background-color:yellow% yellow
%style='background-color:blue;'% blue
%background=green% green
%background=#ffbebe% #ffbebe
%background:brown% brown
%background:#b4e6b4% #b4e6b4
(:table:)
(:cellnr style="background:#faf0b4;" :) Role
(:cell style="background:#ffbebe;" :) Moment, Interval
(:cell style="background:#b4c8d2;" :) Description
(:cell style="background:#b4e6b4;" :) Party, place, thing
(:tableend:)
|
green
#faf0b4
brown
#b4e6b4
pink
yellow
%style='background-color:blue;'% blue
green
#ffbebe
brown
#b4e6b4
| Role
| Moment, Interval
| Description
| Party, place, thing
|
|
With a WikiStyle between %...% or >>...<< :
- If you have a CSS class, eg. "bggreen" defined in local css, use
%bggreen% or >>bggreen<< without quotes.
- If you don't have a CSS class, use:
%bgcolor=green% or >>bgcolor=green<< without quotes or semicolons.
In a HTML attribute class= or style= in (:div:), (:table:), (:head:), (:cell:) or ||-table, use
- If you have a CSS class, eg. "bggreen" defined in local css, use
(:div class=bggreen:).
- If you don't have a CSS class, use
(:div style="background-color:green;":) between quotes and with an ending semicolon.