Tycoon Talk
Become a Big fish!
The number 1 forum for online business!
Post topics, ask questions, share your knowledge.
Tycoon Talk is part of Freelancer.com - find skilled workers online at a fraction of the cost.

CSS Forum


You are currently viewing our CSS Forum as a guest. Please register to participate.
Login



Reply
Old 03-05-2009, 11:52 AM Transfer click event in a div to a link contained on it
Junior Talker

Posts: 2
Name: Luis Sieira
Trades: 0
I've been several days trying to make a simple thing.

More or less it consists in make a div behave like a link, or transfer the click event in a div to a link contained on it

I have this (my apoligies for the spanish comments :-P)

HTML Code:
#sidepanel {
    /** Dimensiones */
    overflow: visible;
     
    width: 15%;
    min-width: 100px;
    max-width: 15%;
    
    /** Posicion */
    position: absolute;
    vertical-align: top;
    left: 1%;
     right: 1%;
     top: 20%;

    /** Contenido */
    background: navy;
    text-align: center;
    padding-top: 10px;
    padding-bottom: 10px;
}

#sidepanel .sidepanellink {
    /** Colores */
    background: #4444FF;
    background-color: #4444FF;
    color: white;
    
    /** Dimensiones */
    
    /** Márgenes */
    margin-left: 2%;
    margin-right: 2%;
    margin-top: 1%;
    margin-bottom: 1%;
}

#sidepanel .sidepanellink:hover {
        /** Colores */
    background: #6666FF;
    background-color: #6666FF;
}

#sidepanel a {
    color: white;
    font-family: sans-serif;
    font-variant: small-caps;
    font-weight: bold;
    padding-bottom: 3px;
}

<div id="sidepanel">

<div class="sidepanellink"><a href="index.jsp">Index</a></div>
<div class="sidepanellink"><a href="AssessmentListView.jsp">Asessment view</a></div>
<div class="sidepanellink"><a>Opcion</a></div>
<div class="sidepanellink"><a>Opcion</a></div>
<div class="sidepanellink"><a>Opcion</a></div>
<div class="sidepanellink"><a>Opcion</a></div>


<p>
    <a href="http://jigsaw.w3.org/css-validator/check/referer">
        <img style="border:0;width:88px;height:31px"
            src="http://jigsaw.w3.org/css-validator/images/vcss-blue"
            alt="ˇCSS Válido!" />
    </a>
</p>


</div>
I want this "sidepanellink" to behave like a link.

Now, to get the linked document you have to click over the letters inside the pretended button, clicking in the blankspace around the letters will have no effect.

I want to transfer the click event in the div to the link inside it.

Is it possible to make such a thing without using Java Script?

(answer is yes, i've seen this effect many times... but, how is it done? I've analized many css's and html's without succeed....)

Thanks in advance

Last edited by Sieira; 03-05-2009 at 11:59 AM..
Sieira is offline
Reply With Quote
View Public Profile
 
 
Register now for full access!
Old 03-05-2009, 12:04 PM Re: DIV as a link
chrishirst's Avatar
Missing! presumed drunk.

Posts: 42,371
Name: Chris Hirst
Location: Blackpool. UK
Trades: 0
Code:
.sidepanellink a {
     display:block;
     height:100%;
}
__________________
Chris. ->>
Please login or register to view this content. Registration is FREE
<<-

A foolish consistency is the hobgoblin of little minds
Thought for today:- Is SEO the only industry where all the cowboys are Indians?
chrishirst is offline
Reply With Quote
View Public Profile Visit chrishirst's homepage!
 
Old 03-05-2009, 01:05 PM Re: DIV as a link
Junior Talker

Posts: 2
Name: Luis Sieira
Trades: 0
So thankful!
Sieira is offline
Reply With Quote
View Public Profile
 
Reply     « Reply to DIV as a link
 

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off





   
RSS Feed  Feeds: RSS   JS   XML
RSS Feed  Feeds for this forum: RSS   JS   XML



Page generated in 0.22211 seconds with 12 queries