PDA

View Full Version : Who's REALLY good with HTML?


Bubble #5
10-30-2005, 10:46 PM
We're trying to make a table for our first 3.5.0 skin. When we view it in IE and firefox it looks OK (see screenshots below) but when we view it in Safari it's not tiling correctly :( The only thing that we can figure is that there must be something wrong with the HTML, or that something is affecting the HTML, but it's a default vB forum with no hacks installed so I don't see how anything could be affecting the HTML (even though that's how it's acting when you view it). Below is the HTML for the table. The table is broken into 3 sections, top, middle and bottom.


<!-- top section -->
<table cellpadding="0" cellspacing="0" border="0" width="100%" align="center">
<tr>
<td width="10" height="32"><img src="$stylevar[imgdir_misc]/pic1.png" /></td>
<td width="10" height="32"><img src="$stylevar[imgdir_misc]/pic2.png" /></td>


<td width="100%" height="32" background="$stylevar[imgdir_misc]/pic3.gif" valign="middle" class="pic2"><center>vbphrase</center></td>


<td width="10" height="32" align="right"><img src="$stylevar[imgdir_misc]/pic4.png" /></td>
<td width="10" height="32" align="right"><img src="$stylevar[imgdir_misc]/pic5.png" /></td>
</tr>
<!-- / End top section -->



<!-- mid section -->
<tr>
<td background="$stylevar[imgdir_misc]/pic7.gif" valign="top"><img src="$stylevar[imgdir_misc]/pic7.gif" /></td>
<td colspan="3">
<table class="tborder" cellpadding="$stylevar[cellpadding]" cellspacing="$stylevar[cellspacing]" border="0" width="100%" align="center">
</table>
</td>
<td background="$stylevar[imgdir_misc]/pic9.gif" valign="top"><img src="$stylevar[imgdir_misc]/pic9.gif" /></td>
</tr>
</table>
<!-- / End mid section -->

<!-- bottom section -->
<table cellpadding="0" cellspacing="0" border="0" width="100%" align="center">
<tr>
<td width="10" align="left" valign="top"><img src="$stylevar[imgdir_misc]/pic10.png" width="10" height="32" /></td>
<td width="10" align="left" valign="top"><img src="$stylevar[imgdir_misc]/pic11.png" height="32" /></td>
<td width="100%" style="background-image:url($stylevar[imgdir_misc]/pic12.png)"><img src="$stylevar[imgdir_misc]/pic12.png" width="1" height="32" alt=" " border="0" /></td>
<td width="10" align="right" valign="top"><img src="$stylevar[imgdir_misc]/pic13.png" height="32" /></td>
<td width="10" align="right" valign="top"><img src="$stylevar[imgdir_misc]/pic14.png" height="32" /></td>
</tr>
</table>
<!-- End bottom section -->

The only part that is looking wrong on Safari is the middle of the top portion of the table. The rest of the table looks good in all browsers, even Safari. Here is the HTML for the section which looks bad:

<td width="100%" height="32" background="$stylevar[imgdir_misc]/pic3.gif" valign="middle" class="pic2"><center>vbphrase</center></td>

Are there any really good HTML'ers that can look at the HTML above and see if anything is wrong with the way it's written? I know the table itself works because it works in another part of the forum (even with Safari). I looked at templates until 5:00 in the morning last night :ermm: and I'm pulling my hair out :( Hopefully a fresh set of eyes from someone really good with HTML can pick out what's wrong. I'd appreciate it. Thank you.

pyro.699
10-30-2005, 11:12 PM
I know lots about HTML, but, i know nothing about your browser :S

Could it be in the settings?

akanevsky
10-30-2005, 11:49 PM
Sorry, I don't have safari, so even though I know a lot about HTML/CSS, I cannot say anything about that browser.. :(

Bubble #5
10-31-2005, 12:02 AM
Could it be in the settings?
Do you mean the settings in the browser configuration? I don't think it would be those simply because every other skin looks good when viewed with that browser. If it was the way Safari was configured then all skins would show the same error, right?

I know a lot about HTML/CSS, I cannot say anything about that browser
Did everything in the HTML posted above look good to you?

Princeton
10-31-2005, 12:49 AM
You should upgrade your code to compliant XHTML.

akanevsky
10-31-2005, 12:53 AM
No... If one cell is 100% width, then how the hell are other cells 10px in width? o.O

Other than that, your code is structured too poorly to be readable. Sorry.

Protoman
10-31-2005, 01:06 AM
use http://validator.w3.org to check your code. As long as it passes the xhtml test, it's safari's fault, and not your code.

Brad
10-31-2005, 01:38 AM
Can you show us the CSS code for the class pic2?

Bubble #5
10-31-2005, 02:33 AM
Can you show us the CSS code for the class pic2?
Here you go. I didn't write the CSS for this so I could have easily missed something :ermm: Thanks for looking at it :)

.pic2
{
color: #222222;
font: bold 10px verdana, geneva, lucida, 'lucida grande', arial, helvetica, sans-serif;
}
.pic2 a:link
{
color: #222222;
text-decoration: none;
}
.pic2 a:visited
{
color: #222222;
text-decoration: none;
}
.pic2 a:hover, .tcat a:active
{
color: #222222;
text-decoration: underline;
}

Guest190829
10-31-2005, 02:56 AM
Could it be the valign="middle" ?

* Guest190829 shrugs shoulders.

Zachery
10-31-2005, 03:15 AM
background is not a valid xhtml tag, assuming you are working inside of vBulletin, it tells the browser its xhtml code.

use
style="background-image:$stylevar[imgdir_misc]/pic3.gif"
Instead of
background="$stylevar[imgdir_misc]/pic3.gif"

Bubble #5
10-31-2005, 03:00 PM
assuming you are working inside of vBulletin
Thank you for helping out Zachery :) Yes we are working from within the templates (forumhome, forum display, navbar, etc.).

