watermark with position fixed : position fixed « Layout « HTML / CSS






watermark with position fixed

 


<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html>
     <head>
      <meta http-equiv="content-type" content="text/xhtml; charset=windows-1252" />
      <meta http-equiv="content-language" content="en-us" />
        <style type="text/css">
            h1, h2 {
                margin: 0;
                background: gray;
            }
            h1 {
                border-bottom: 5px solid black;
            }
            div {
                background: lightgrey;
                padding: 0.7em;
                clear: left;
            }
            div#watermark {
                position: fixed;
                bottom: 10px;
                right: 10px;
                font-size: 4em;
                padding: 0.1em;
                background: white;
                color: gray;
                opacity: 0.5;              
            }
            div#watermark a {
                color: black;
                text-decoration: none;
            }
            
            p {
                border: 0.05em solid black;
                padding: 0.8em;
            }
            h3:target {
                color: yellow;
                background: red;
            }

            ul#top li a {
                color: black;   
            }

        </style>
    </head>
    <body>
        <div>
            <h2>faq</h2>
            This is a test. This is a test. This is a test. This is a test. This is a test. 
            <br/><br/><br/><br/><br/><br/><br/><br/><br/><br/>
            <br/><br/><br/><br/><br/><br/><br/><br/><br/>
            <br/><br/><br/><br/><br/><br/>
            This is a test. This is a test. This is a test. This is a test. This is a test. 
            <br/><br/><br/><br/><br/><br/><br/><br/><br/><br/>
            <br/><br/><br/><br/><br/><br/><br/><br/><br/>
            <br/><br/><br/><br/><br/><br/>
            This is a test. This is a test. This is a test. This is a test. 
            This is a test. This is a test. This is a test. 
            <br/><br/><br/><br/><br/><br/><br/><br/><br/><br/>
            <br/><br/><br/><br/><br/><br/><br/><br/><br/>
            <br/><br/><br/><br/><br/><br/>
        </div>
        <div id='watermark'>
            <a href=''>W</a>
        </div>
    </body>
</html>

 








Related examples in the same category

1.Elements with a fixed position are always positioned relative to the browser's viewport, not in a document's structure.
2.position:fixed positions an element at an offset from the viewport.
3.Elements with a fixed position stay in place, even when a document is scrolled.
4.Using Fixed Positioning
5.Fixed position and static position
6.position fixed: top left
7.Fixed top, footer and left bar
8.Position:fixed header
9.Absolute and fixed positioning use left, right, top, bottom, and z-index to control the alignment of the absolute box.
10.move an element into its own layer and fix its position to the viewport.
11.Fixed block with width and height to bottom and top
12.fixed block to top and left
13.Fixed block to top and right
14.Fixed block to bottom and left
15.Fixed block to bottom and right
16.position-fixed offset: left top