Page 2 of 2 FirstFirst 12
Results 11 to 20 of 20

Thread: Convert div tag to work as a link ???

  1. #11
    Join Date
    Jan 2006
    Posts
    234
    Thanks
    5
    Thanked 0 Times in 0 Posts

    Default

    Quote Originally Posted by molendijk View Post
    Cheng, since you just want to have a link in a div for downloading Adobe Reader, you could do this, which opens a new window:
    Code:
    <div id="adobe" href="javascript:void(0)" onclick="window.open('bla.html')">Here you can gratis download Adobe Reader which is necessary to open the files</div>
    where 'bla.html' is the page you want to access. (That will probably a page with a download-link for Adobe).
    ----
    Arie.
    .......I tried this but the cursor wont change to a hand when placed over the link, so I'm trying to go for the easy solution and just place a link inside the div tag but now there is a bullet showing and I don't know how it get there and can't get rid of it as well.
    Is there a way to get rid of this bullet (see image) ..?...

    Cheng

  2. #12
    Join Date
    Sep 2007
    Location
    The Netherlands
    Posts
    1,881
    Thanks
    49
    Thanked 266 Times in 258 Posts
    Blog Entries
    56

    Default

    Quote Originally Posted by Cheng View Post
    .......I tried this but the cursor wont change to a hand
    My stupid fault. Just put:
    Code:
    <div id="adobe" style = "cursor:pointer;hand" onclick = "window.open('bla.html')">Here you can gratis download Adobe Reader which is necessary to open the files</div>
    Arie

  3. The Following User Says Thank You to molendijk For This Useful Post:

    Cheng (04-05-2008)

  4. #13
    Join Date
    Feb 2008
    Location
    Cebu City Philippines
    Posts
    1,160
    Thanks
    17
    Thanked 277 Times in 275 Posts

    Default

    Quote Originally Posted by molendijk View Post
    My stupid fault. Just put:
    Code:
    <div id="adobe" style = "cursor:pointer;hand" onclick = "window.open('bla.html')">Here you can gratis download Adobe Reader which is necessary to open the files</div>
    Arie
    There is no hand value in the cursor property
    For further Reading
    Learn how to code at 02geek

    The more you learn, the more you'll realize there's much more to learn
    Ray.ph!

  5. #14
    Join Date
    Jan 2006
    Posts
    234
    Thanks
    5
    Thanked 0 Times in 0 Posts

    Thumbs up

    .......molendijk thanks a lot!
    Now I got it working exactly like I want it to.

    W3C Markup Validation Service says: This Page Is Valid HTML 4.01 Transitional!

    I really appreciate the help.

    Thanks again very much.......
    Cheng

  6. #15
    Join Date
    Sep 2007
    Location
    The Netherlands
    Posts
    1,881
    Thanks
    49
    Thanked 266 Times in 258 Posts
    Blog Entries
    56

    Default

    Quote Originally Posted by rangana View Post
    There is no hand value in the cursor property
    Rangana, there is: style="cursor: pointer;hand" !!
    ('hand' is for IE; 'pointer' is for non-IE).
    ----
    Arie
    Last edited by molendijk; 04-05-2008 at 12:37 PM. Reason: Correction

  7. #16
    Join Date
    Apr 2008
    Posts
    38
    Thanks
    9
    Thanked 1 Time in 1 Post

    Default

    You could do an onclick attribute.

  8. #17
    Join Date
    Jul 2006
    Location
    just north of Boston, MA
    Posts
    1,806
    Thanks
    13
    Thanked 72 Times in 72 Posts

    Default

    Quote Originally Posted by Cheng View Post
    .......sorry, but I don't know how to do it using a long anchor tag.
    Could you give me an example please.......
    the size of the anchor depends on the developer

    Code:
    <a href="/link/to/page">ANCHOR CONTENT</a>
    the content that you put inside the anchor tag is under your discretion... whatever you put inside the href attribute is what the browser will go to when the text / other element is clicked on

  9. #18
    Join Date
    Jan 2009
    Posts
    2
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    i realize this is kind of an old thread, but i was wondering if there is now a better way to do this.

    also if there is not a better way to do this, is it possible using the java option to get it to open in the same window as opposed to a new one.

    thank you

  10. #19
    Join Date
    Sep 2009
    Posts
    10
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    Quote Originally Posted by Cheng View Post
    Hi.

    Is it possible to have a div tag work as a link?
    Not just the text inside the tag but the whole tag.
    What I want to do is to have the following tag work as a link but I don't know how to do it in Dreamweaver.

    Div Tag
    Code:
    <div id="adobe">Here you can gratis download Adobe Reader which is necessary to open the files.</div>
    CSS
    Code:
    #adobe {
    	font-family: Verdana, Arial, Helvetica, sans-serif;
    	font-size: 11px;
    	font-weight: normal;
    	padding-left: 60px;
    	background-image: url(../images/adobe.gif);
    	background-repeat: no-repeat;
    	height: 40px;
    	padding-top: 11px;
    }
    Please someone give me a hint how to do this or maybe recommend a javascript if one is needed to achive this.

    Thanks in advance,
    Why not just wrap the entire <div> inside an <a> tag? Something like:
    <a><div>Your information here.</div></a>

    I have used this to hyperlink the entire div before. It even works if you include an image inside the div - the image and text both are hyperlinked. You can control the style of the hyperlink using CSS. Hope that this is helpful.

  11. #20
    Join Date
    Mar 2005
    Location
    SE PA USA
    Posts
    30,495
    Thanks
    82
    Thanked 3,449 Times in 3,410 Posts
    Blog Entries
    12

    Default

    Please start a new thread for a new question.
    - John
    ________________________

    Show Additional Thanks: International Rescue Committee - Donate or: The Ocean Conservancy - Donate or: PayPal - Donate

Bookmarks

Posting Permissions

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