use
style="background-image:$stylevar[imgdir_misc]/pic3.gif"
Instead of
background="$stylevar[imgdir_misc]/pic3.gif"
When we switched it as shown above the image disappeared causing the entire center section to now be missing :( I've included our new code for the top section so you could see exactly what we changed. Image (pic3.gif) is in the correct folder and was appearing just before the change. Any idea on what would cause the image to disappear like that when the code is correct?


<!-- top section -->
<table cellpadding="0" cellspacing="0" border="0" width="100%" align="center">
<tr>
<td width="10" height="32"><img src="$stylevar[imgdir_misc]/pic1.png" /></td>
<td width="10" height="32"><img src="$stylevar[imgdir_misc]/pic2.png" /></td>


<td width="100%" height="32" style="background-image:$stylevar[imgdir_misc]/pic3.gif" class="pic2"><center>vbphrase</center></td>


<td width="10" height="32" align="right"><img src="$stylevar[imgdir_misc]/pic4.png" /></td>
<td width="10" height="32" align="right"><img src="$stylevar[imgdir_misc]/pic5.png" /></td>
</tr>
<!-- / End top section -->

Zachery
10-31-2005, 03:09 PM
Thank you for helping out Zachery :) Yes we are working from within the templates (forumhome, forum display, navbar, etc.).


When we switched it as shown above the image disappeared causing the entire center section to now be missing :( I've included our new code for the top section so you could see exactly what we changed. Image (pic3.gif) is in the correct folder and was appearing just before the change. Any idea on what would cause the image to disappear like that when the code is correct?


<!-- top section -->
<table cellpadding="0" cellspacing="0" border="0" width="100%" align="center">
<tr>
<td width="10" height="32"><img src="$stylevar[imgdir_misc]/pic1.png" /></td>
<td width="10" height="32"><img src="$stylevar[imgdir_misc]/pic2.png" /></td>


<td width="100%" height="32" style="background-image:$stylevar[imgdir_misc]/pic3.gif" class="pic2"><center>vbphrase</center></td>


<td width="10" height="32" align="right"><img src="$stylevar[imgdir_misc]/pic4.png" /></td>
<td width="10" height="32" align="right"><img src="$stylevar[imgdir_misc]/pic5.png" /></td>
</tr>
<!-- / End top section -->

oh silly me, thats what I get for not having my caffiene in me.

should be

background-image: url($stylevar[imgdir_misc]/pic3.gif);

Bubble #5
10-31-2005, 03:42 PM
oh silly me, thats what I get for not having my caffiene in me.

LOL :)


