Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium

x
?
Solved

Html div anchor tag

Posted on 2009-12-20
13
Medium Priority
?
484 Views
Last Modified: 2012-05-08
Dear Experts,

I have one division in my html page and i have given a background image in css now i want to put anchor tag on bg image how its possible please tell me
0
Comment
Question by:virafh
10 Comments
 
LVL 7

Accepted Solution

by:
techsathish earned 336 total points
ID: 26094050
Hi

Try this...

<style>

h1.logo a {
      width: 208px;
      display: block;
      background: url(images/your_logo.png) no-repeat;
      height: 80px;
      position: relative;
      z-index: 100;
}


</style>

<h1 class="logo">
    <a href="index.php" title="example.com"></a>
</h1>
0
 
LVL 15

Assisted Solution

by:rajeeshmca
rajeeshmca earned 332 total points
ID: 26094059
Hi,

Put the anchor tag around the div. This will work..

something like

<a href="" .... >
<Div class="sss">
</Div>
</a>..

if u can post ur code it would be better
0
 
LVL 7

Expert Comment

by:techsathish
ID: 26094198
Hi,
We can use like this also

<style>

div.logo a {
      width: 208px;
      display: block;
      background: url(images/your_logo.png) no-repeat;
      height: 80px;
      position: relative;
      z-index: 100;
}


</style>

<div class="logo">
    <a href="index.php" title="example.com"></a>
</div>
0
Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
LVL 4

Expert Comment

by:apexpert
ID: 26094985
<a href="#yourdividhere">Any content</a>
0
 

Author Comment

by:virafh
ID: 26095094
the above example not work for me.see my code
   <div class="icon">
            <div class="no">
                <a runat="server" id="aInbox" href="../inbox.aspx"></a>
            </div>
        </div>
0
 
LVL 7

Expert Comment

by:techsathish
ID: 26095318
Hi tried this?

<style>

div.no a {
      width: 208px;
      display: block;
      background: url(images/your_logo.png) no-repeat;
      height: 80px;
      position: relative;
      z-index: 100;
}


</style>

<div class="icon">
    <div class="no">
        <a runat="server" id="aInbox" href="../inbox.aspx"></a>
    </div>
</div>

Otherwise gimme the link. i ll try to fix that problem...
0
 
LVL 16

Assisted Solution

by:s8web
s8web earned 332 total points
ID: 26097527
I'm sorry about my lack of asp prowess, I don't know what to do with runat="server". Otherwise, this will work:


<div class="icon" >
   <div id="aInbox" class="no" onclick="location.href='../inbox.aspx';" style="cursor:pointer;">
        Everything in here will go to ../inbox.aspx when clicked.
    </div>
</div>
0
 
LVL 16

Expert Comment

by:s8web
ID: 26111241
"Please delete this question i got the answer from experts."

"i got the answer from experts"

That's the way Expert's Exchange works. I don't understand why you would want to delete the question. If someone provided your solution in this thread, you should accept the comment as the solution and award points.
0
 
LVL 7

Expert Comment

by:techsathish
ID: 26111308
I don't know why you want to delete the question. Experts exchange is one of the famous forum. I cant believe this.  
0
 
LVL 7

Expert Comment

by:techsathish
ID: 26111320
If someone answer is correct they have to award point. Why deletion happening here...
0

Featured Post

Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This article demonstrates how to create a simple responsive confirmation dialog with Ok and Cancel buttons using HTML, CSS, jQuery and Promises
The first step to building an amazing About page is to figure out what you want the page to say about your company. You then must grab the attention of the reader, boast a bit, tell a story and let others brag about you. With a little bit of thought…
In this tutorial viewers will learn how to embed an audio file in a webpage using HTML5. Ensure your DOCTYPE declaration is set to HTML5: : The declaration should display (CODE) HTML5 is supported by the most recent versions of all major browsers…
Video by: Mark
This lesson goes over how to construct ordered and unordered lists and how to create hyperlinks.
Suggested Courses

572 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question