data/TWiki/PatternSkinCssCookbookCenterPageBorder.txt
changeset 0 414e01d06fd5
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/data/TWiki/PatternSkinCssCookbookCenterPageBorder.txt	Sat Jan 26 15:50:53 2008 +0100
     1.3 @@ -0,0 +1,50 @@
     1.4 +%META:TOPICINFO{author="TWikiContributor" date="1141771402" format="1.1" version="3"}%
     1.5 +
     1.6 +---+!! PatternSkinCssCookbook Recipe: Center the page with a border
     1.7 +
     1.8 +*This recipe shows how to put a border around the page, while centering the page horizontally.* The example on this page uses a gradient image as background - on top of a gray base color. You can choose to set no image of course.
     1.9 +
    1.10 +<div class="twikiHelp">
    1.11 +This line loads the extra style definition:
    1.12 +<verbatim>
    1.13 +   * Set USERSTYLEURL = %ATTACHURL%/centerpageborder.css
    1.14 +</verbatim>
    1.15 +You can write this line in %SYSTEMWEB%.TWikiPreferences, in WebPreferences, in your user topic or on a single page.
    1.16 +</div>
    1.17 +
    1.18 +Add the dynamic variable link to the logo image to the topic text:
    1.19 +<verbatim>
    1.20 +<style type="text/css" media="all">
    1.21 +#patternScreen {
    1.22 +background-image:url("%ATTACHURLPATH%/gradient_page.gif");
    1.23 +background-repeat:repeat-x;
    1.24 +}
    1.25 +#patternPageShadow {
    1.26 +background-image:url("%PUBURLPATH%/%SYSTEMWEB%/PatternSkin/striped_pageshadow.gif");
    1.27 +}
    1.28 +</style>
    1.29 +</verbatim>
    1.30 +<div class="twikiHelp">
    1.31 +%ICON{info}% If you don't write this overloading style in a template and use an external =.css= file, you need to set the image to the absolute url:
    1.32 +<pre>
    1.33 +&lt;style type="text/css" media="all">
    1.34 +#patternScreen {
    1.35 +background-image:url("%<nop>ATTACHURLPATH%/gradient_page.gif");
    1.36 +background-repeat:repeat-x;
    1.37 +}
    1.38 +&lt;/style>
    1.39 +</pre>
    1.40 +You can always write a =&lt;style>= in a topic - all current browsers support this - but the page won't validate as valid XHTML.
    1.41 +</div>
    1.42 +
    1.43 +<style type="text/css" media="all">
    1.44 +#patternScreen {
    1.45 +background-image:url("%ATTACHURLPATH%/gradient_page.gif");
    1.46 +background-repeat:repeat-x;
    1.47 +}
    1.48 +#patternPageShadow {
    1.49 +background-image:url("%PUBURLPATH%/%SYSTEMWEB%/PatternSkin/striped_pageshadow.gif");
    1.50 +}</style>
    1.51 +
    1.52 +%META:FILEATTACHMENT{name="centerpageborder.css" attr="" autoattached="1" comment="css to frame the page centered on the screen" date="1129323328" path="centerpage.css" size="259" user="TWikiContributor" version=""}%
    1.53 +%META:FILEATTACHMENT{name="gradient_page.gif" attachment="gradient_page.gif" attr="" comment="background image" date="1141771401" path="gradient_page.gif" size="3854" stream="gradient_page.gif" user="TWikiContributor" version="1"}%