should be
background-image: url($stylevar[imgdir_misc]/pic3.gif);
I'm hoping you don't mean it should look like this:

<td width="100%" height="32" background-image: url($stylevar[imgdir_misc]/pic3.gif); class="pic2"><div align="center">$vbphrase[whats_going_on]</div></td>

...because that's still not working :ermm: :)

Zachery
10-31-2005, 04:19 PM
LOL :)


I'm hoping you don't mean it should look like this:

<td width="100%" height="32" background-image: url($stylevar[imgdir_misc]/pic3.gif); class="pic2"><div align="center">$vbphrase[whats_going_on]</div></td>

...because that's still not working :ermm: :)

No

<td width="100%" height="32" style="background-image: url($stylevar[imgdir_misc]/pic3.gif);" class="pic2"><div align="center">$vbphrase[whats_going_on]</div></td>

Bubble #5
10-31-2005, 06:11 PM
OK thanks Zachery :) I put the new code in and now the image is appearing correctly, BUT the center section of the top still has gaps on each side of it like in the first post :( I also used the new code that you provided for the guest table and it is now working correctly in all browsers, but the 'What's going on' table and the navbar table (where you enter in username/password) still has those gaps. I'm just thinking out loud here but is it possible that something else could be effecting those two tables to act that way? If so then what should I be looking for? (if you need me to post anything from the templates just let me know) :)

akanevsky
10-31-2005, 07:48 PM
use http://validator.w3.org to check your code. As long as it passes the xhtml test, it's safari's fault, and not your code.

That's not entirely true. Different browsers have slightly different box models, which could be causing the problem - even when the code is valid according to the validator. In which case, the problem could be eliminated by adding some CSS hacks...

Bubble #5
10-31-2005, 08:04 PM
the problem could be eliminated by adding some CSS hacks...
Anthony do you have any examples that I could look at, or possibly point me in the right direction? I'm really pulling my hair out trying to fix this problem :(

calorie
10-31-2005, 08:33 PM
Try posting a screenie after you replace your top section with the following:

<!-- top section -->
<table cellpadding="0" cellspacing="0" border="0" width="100%" align="center">
<tr>
<td width="10" height="32">A <img src="$stylevar[imgdir_misc]/pic1.png" /></td>
<td width="10" height="32">B <img src="$stylevar[imgdir_misc]/pic2.png" /></td>

<td width="100%" height="32" style="background-image: url($stylevar[imgdir_misc]/pic3.gif);" class="pic2"><div align="center">C $vbphrase[whats_going_on]</div></td>

<td width="10" height="32" align="right">D <img src="$stylevar[imgdir_misc]/pic4.png" /></td>
<td width="10" height="32" align="right">E <img src="$stylevar[imgdir_misc]/pic5.png" /></td>
</tr>
<!-- / End top section -->

Bubble #5
10-31-2005, 09:54 PM
Try posting a screenie after you replace your top section with the following
It's almost an exact opposite of the way it was before. Now the center is the correct size but the ends don't appear.

akanevsky
10-31-2005, 11:30 PM
Anthony do you have any examples that I could look at, or possibly point me in the right direction? I'm really pulling my hair out trying to fix this problem

Hmm... I had an e-book about CSS Hacks lying around somewhere... If i can find it, I'll send it to you :)

EDIT: See PM.