Hi everyone,
I hope you can give me some tips how I can solve the last problem, which delays me finishing my website. I've created a simple version of my current div menu for this forum. I want to get this W3C conform/valid html.
index.html
style.css
I try to explain my requirements:
As you can see I have two divs side by side. Every div has a menu text at its bottom. Both, the div and the menu text are together a hyperlink. If you go mouseover the first div, it expands to the size of the second div and shows a background-picture. You can still mouseover the second div, even when the first div is expanded.
I know, <a href=" is not allowed arround a div. My current attempt to realize the upper menu with list styles:
index2.html
style2.css
I hope you can give me some tips how I can solve the last problem, which delays me finishing my website. I've created a simple version of my current div menu for this forum. I want to get this W3C conform/valid html.
index.html
Code:
<div id="menuArea"> <div id="bg1"> <a href="#"><div class="text1">Menu 1</div></a> </div> <div id="bg2"> <a href="#"><div class="text2">Menu 2</div></a> </div> </div>
Code:
body{ font: 12px tahoma, sans-serif; } img{ border: 0px; } a:link, a:visited{ color: #fff; text-decoration: none; } a:hover, a:active{ font-weight: bold; } .text1, .text2{ margin-top: 454px; padding: 8px; } .text1{ background: #000; } .text2{ background: #444; } #menuArea{ background: #8facdf; height: 490px; margin: 40px auto 20px auto; width: 490px; } #bg1 a, #bg2 a{ height: 490px; position: absolute; width: 245px; } #bg2 a{ margin-left: 245px; } #bg1 a:hover{ background: url(bg1.jpg); width: 490px; } #bg2 a:hover{ background: url(bg2.jpg); }
As you can see I have two divs side by side. Every div has a menu text at its bottom. Both, the div and the menu text are together a hyperlink. If you go mouseover the first div, it expands to the size of the second div and shows a background-picture. You can still mouseover the second div, even when the first div is expanded.
I know, <a href=" is not allowed arround a div. My current attempt to realize the upper menu with list styles:
index2.html
Code:
<div id="menuArea"> <ul id="menuList"> <li><a href="#">Menu 1</a></li> <li><a href="#">Menu 2</a></li> </ul> </div>
Code:
body{ font: 12px tahoma, sans-serif; } img{ border: 0px; } #menuArea{ background: #8facdf; height: 528px; margin: 40px auto 20px auto; width: 490px; } ul#menuList{ margin: 0px; padding: 0px; } #menuList li{ list-style-type: none; } #menuList a{ display: block; float: left; height: 24px; padding-left: 20px; padding-top: 498px; width: 225px; } #menuList a:link, #menuList a:visited{ color: #fff; text-decoration: none; } #menuList a:hover { background: #000 url(bg1.jpg) no-repeat; color: #fff; font-weight: bold; }
Comment