Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Page 1 of 2 12 LastLast
Results 1 to 15 of 25

Thread: CSS watermark

  1. #1
    Regular Coder
    Join Date
    Jun 2002
    Location
    Victoria, BC, Canada
    Posts
    962
    Thanks
    0
    Thanked 1 Time in 1 Post

    CSS watermark

    How do you create a watermark background using CSS? I've seen it done, though I don't remember where. I mean, it's a light-colored background image that doesn't tile, remains fixed, and merges neatly with a set background color.

  • #2
    Senior Coder
    Join Date
    Jul 2002
    Posts
    1,628
    Thanks
    0
    Thanked 0 Times in 0 Posts

  • #3
    Regular Coder
    Join Date
    Jun 2002
    Location
    Victoria, BC, Canada
    Posts
    962
    Thanks
    0
    Thanked 1 Time in 1 Post
    Thanks, but I figured it out using just CSS.

  • #4
    Senior Coder
    Join Date
    Jul 2002
    Posts
    1,628
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Thats the reason i gave you the link

    you can take
    url('notebook.jpg') white center no-repeat fixed
    out of that script and use it in CSS

  • #5
    Regular Coder
    Join Date
    Jun 2002
    Location
    Victoria, BC, Canada
    Posts
    962
    Thanks
    0
    Thanked 1 Time in 1 Post
    Hmmm...I didn't know that. I don't know DHTML, so I couldn't remove any of the script while being sure it would still work. By the way, what does the rest of the script DO? What's the point?

  • #6
    Senior Coder
    Join Date
    Jul 2002
    Posts
    1,628
    Thanks
    0
    Thanked 0 Times in 0 Posts
    things like
    if (document.all
    will display the watermark only if the page is being viewed in internet explorer, and something i just learned, opera as well

  • #7
    Regular Coder
    Join Date
    Jun 2002
    Location
    Victoria, BC, Canada
    Posts
    962
    Thanks
    0
    Thanked 1 Time in 1 Post
    So, like I asked, is it important? Does it really have to be there?

  • #8
    Senior Coder
    Join Date
    Jul 2002
    Posts
    1,628
    Thanks
    0
    Thanked 0 Times in 0 Posts
    yes, it should be in javascript with the browser recognition.
    in simple CSS it could cause problems with other browsers, however if you know the site will be viewed only in say IE then it can be used in just CSS
    Last edited by cg9com; 10-27-2002 at 05:22 AM.

  • #9
    Regular Coder
    Join Date
    Jun 2002
    Location
    Victoria, BC, Canada
    Posts
    962
    Thanks
    0
    Thanked 1 Time in 1 Post
    Why would it only work in Internet Explorer if it was just CSS?

  • #10
    Senior Coder
    Join Date
    Jul 2002
    Posts
    1,628
    Thanks
    0
    Thanked 0 Times in 0 Posts
    there is plenty of CSS that will only work in IE, that browser will use just about anything you type. hehe
    another example would be maybe (overflow:hidden)
    and user colored scrollbars
    i cant think of any tutorial websites that may help you understand more.
    but here are a few off the top of my head that could have some information on further questions.

    http://www.javascriptkit.com
    http://www.htmlgoodies.com
    http://www.w3schools.com

  • #11
    Regular Coder
    Join Date
    Jun 2002
    Location
    Victoria, BC, Canada
    Posts
    962
    Thanks
    0
    Thanked 1 Time in 1 Post
    So I guess I'll have to put that bit of code into every one of my pages then...Sigh...

  • #12
    Senior Coder joh6nn's Avatar
    Join Date
    Jun 2002
    Location
    72° W. 48' 57" , 41° N. 32' 04"
    Posts
    1,887
    Thanks
    0
    Thanked 1 Time in 1 Post
    um.

    both background, and overflow, are standard, and not IE proprietary.

    Grant, i'm not really sure why that snippet of code exists at all. supposedly, it would make the css fail gracefully in browsers that don't support it. except that css does that anyway, without the help of javascript.

    a good resource to see what works where is : http://www.xs4all.nl/~ppk/css2tests/intro.html
    bluemood | devedge | devmo | MS Dev Library | WebMonkey | the Guide

    i am a loser geek, crazy with an evil streak,
    yes i do believe there is a violent thing inside of me.

  • #13
    Regular Coder
    Join Date
    Jun 2002
    Location
    Victoria, BC, Canada
    Posts
    962
    Thanks
    0
    Thanked 1 Time in 1 Post
    So, I don't need to worry about that at all then?

  • #14
    Senior Coder joh6nn's Avatar
    Join Date
    Jun 2002
    Location
    72° W. 48' 57" , 41° N. 32' 04"
    Posts
    1,887
    Thanks
    0
    Thanked 1 Time in 1 Post
    no, you shouldn't need to worry about it.
    bluemood | devedge | devmo | MS Dev Library | WebMonkey | the Guide

    i am a loser geek, crazy with an evil streak,
    yes i do believe there is a violent thing inside of me.

  • #15
    Regular Coder
    Join Date
    Jun 2002
    Location
    Victoria, BC, Canada
    Posts
    962
    Thanks
    0
    Thanked 1 Time in 1 Post
    Phew! You've just saved me a lot of work- I have almost 50 pages in my site, and it would have been a hassle to have to add that javascript to every one of my pages. Thanks a lot!


  •  
    Page 1 of 2 12 LastLast

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •