|
Posted by Adrienne Boswell on 08/28/06 18:44
HJ wote:
> Hi, I am pretty new in CSS. What I want to do is to have a child div to
> cover the parent div, so all the text links (actually anything) in the
> parent div are NOT clickable. Basically, the child div needs to have
> the same width and height as the parent div.
>
> The following is some sample code:
> //*************************************************************
> <STYLE type="text/css">
> .front {
> width:100%;
> height:100%;
> border:2px solid #00C;
> background-color:#C0C0C0;
> position:absolute;
> </STYLE>
>
> <DIV>
> <div class="front"></div>
> Some text...
> <p><a href="http://www.yahoo.com">Yahoo</a></p>
> Some more text...
> </DIV>
> //*************************************************************
> The problem with the code is that, the parent div does not have a
> height. So the child div doesn't have a height value to cover the whole
> parent div.
>
> The problem I am facing now is that the height of the parent div is
> dynamic. The content in the parent div is generated dynamically in for
> loop. So I can't define a height for the parent div in the code.
>
> If there is any work around in this, please help me out here... :)
> Thanks a lot.
> HJ
1. Do you have a URL? It might be easier that way.
2. I don't quite understand why you need to cover the parent. Why
bother? If you don't want something to be clickable, don't make it a
href, and then you won't have to worry about it. It would be confusing
and frustrating for the user, who _thinks_ something is a link, and
can't click on it. Links want to be links.
--
Adrienne Boswell at work
Administrator nextBlock.com
http://atlas.nextblock.com/files/
Please respond to the group so others can share
Navigation:
[Reply to this message]
|