473,407 Members | 2,598 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,407 software developers and data experts.

Navigation buttons on my site

tharden3
916 512MB
I have a question for you guys, I'm designing a website. Before I go any further, I'd like to get my navigation bars on the left side up and running. The site is themed to a bumblebee 'black and yellow' color scheme with nectar and honey and all that jazz. It should actually look pretty sweet when it's all done, no pun intended ;)
What I was trying to do was have the colors on the nav bars invert when you hover over them. I tried achieving this without PHP and came very close. I guess I could set them as images, but that just wastes load time and space. I was able to achieve the invert effect just fine, but could not get the boxes of yellow and black around the text to be the same length and size. I want the boxes holding the text to be the same length so everything is nice and neat. At first, I made the table holding the bars have a background and the invert worked fine, but boxes weren't the same size. So instead of affecting the table data, i tried to make the links directly absolute. this messed up the table background and squeezed it on the side of my screen. So I made the background seperate and now I got the bars the same size, and color inverting, but the bars layer on top of one another. You will understand what I'm talking about when you put the code in a browser. I will post the CSS and the HTML that I used the first effort, then the CSS and HTML I used the second effort. Look at both, and you will understand what I am trying to do. Any tips? Advice?

1st attempt:

[HTML]
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<link rel="stylesheet" type="text/css" href="PN.css" />
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8; image/jpeg" />
<title></title>
</head>
<body>
<div class="all">

<p id="titleleft"></p>
<div id="navback">
<p></p>
</div>
<div class="navigation">
<table>
<tr>
<td id="r1" class="menu"><a href="http://www.htmldog.com" class="links1">Home</a></td>
</tr>
<tr>
<td id="r2" class="menu"><a href="http://www.htmldog.com" class="links1">Reviews</a></td>
</tr>
<tr>
<td id="r3" class="menu"><a href="http://www.htmldog.com" class="links1">Events</a></td>
</tr>
<tr>
<td id="r4" class="menu"><a href="http://www.htmldog.com" class="links1">Movies</a></td>
</tr>
<tr>
<td id="r5" class="menu"><a href="http://www.htmldog.com" class="links1">Games</a></td>
</tr>
<tr>
<td id="r6" class="menu"><a href="http://www.htmldog.com" class="links1">Music</a></td>
</tr>
<tr>
<td id="r7" class="menu"><a href="http://www.htmldog.com" class="links1">Contact Us</a></td>
</tr>
<tr>
<td id="r8" class="menu"><a href="http://www.htmldog.com" class="links1">About O.R.</a></td>
</tr>
</table>



</div>
</body>
</html>
[/HTML]
[HTML]
body{background-color: black;}
.all{width: 800px; height: 800px;}
#titleleft{z-index: -1; background-image: url(honeycomb.png); position: absolute; top: -8%; left: -8%; height: 400px; width: 500px;}
#navback{ position: absolute; top: 240px; width: 120px; height: 350px;background-color: #8b8b8b; padding: 2px; border: 1px white solid; z-index: -1;}
.navigation{position: absolute; top: 240px;}
.menu{}
.links1{ position: absolute; width: 100px; height: 20px;text-decoration: none; color: black; background-color: #eed821; text-decoration: none; font: bold .8em/1.1 arial; padding: 2px; margin-top: 50px;}
.links1:hover{color: #eed821; background-color: black;}
[/HTML]

2nd attempt:

[HTML]
<link rel="stylesheet" type="text/css" href="PN.css" />
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8; image/jpeg" />
<title></title>
</head>
<body>
<div class="all">

<p id="titleleft"></p>
<div class="navigation">
<table>
<tr>
<td id="r1" class="menu"><a href="http://www.htmldog.com" class="links1">Home</a></td>
</tr>
<tr>
<td id="r2" class="menu"><a href="http://www.htmldog.com" class="links1">Reviews</a></td>
</tr>
<tr>
<td id="r3" class="menu"><a href="http://www.htmldog.com" class="links1">Events</a></td>
</tr>
<tr>
<td id="r4" class="menu"><a href="http://www.htmldog.com" class="links1">Movies</a></td>
</tr>
<tr>
<td id="r5" class="menu"><a href="http://www.htmldog.com" class="links1">Games</a></td>
</tr>
<tr>
<td id="r6" class="menu"><a href="http://www.htmldog.com" class="links1">Music</a></td>
</tr>
<tr>
<td id="r7" class="menu"><a href="http://www.htmldog.com" class="links1">Contact Us</a></td>
</tr>
<tr>
<td id="r8" class="menu"><a href="http://www.htmldog.com" class="links1">About O.R.</a></td>
</tr>
</table>



</div>
</body>
</html>
[/HTML]

[HTML]
body{background-color: black;}
.all{width: 800px; height: 800px;}
#titleleft{z-index: -1; background-image: url(honeycomb.png); position: absolute; top: -8%; left: -8%; height: 400px; width: 500px;}
.navigation{position: absolute; top: 240px; width: 120px; height: 350px;background-color: #8b8b8b; padding: 2px; border: 1px white solid;}
.menu{}
.links1{ width: 100px; height: 20px;text-decoration: none; color: black; background-color: #eed821; text-decoration: none; font: bold .8em/1.1 arial; padding: 2px; margin-top: 50px;}
.links1:hover{color: #eed821; background-color: black;}
[/HTML]

If you run this code and see the differences it might be easier to understand what I am trying to achieve. If I was not clear enough, let me know and I will rewrite thing in english ;)
Aug 13 '08 #1
2 1756
Dormilich
8,658 Expert Mod 8TB
solution: use display: block on the links (then you don't even need the table) otherwise you can't assign width, height, padding and margin (those work only for block level elements (like td, div, p))
Aug 24 '08 #2
tharden3
916 512MB
solution: use display: block on the links (then you don't even need the table) otherwise you can't assign width, height, padding and margin (those work only for block level elements (like td, div, p))
ok, thanks. I'll try that out.
Aug 24 '08 #3

Sign in to post your reply or Sign up for a free account.

Similar topics

0
by: Mike | last post by:
Sites using thumbnail preview for world wide web file navigation and searching. Below are list of sites that are either researching or providing thumbnail preview images for online web...
4
by: Dan V. | last post by:
I am looking for a great css button navigation tool that can allow me to: - Ideally use Macromedia DreamWeaver 2004 mx. - Use CSS buttons that allows the button to stay depressed when I am on a...
2
by: Dan V. | last post by:
What do you recommend to use for saving time and get great results for making image and css buttons on a site? Also top tabs like for navigation. Separate question maybe is what is the best tool...
2
by: PC Datasheet | last post by:
I have an AccessXP(A2000 mode) customer who says on one form the navigation buttons do nothing when he clicks on any of the 5 but the navigation buttons work on other forms. In my copy of the...
1
by: Robert Neville | last post by:
I am having some trouble with some old code revolving around custom form navigation buttons. My main form has a sub-form with these custom navigation buttons. In other words, the code should be...
3
by: Jack Russell | last post by:
I want to add navigation buttons to a tabcontrol (somewhat like excel) How do I get the "tabs" to offset to the right so that I can draw the buttons on the left? TIA -- Remove norubbish to...
10
by: EA | last post by:
I am sure I must be missing something about building navigation bars with CSS. Yes it is a very clever and efficient way to format navigation structures on simple one navigation level webs, i.e....
4
by: Jamey Shuemaker | last post by:
Howdy, Saw a couple threads from the past few years on this topic, but didn't really find any solutions. Here's one I found:...
3
by: Gary | last post by:
Afternoon Is it possible to display test alongside the Navigation Buttons in an MS Access form? I have a complex form containing a number of subforms where the Navigation Buttons are...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.