Mozilla, Opera, and NS experts. Need help. Thnx

jag5311's picture

They have: 202 posts

Joined: Jan 2002

Well, i just downloaded my first copy of Mozilla and it is pretty nice. Fast as well.

First, I will start off with my link.

http://gamecubecheatsnet.powweb.com/ssgb/example.htm
If that link doesn't work, then try this one
http://homepages.evansville.edu/bk38/special/example.htm

As everyone knows, Mozilla, NS, and Opera are a little more strict on how they want to read HTML etc.. So when viewing a piece in IE, it looks great. This particular new design I am working on doesn't quite look how I want it to with those other browsers. How it looks in IE is how I want it. A few things the other browsers aren't catching are:

  • Where it says Monthly Specials, the background color and border is controlled through CSS, but other browsers ignore what I tell it to
  • The top menu (home, customer service, ...) should have the same bg color and border as Monthly Specials
  • The links on the left seem to have a break in the middle of them for some odd reason
  • I have a footer at the bottom controlled with CSS (bg color and border as well)

So I can't figure out what is wrong with my code for these features to not appear. Can anyone help.

Also, I would love to know how to make a cell color rollover to work in other browsers. I typically use projectsevens cell bg changer behavior, but with this current site, I set the link to have a 70% width, as well as the hover. But again, only works in IE. Go figure.

p.s. could you let me know if you feel the design I am working on is much more lively and "user-friendly" then the current design, somethingspecialgiftbaskets.com ?

Thanks
Jag5311

Renegade's picture

He has: 3,022 posts

Joined: Oct 2002

Well one thing that I think you would like to take note of is that, DIVs and TABLEs don't work well together (well never did for me anyway) use only tables or only DIVs or if your going to use tables keep divs down to a minimum, and vice versa.

jag5311's picture

They have: 202 posts

Joined: Jan 2002

I guess thats one drag of using Dreamweaver, it automatically throws DIV's in there. I just thought DIV's were a common tag in all browsers.
For example, in this code,

Home
F.A.Q.
Contact
Privacy
Policy

Customer
Service

Should I take out the DIV and just say

Home

????

Or did you have something else in mind.

Thanks
Bryan

jag5311's picture

They have: 202 posts

Joined: Jan 2002

You know what. Someone over at sitepoint forums just pointed out to me that in my 6th row of the side menu, in my code, i have a set of damn tags. Now, why IE, and Opera won't catch onto that is beyond me, but netscape sure did.

Suzanne's picture

She has: 5,507 posts

Joined: Feb 2000

For the future, keep the code as dead simple as possible.

<td class="nav"><a href="whatever.html">Home</a></td>

.nav {
    width: 46px;
    text-align: center;
    }
'

Or better yet...

<ul id="nav">
    <li><a href="index.html">Home</a></li>
    <li><a href="index.html">Home</a></li>
</ul>

#nav {
    text-align: center;
    margin-left: 0;
    padding-left: 0;
    width: 46px;
    }

#nav li {
    margin-left: 0;
    padding-left: 0;
    }
'

And you can throw the nested table away altogether.

jag5311's picture

They have: 202 posts

Joined: Jan 2002

Thanks. Quick question though. What is the difference between using

.nav

and

#nav ??????

I did notice that if it is .nav, then it would be class=nav
and if it is #nav, then it is id=nav

but why the difference.

Can you figure out why the other browsers aren't catching on to my bg color and border for MONTHLY SPECIALS and the footer.

Thanks
Bryan

p.s. If I want to show code in the form that you do, how do i do that?

Busy's picture

He has: 6,151 posts

Joined: May 2001

.nav can be used as often as you like,
#nav should be used once only

I didnt look at your code but am guessing the reason why it wont work in some browsers is either the way you have it set out or your using something that isn't supported by the browser, like dotted lines etc. some browsers have the default of margin:0 padding:2 while others have margin:2 padding:0

It's way easier to code properly for NS, Mozilla or opera first as most of the time you wont have to go back and adjust to suit another browser

Suzanne's picture

She has: 5,507 posts

Joined: Feb 2000

[ c o d e ] (without the spaces) [ / c o d e ]

A class is a general thing, like male, or female. Many different types of things can be male or female. An ID is a specific, unique thing, like jag5311, which is only jag5311. It can also be male or female (have a class), but only one jag5311 can exist (per page).

Using ID allows you to more specifically control the look and position of elements (like the list of navigation) in the CSS. If you read the rules for something like #nav li {} in real words (not CSS terms) it would say something like "For all list items in the container with the id of 'nav', do these things."

