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.
Results 1 to 4 of 4

Thread: links in css

  1. #1
    New Coder
    Join Date
    Nov 2008
    Location
    Melbourne, Australia
    Posts
    69
    Thanks
    8
    Thanked 1 Time in 1 Post

    links in css

    I have never done this before, so I dont know if its possible... but can you create a link using css. I have a banner img and I want the img to link back to the news page. I have 25 or so pages so I really cant be bothered going through and linking them by hand.

    Code:
    #banner {background-color:#000000; width:600px; height:100px; background-image:url(logo.png); background-repeat:no-repeat;}
    any ideas?

  • #2
    Supreme Master coder! abduraooft's Avatar
    Join Date
    Mar 2007
    Location
    N/A
    Posts
    14,866
    Thanks
    160
    Thanked 2,224 Times in 2,211 Posts
    but can you create a link using css.
    Impossible. CSS is only capable to add some styles to an element, and not capable to add/remove an attribute or an html element.

    If you can depend upon some javascript, then it may be possible.
    Last edited by abduraooft; 11-13-2008 at 01:17 PM.
    The Dream is not what you see in sleep; Dream is the thing which doesn't let you sleep. --(Dr. APJ. Abdul Kalam)

  • Users who have thanked abduraooft for this post:

    kryssy23 (11-13-2008)

  • #3
    New Coder
    Join Date
    Nov 2008
    Location
    Melbourne, Australia
    Posts
    69
    Thanks
    8
    Thanked 1 Time in 1 Post
    ok thanks for that.. thought as much..

  • #4
    Regular Coder Donkey's Avatar
    Join Date
    Sep 2003
    Location
    Blackfield UK
    Posts
    312
    Thanks
    1
    Thanked 36 Times in 36 Posts
    Why not put the image and it's link inside a server side include and include it in every page, then you only have to change the link once.
    " 90% of everything is crud" - Theodore Sturgeon
    Filthy Beast - a 60's Rock Band


  •  

    Posting Permissions

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