Xport Interface: stylesheet_rule::push_back
Inserts a declaration into the called stylesheet_rule.
virtual void stylesheet_rule::push_back(1st Variety
const declaration& decl
);
Parameters
decl
A declaration object.
Returns
Nothing.
Remarks
This operation is used to insert declarations into the called stylesheet_rule. This operation is similar to stylesheet_rule::insert(declaration), except that this operation does not return an iterator. The declaration is inserted at
the end of the rule.
Complexity
Constant
Examples
1st Variety
#include "xhtml_doc.h"
#include <iostream>
int main(int argc, char* argv[])
{
using namespace Xport;
stylesheet ss;
ss.insert(stylesheet_comment("Sample stylesheet"));
stylesheet::iterator it = ss.insert(stylesheet_rule("h1"));
it->push_back(declaration(text_align, "center"));
it->push_back(declaration(css::color, "red"));
it = ss.insert(stylesheet_rule("p"));
it->push_back(declaration(margin_left, "10px"));
it->push_back(declaration(font_size, "10pt"));
stylesheet_formatter fmtr(std::cout);
ss.write(fmtr);
}