As for the rest, run it through the validators, and clean up any mistakes, typos and problems, and then look at it to see if the display issues remain. Also, check the archives at css-discuss.org for anyone else having the same problems.

Good luck!

jag5311's picture

They have: 202 posts

Joined: Jan 2002

I had some people point out a few things over at sitepoint.com, and it helped greatly. Now, the site resembles the version on IE Smiling

I guess i had a set of double closing brackets in my css at the top. That stopped my border and background from showing.

One thing that still baffles me. If I want my menu links to have a similar rollover effect that it does in IE (meaning not just changing the background that HUGS the link, but actually goes beyond that, like in IE), how can I go about doing that. I am getting that in IE because of the width attribute, but the other browsers i guess don't recognized that word.

Suzanne's picture

She has: 5,507 posts

Joined: Feb 2000

If you're using a list, and you use a width, it will work in every newer browser (the rollover effect you want). Also, you can use :hover on the li element.

Renegade's picture

He has: 3,022 posts

Joined: Oct 2002

I don't think it's the case of not recognising the word but it may be because it doesn't support that attribute for that element :S

jag5311's picture

They have: 202 posts

Joined: Jan 2002

what about instead of using a % element in my css for the pseudo classes, i use a px unit instead.

Suzanne's picture

She has: 5,507 posts

Joined: Feb 2000

what about it?

jag5311's picture

They have: 202 posts

Joined: Jan 2002

No, i was asking if I just changed all of my current %'s for width, to a pixel form if that would make it noticable in the other browsers?

Suzanne's picture

She has: 5,507 posts

Joined: Feb 2000

It's not the width that's the problem -- you really really really need to fix the code. But yes, using a px width for a something that isn't relatively sized would make the most sense, wouldn't it? And not if not.

I'm not sure what you're asking.

Suzanne's picture

She has: 5,507 posts

Joined: Feb 2000

&lt;script language=Javascript&gt;


<!C- // Array of day names
var dayNames = new Array("Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"
);
// Array of month Namesvar
monthNames = new
Array("January","February","March","April","May","June","July","August","September","October","November","December");
var now = new Date();
doc<FONT color=#006699 face=Arial size=1>Thursday, January 2, 2002</DIV>
                                 
'

See the problem?!

jag5311's picture

They have: 202 posts

Joined: Jan 2002

I think you answer my question. But I will clarify to make sure.

For my links, I currently have a width of 70%. This includes the a:hover. What I believe you have said is to make the 70% more like 70px or something along the lines of pixels. That is the width I am referring to. And I am choosing to do that to receive the rollover effect that expands past just the word, but to give the effect of a cell rollover(but not literally since I am not really doing a cell rollover)

Does that clear it up??

As for the javascript you just posted, are you referring to the tag at the end, which probably doesn't need to be there?

I believe its there because I have a before the javascript, I think.

They have: 447 posts

Joined: Oct 1999

theres alot of problems in that javascript.

im not even clear on what you want to do, but take the advice of running your page through a validator. http://www.w3.org . it's amazing how quickly problems disappear when you fix the errors in your page.

Also, don't develop for IE. Develop for a mozilla browser. IE throws in too much non-standard crap for eye candy and coddling, but supports enough standards that if you do it right the first time it should look fine in all browsers.

They have: 447 posts

Joined: Oct 1999

also, type javascript: in a mozilla browser to see your javascript errors.

jag5311's picture

They have: 202 posts

Joined: Jan 2002

If that javascript code to show the current date is poor, where can i go find myself a better one. Isn't there http://www.dynamicdrive.com/, is that javascript stuff?

Thanks
bryan

jag5311's picture

They have: 202 posts

Joined: Jan 2002

Rob, I went to that validator site but I can't seem to find where I would do a javascript check.

I did do a css check and Passed with flying colors
http://jigsaw.w3.org/css-validator/validator?uri=http%3A%2F%2Fhomepages.evansville.edu%2Fbk38%2Fspecial%2Fexample.htm&warning=1&profile=css2 but I don't quite understand some of the warnings they gave me near the middle. It actually tells me I don't have a background color set for my .footer , yet if you look at line 99, my .footer DOES have a background color. weird.

I will tell you all this, I have no clue as how to read javascript. I don't write the code, so I don't know how it works. For Susanne, I do not see the problem, since I am not sure what to look for. I understand that javascript should be tags as such

