/    Sign up×
Community /Pin to ProfileBookmark

Advance Problem about boxing model with link and rollover

hi all…
Thanks in advance for any solutions

so… here are [B]the facts[/B]:
1.im displaying only the half image…in hover shows the other half
2.this is a box model div for dynamic products
3.the hover function works fine
4.the link on the image works fine in Firefox
5.the image in my example is 75×100

[B]The problem: [/B]
The hyperlink works everywhere in the main div…exept over the image (only the hyperlink, not the hover)
and i dont know why???? grrr
i remind you that the problem is only in IE not in FF

[B]html: [/B]

[CODE]<div class=”boxnav”><a href=”#”>
<div id=icon_container>
<div id=icon><img src=”image.jpg” border=”0″></div></div>
<div>title</div></a></div> [/CODE]

[B]css: [/B]

[CODE]div.boxnav {
z-index:1;
margin: 0pt;
font: 11px Tahoma, Arial, sans-serif;
white-space: nowrap;
height: 140px;
width: 18em;
float:left;
border-right: 1px solid #ccc;
border-bottom: 1px solid #ccc;
position:relative;
}

div.boxnav div { margin-left: 15px;}

div.boxnav a {
text-decoration: none;
color: #999;
font-weight: bold;
display: block;
width: 100%;
height: 100%;
position:absolute;
}
div.boxnav a:hover {
background-color: #f4f4f4;
color: #000066;
}
div.boxnav #icon_container {

margin-top: 50px;
overflow: hidden;
width: 75px;
height: 50px;
}
div.boxnav div#icon { margin:0px;margin-top: -50px;}
div.boxnav a:hover #icon {margin:0px;} [/CODE]

Thanks again

ps. ithink that the #icon_container was something bug-able ?

to post a comment
CSS

9 Comments(s)

Copy linkTweet thisAlerts:
@WebJoelMay 21.2006 — ....div.boxnav div#icon {[B] margin:0px;margin-top: -50px;}[/B]

div.boxnav a:hover #icon {margin:0px;} [/CODE]

ps. ithink that the #icon_container was something bug-able ?[/QUOTE]


Well, incorrect syntax, anyway.

Try:
[CODE]margin:-50px 0;[/CODE]
Might not make a difference, but declare values once. "margin:0px" means all margins are zero. Then you declare the top margin as -50px. Combine them into one statement. ?
Copy linkTweet thisAlerts:
@ithinkcssauthorMay 21.2006 — Well, incorrect syntax, anyway.[/QUOTE]

ok thanks WebJoel...but i dont think that this is the solution

besides the last value is counting ?
Copy linkTweet thisAlerts:
@ray326May 22.2006 — Also it would need to be margin: -50px 0 0 0; or you'll get that unwanted margin on the bottom. The reason the link works wierdly is because <a> is an inline element, which is not allowed to contain block elements.
Copy linkTweet thisAlerts:
@ithinkcssauthorMay 22.2006 — The reason the link works wierdly is because <a> is an inline element, which is not allowed to contain block elements.[/QUOTE]

thanks ray326

by "contain block elements" you mean all the kind of div or just div with display:block?

because i dont have any

also how the last div with title works fine?
Copy linkTweet thisAlerts:
@ray326May 23.2006 — by "contain block elements" you mean all the kind of div or just div with display:block?[/QUOTE]Divs are block elements and cannot be contained inside inline elements like anchors.
also how the last div with title works fine?[/QUOTE]Browser confusion.
Copy linkTweet thisAlerts:
@ithinkcssauthorMay 23.2006 — First of all thank you

Ray browser confusions is the action, the default, the thing that everybody at the end wants....everybody needs the action not the theory.

With my experience block elements like divs can be contained inside inline elements like anchors.

?
Copy linkTweet thisAlerts:
@ray326May 24.2006 — With my experience block elements like divs can be contained inside inline elements like anchors.[/QUOTE]
It's always possible to do things wrong.
Copy linkTweet thisAlerts:
@ithinkcssauthorMay 24.2006 — as it works... nothing's wrong comrade ray ?
Copy linkTweet thisAlerts:
@ray326May 24.2006 — All you can say is "it works [B]now[/B]". If you do it right you can say "it works." It wouldn't hurt you a lick to spend some time [url=http://www.w3.org/TR/html401/
]here[/url]
.
×

Success!

Help @ithinkcss spread the word by sharing this article on Twitter...

Tweet This
Sign in
Forgot password?
Sign in with TwitchSign in with GithubCreate Account
about: ({
version: 0.1.9 BETA 5.20,
whats_new: community page,
up_next: more Davinci•003 tasks,
coming_soon: events calendar,
social: @webDeveloperHQ
});

legal: ({
terms: of use,
privacy: policy
});
changelog: (
version: 0.1.9,
notes: added community page

version: 0.1.8,
notes: added Davinci•003

version: 0.1.7,
notes: upvote answers to bounties

version: 0.1.6,
notes: article editor refresh
)...
recent_tips: (
tipper: @AriseFacilitySolutions09,
tipped: article
amount: 1000 SATS,

tipper: @Yussuf4331,
tipped: article
amount: 1000 SATS,

tipper: @darkwebsites540,
tipped: article
amount: 10 SATS,
)...