|
|||||||
| CSS Discussion and technical support relating to Cascading Style Sheets. |
![]() |
|
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
#1
|
||||
|
||||
|
Replacing an ul with inline images, but still using them for navigation?
Having been very much inspired by the CSS Zen Garden book and website, I've been spending the last few days trying to redevelop our old extremely table heavy website, into a bright new CSS based site.
I've really loved the 'getting back to basics' in designing for content first, layout second (I've knocked off about 75% memory, per page load, with a similar layout!). I've been trying to really stick to standards, and simple coding with as few hacks as possible, throughout the design process. Unfortunately trying to keep everything in lists first for navigation first, I used one of the Image replacement techniques to replace the tabbed navigation list, with background images in a horizontal line, as seen at the top of the following page: http://www.therapy-agency.com/corporate/index.html The relevant html : Quote:
Quote:
I hope it's something relatively simple.. so can anyone please help me to make these top tabs clickable for navigation? |
|
#2
|
||||
|
||||
|
Just noticed I missed a few bits of CSS (in case it makes a difference):
Quote:
|
|
#3
|
||||
|
||||
|
I would set up the tabs as an unordered list instead of all the divs, and apply all the sizing, background elements, and hovers to the <a> tags set as block display, then float the <li>s to sit them horizontally. Then move the spans so they only contain the link text, but are inside the <a> elements. At the moment you are hiding the whole <a> link - you just want to hide the text.
Bear in mind also, that many screen readers will not read the text when display is set to none - I prefer the "indent the text off the page" method of hiding the text (spans not needed then). Cheers Graeme |
|
#4
|
||||
|
||||
|
Cheers Graeme,
I'll give that a go. Thank you. |
|
#5
|
||||
|
||||
|
Cheers Graeme,
I've had a good go with the 'Rundle' method (as described in the CSS Zen Garden book, page 134) for the top sectional tabs as described above, to hide the text off the page, but still keep it accessible to screen readers, however, apparently using the method: Quote:
I can't seem to get the 'Levin' method with the various hacks for IE5/Mac, etc. to work with unordered lists and the image replacement. So can anyone give me a hack so the tabs/UL will still be navigatable for users of IE5? Or of course if you can suggest a better way, please do let me know. HTML Code:
<div id="title-tabs"> <ul> <li><a href="#" id="tab01">At Your Workplace</a></li> <li><a href="#" id="tab02">At Your Events</a></li> <li><a href="#" id="tab03">Gift Vouchers</a></li> <li><a href="#" id="tab04">Treatments For You</a></li> <li><a href="#" id="tab05">Healthy Living</a></li> <li><a href="#" id="tab06">About The Agency</a></li> <li><a href="#" id="tab09">Secure Login</a></li> </ul> </div> HTML Code:
/* ---------- Main Navigation Tabs ---------- */
#title-tabs {
font-family: Verdana, Arial, Helvetica, sans-serif;
font-size: 1em;
color: #000033;
text-align: center;
}
#title-tabs ul {
list-style-type: none;
text-align: center;
}
#title-tabs ul li {
display: inline;
}
#tab01, #tab02, #tab03, #tab04, #tab05, #tab06, #tab09 {
padding: 0;
margin: 0;
float: left;
height: 35px;
text-indent: -5000px;
}
#tab01, #tab02, #tab03, #tab04, #tab05, #tab06 {
width: 105px;
}
#tab09 {
width: 126px;
}
/* ---------- Main Navigation Tabs - Changeable ---------- */
#tab01 {
background: transparent url(navigation/tabs/tab-01.png) right top no-repeat;
}
#tab02 {
background: transparent url(navigation/tabs/tab-02-off.png) right top no-repeat;
}
#tab03 {
background: transparent url(navigation/tabs/tab-03-off.png) right top no-repeat;
}
#tab04 {
background: transparent url(navigation/tabs/tab-04-off.png) right top no-repeat;
}
#tab05 {
background: transparent url(navigation/tabs/tab-05-off.png) right top no-repeat;
}
#tab06 {
background: transparent url(navigation/tabs/tab-06-off.png) right top no-repeat;
}
#tab09 {
background: transparent url(navigation/tabs/tab-09-off.png) right top no-repeat;
}
|
![]() |
| Bookmarks |
| Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|