&lt;script language="javascript" type="text/javascript"&gt;
'

But when I did that, the date no longer would show up at all. So like you and Rob said, the code is poor.

Busy's picture

He has: 6,151 posts

Joined: May 2001

to do javascript on the page the basic tag is this:

<script language="javascript" type="text/javascript">

</script>

no html or css should be between the script tags (unless your using document.write or something)

the line 99 warning is:
Line : 99 Level : 1 You have no color with your background-color : .footer

css color and background-color is like a html body tag. if you use a background in the html body tag you should always use a bgcolor.

if you use color in your css you should use background-color:transparent at the least or a color (same as the background)

validation is good and you should always use it, but just because it does validate doesnt mean it will work the same in all browsers, things like: background-position : 0% 0%; is wrong according to the text book way, should just be 0 0;

jag5311's picture

They have: 202 posts

Joined: Jan 2002

So in the javascript example at the top of this page, because it includes that is why it won't work with the new code

<script language="javascript" type="text/javascript">

Suzanne's picture

She has: 5,507 posts

Joined: Feb 2000

well, yes, that and it's missing the closing script tag and is half cut off.

jag5311's picture

They have: 202 posts

Joined: Jan 2002

I don't understand. When I look at the source code this is what I see

&lt;script language=Javascript&gt;
<!-- // Array of day names
var dayNames = new Array("Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"
);
// Array of month Namesvar
monthNames = new
Array("January","February","March","April","May","June","July","August","September","October","November","December");
var now = new Date();
document.write("<font color=#006699 face=Arial size=1>" + dayNames[now.getDay()] + ", " + monthNames[now.getMonth()] + " "+ now.getDate() + ", 2003" );
// -->
&lt;/script&gt;</div>
'

Suzanne's picture

She has: 5,507 posts

Joined: Feb 2000

That isn't what I got (see quoted code above).

Source code that you're uploading, or what the browser source displays?

For what it's worth, I don't use double quotes for JavaScript unless quoting attribute values in document.write (which SHOULD BE DONE), keep single quotes for JavaScript.

Also, look at the first array -- the ); is on the wrong line (hard return) where it doesn't belong.

jag5311's picture

They have: 202 posts

Joined: Jan 2002

the source that I read came from

http://homepages.evansville.edu/bk38/special/example.htm

Then I choose VIEW and SOURCE CODE.

I am slowly starting to understand how javascript is being put together, but its very slow.

Where should that array be?

BTW, I appreciate everyones responses and patience. I know I ask alot of questions and I (probably am) annoying with them, but I just appreciate no one jumping my butt or ending their replies. I love this forum and I enjoy posting and reading here.

Thanks for everything,
Bryan

p.s. If that is a poor code, where can i get a good one to display the current date everyday on the website?

Suzanne's picture

She has: 5,507 posts

Joined: Feb 2000

It's coming through fine now? Did you reupload the page? There are no html errors (barring using marginheight, et cetera, and not using type="text/javascript" for the JavaScript) and the CSS checks out fine as well.

It's not that the code is bad, it's that it was getting cut off (which was causing other errors).

Now, those backgrounds that aren't showing up -- N4.x only?

jag5311's picture

They have: 202 posts

Joined: Jan 2002

Unfortuntely, I don't have NS4.0 to check my stuff, just Opera, Mozilla, NS 7.0, and IE. Well, I uploaded the page several times in the last few days, however, I never did anything different to that code, so I can't see why it would have ever cut off.

Thanks for the observations.

BTW, what percentage of surfers roughly use NS 4.0 compared to what is out now.

thanks
bryan

Busy's picture

He has: 6,151 posts

Joined: May 2001

the percentage is small but is still in use, from the people I know of that use it they try upgrading but what they upgraded to wasn't worth it (NS6, IE6, opera6) all having major flaws or problems somewhere along the way so resort back to trusty old NS4.*

I know I'll get my butt kicked for saying this Wink but NS4.* will be around for a while yet.

Instead of going for all browsers, go for accessibilty, try turn your graphics, css and even tables off, is it still workable? NS4.7 is great because it's a lot closer to what people with disabilitys can use. (no frills)

My logs last week even showed I had viewers using IE3 (would hate to see what they saw lol).

CSS backgrounds do work in NS4.*, so do HTML ones but you can't have empty cells, also NS doesnt like colour-background-color in tables it will display color-background-background

Want to join the discussion? Create an account or log in if you already have one. Joining is fast, free and painless! We’ll even whisk you back here when you’ve finished.