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
  1. #1
    New Coder
    Join Date
    Oct 2007
    Posts
    40
    Thanks
    3
    Thanked 0 Times in 0 Posts

    DIV and External CSS

    Hi all,

    I am trying to add a link to my logo using DIV and external CSS. Here is what I got so far:

    HTML:

    Code:
    <div id="logo"></div>

    External CSS:

    Code:
    #logo {
    
    background:url(assets/logos/dragon14.gif) center repeat-y ;
    	display: block; 
    	margin:0 auto; 
    	width: 953px;
    	height: 130px; 
    	text-align: center;
    
    }



    I was able to make the logo to show up but was not sure on how to add a link on the logo so it will link to the home or index.html web page.

    Thanks in advanced!!

  • #2
    Senior Coder twodayslate's Avatar
    Join Date
    Mar 2007
    Location
    VA
    Posts
    1,042
    Thanks
    67
    Thanked 39 Times in 39 Posts
    Code:
    <div id="logo">
        <a href="http://site.com" title="site name"><img src="#" alt="site name" /></a>
    </div>
    twitter | Quality Hosting - $5.95/mo*
    Feel free to PM me!

  • #3
    Supreme Master coder! abduraooft's Avatar
    Join Date
    Mar 2007
    Location
    N/A
    Posts
    14,852
    Thanks
    160
    Thanked 2,223 Times in 2,210 Posts
    Blog Entries
    1
    How about

    Code:
    #logo {
    background:url(assets/logos/dragon14.gif) center repeat-y ;
    	display: block; 
    	margin:0 auto; 
    	width: 953px;
    	height: 130px; 
    	text-align: center;
            text-indent:-9999px;
    }
    Code:
    <a id="logo">Some text for robots</a>
    The Dream is not what you see in sleep; Dream is the thing which doesn't let you sleep. --(Dr. APJ. Abdul Kalam)

  • #4
    The Apostate Apostropartheid's Avatar
    Join Date
    Oct 2007
    Posts
    3,215
    Thanks
    16
    Thanked 265 Times in 263 Posts
    I would advise highly against using a background image. These images have meaning in this context and therefore should be used as a physical img with descriptive alt text.


  •  

    Posting Permissions

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