Forum Moderators: not2easy
<li><a href="#">Team</a>
<ul id="navteam">
<li><a href="#" class="name">Hannah</a> <a href="#" class="img"><img src="#" alt="Hannah" /></a></li>
<li><a href="#" class="name">Phil</a> <a href="#" class="img"><img src="#" alt="Phil" /></a></li>
<li><a href="#" class="name">Clare</a> <a href="#" class="img"><img src="#" alt="Clare" /></a></li>
<li><a href="#" class="name">Carly</a> <a href="#" class="img"><#" alt="Carly" /></a></li>
</ul>
<!--//navteam--></li> #sitenav ul#navteam {}
#sitenav #navteam img {display: block;}
#sitenav #navteam a.img {
visibility:hidden; /* hide the image until name is hovered on */
position: absolute;
left: 100%;
top: 0;
background: #eee;
width: 100px;
height: 100px;
}
#sitenav #navteam li:hover a.img {
visibility: visible; /* shows the hidden image link when name class is hovered on */
}
#sitenav ul li {}
#sitenav li a span {
visibility: hidden;
position: absolute;
left: 100%;
color:black;
width: 100px;
background:#FFF;
font-size: 10px;
}
#sitenav li a:hover span {
visibility:visible;
}
#sitenav #affiliates li a span {
left: -100px;
} [edited by: engine at 12:14 pm (utc) on Apr 21, 2011]
I understand how to make it appear etc but instead of it being a picture, I'm wondering if it can be done using pure css (with only a link to a headshot for img) rather than creating the whole thing as an img and then linking it in the css/htmlI'm certain that explained what you want .. but I'm not sure what you mean by "it" ! ;)
but with the lines being different colours, and part of it being different positions that's the part I'm not sure how to do.Again, should be possible ... if you can just help me understand what the "it" is. :)
[edited by: engine at 12:14 pm (utc) on Apr 21, 2011]
css
div {
font: 13px/14px verdana, sans-serif;
color:#000;
width: 250px;
height:150px;
padding:10px;
border: 2px solid red;
}
img {
float:left;
margin:0 10px 15px 0;
}
strong, i, b, a, small {
display:block;
}
strong {
font-size:14px;
color:red;
margin-top:10px;
font-weight:normal;
}
i {
font-style:normal;
color: grey;
}
a, small {
font-size:12px;
text-align:center;
}
/*This allows the email to be a usable email link. I would consider styling it so users realise it is a link */
a {
clear:both;
text-decoration:none;
color:black;
}
/*Provide some feedback to the user */
a:hover {
text-decoration:underline;
color:red;
}
HTML (strict)
<div>
<img src="myimage.jpg" width="75" height="75" alt="Name" >
<strong>My Name</strong>
<i>Business Position</i>
<b>Phone: 1234 123 1234</b>
<b>Mobile: 12345 123 123</b>
<a href="mailto:myemail@exanple.com?subject=New Contact" title="Email Name">myemail@example.com</a>
<small>Business Physical Street Address </small>
<small>City, Town, Country</small>
</div>
HTML
<div id="sitenav">
<ul>
<li><a href="home.html">Home</a></li>
<li><a href="#">Team</a>
<ul id="navteam">
<!-- delete each of the "team" list items
<li><a href="#" class="name">Hannah</a> <a href="#" class="img"><img src="#" alt="Hannah"></a></li>-->
<!-- replace with this html, modified to suit for each of Hannah, Phil, etc. Note the a has a new id -->
<li><a href="#" class="name">The Name</a>
<a href="#"id="card">
<img src="myimage.jpg" width="75" height="75" alt="Name" >
<strong>My Name</strong>
<i>Business Position</i>
<b>Phone: 1234 123 1234</b>
<b>Mobile: 12345 123 123</b>
<small>myemail@example.com</small>
<small>Business Physical Street Address </small>
<small>City, Town, Country</small>
</a><!--end card-->
</li><!-- end Hannah -->
<!-- replace this adjusted for Phil, as above-->
<li><a href="#" class="name">Phil</a> <a href="#" class="img"><img src="#" alt="Phil"></a></li>
</ul><!--end navteam -->
</li><!-- end team-->
<li><a href="#">Other menu items</a></li>
<li><a href="#">Other menu items</a></li>
</ul> <!--end menu -->
CSS
Use this css instead of the example above
#navteam a#card {
font: 13px/14px verdana, sans-serif;
color:#000;
width: 250px;
height:150px;
padding:10px;
border: 2px solid red;
text-align:left;
background-color:#fff;
/*positioning the fkuout-adjust left/top to suit */
position:absolute;
left:85px;
top:0;
visibility:hidden;
}
#sitenav #navteam li:hover a#card {
visibility:visible;
}
#navteam #card img {
float:left;
margin:0 10px 15px 0;
}
strong, i, b, a, small {
display:block;
}
strong {
margin-top:10px;
font-size:14px;
font-weight:normal;
color:red;
}
i {
font-style:normal;
color: grey;
}
#card small {
font-size:12px;
text-align:center;
clear:left;
}
... but can you create your own <"own"> and then list it in the css as own { style how you want it}You can in xml, but not in HTML ... and unless you really need xml, I wouldn't bother.