/    Sign up×
Community /Pin to ProfileBookmark

Handling Font Browser Font Adjustment…

Okay,
now in IE, Mozilla, Opera, EVERY browser there is (usually in the view menu) a command to increase or decrease the overall FONT or TEXT SIZE. This operates globally to the entire page and generally increments all sizes by a similar factor, so small/medium/large fonts remain relative to each other but are globally increased or decreased in size.

Now for the problem:
Given this set of images:
Vertical Line (l_c_line.gif)
Middle Node Line (l_c_mid.gif)
End Node Line (l_c_end.gif)
(these are attached for better comprehension)
And the following html:

[code]
<table border=1 cellpadding=0 cellspacing=0 width=100%><tr>
<td valign=middle background=”icons/l_c_line.gif” ><img src=”icons/l_c_line.gif” width=20 height=20 border=0></td>
<td valign=top ><img name=”Icon.3_0″ id=”Icon.3_0″ src=”icons/node_open.gif” width=20 height=20 border=0></a></td>
<td valign=middle width=100% ><a name=”Link.3_0″ id=”Link.3_0″ href=”javascript:void(0)” target=_top>Folder 1</a></td>
</tr></table>
<table border=1 cellpadding=0 cellspacing=0 width=100%><tr>
<td valign=top ><img src=”icons/l_c_end.gif” width=20 height=20 border=0></td>
<td valign=top ><img name=”Icon.3_2″ id=”Icon.3_2″ src=”icons/node_open.gif” width=20 height=20 border=0></a></td>
<td valign=middle width=100% ><a name=”Link.3_2″ id=”Link.3_2″ href=”javascript:void(0)” target=_top>Folder 3</a></td>
</tr></table>
[/code]

I am getting a very obvious problem. (And before anyone comments, I KNOW that border has been set to “1”, this is on purpose. The final product doesn’t have any borders, but they help for visual referencing in the development phase.)
As you increase the TEXT SIZE, via the browser, the “END NODE” image becomes further disconnected from the preceding row. Nowhere in any Javascript tutorial or reference is there an indication that one can “Stretch” an image. Supposedly, having the <td> “valign=top” should keep that image at the REAL TOP of the td element, but it doesn’t.

I’ve seen other code that is similar, especially in the HTML final product, and their end product doesn’t behave like this.
Why?
How can i fix it so that when I put “VALIGN=TOP” it ACTUALLY stays at the top and does not move downward no matter how much the text font size increases or decreases.

Thanks
Jaeden “Sifo Dyas” al’Raec Ruiner

[upl-file uuid=e8ffb378-98b3-4014-8e97-76ea285ce48b size=125B]l_c_line.gif[/upl-file]

[upl-file uuid=1a1af3bb-9811-462d-832b-8358d24f3ae8 size=128B]l_c_mid.gif[/upl-file]

[upl-file uuid=2ec34213-b322-4088-9ff3-0c1b65e94735 size=121B]l_c_end.gif[/upl-file]

to post a comment
JavaScript

1 Comments(s)

Copy linkTweet thisAlerts:
@CrazyMerlinMay 22.2007 — if you want to perfectly control background elements, you need to be sure you have a DOCTYPE above your header and then use CSS

instead of having images, if you control the borders of the cells of the table, you can create dynamically stretching tree lines.

if you need a line to run to the horizontal middle of a cell, simply split the cell and set the border-bottom of the upper of the split cells.

using images is very restrictive.

it takes a little fiddling, but this took me about 10 minutes. Once you get the hang of it and have your styles defined you will be fine.

<i>
</i>&lt;!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"&gt;
&lt;html&gt;
&lt;head&gt;
&lt;title&gt;Tree Sizer&lt;/title&gt;
&lt;style type="text/css"&gt;
.standard_branch
{
border-left: 1px solid #000000;
border-bottom: 1px solid #000000;
}

<i> </i> .left_trail
<i> </i> {
<i> </i> border-left: 1px solid #000000;
<i> </i> }

<i> </i> .middle_connector
<i> </i> {
<i> </i> border-bottom: 1px solid #000000;
<i> </i> }
<i> </i>&lt;/style&gt;
&lt;/head&gt;

&lt;body&gt;

<i> </i>&lt;table border="0" cellspacing="0" cellpadding="0"&gt;
<i> </i> &lt;tr&gt;
<i> </i> &lt;td class="standard_branch" width="32"&gt;&amp;nbsp;&lt;/td&gt;
<i> </i> &lt;td rowspan="2" align="left"&gt;&amp;nbsp;Item A&lt;/td&gt;
<i> </i> &lt;td rowspan="2" width="31"&gt;&amp;nbsp;&lt;/td&gt;
<i> </i> &lt;td rowspan="2"&gt;&amp;nbsp;&lt;/td&gt;
<i> </i> &lt;td rowspan="2" width="63"&gt;&amp;nbsp;&lt;/td&gt;
<i> </i> &lt;/tr&gt;
<i> </i> &lt;tr&gt;
<i> </i> &lt;td class="left_trail" width="32"&gt;&amp;nbsp;&lt;/td&gt;
<i> </i> &lt;/tr&gt;
<i> </i> &lt;tr&gt;
<i> </i> &lt;td class="standard_branch" width="32"&gt;&amp;nbsp;&lt;/td&gt;
<i> </i> &lt;td rowspan="2" align="left"&gt;&amp;nbsp;Item B&lt;/td&gt;
<i> </i> &lt;td rowspan="2" width="31"&gt;&amp;nbsp;&lt;/td&gt;
<i> </i> &lt;td rowspan="2"&gt;&amp;nbsp;&lt;/td&gt;
<i> </i> &lt;td rowspan="2" width="63"&gt;&amp;nbsp;&lt;/td&gt;
<i> </i> &lt;/tr&gt;
<i> </i> &lt;tr&gt;
<i> </i> &lt;td class="left_trail" width="32"&gt;&amp;nbsp;&lt;/td&gt;
<i> </i> &lt;/tr&gt;
<i> </i> &lt;tr&gt;
<i> </i> &lt;td class="standard_branch" width="32"&gt;&amp;nbsp;&lt;/td&gt;
<i> </i> &lt;td rowspan="2" align="left"&gt;&amp;nbsp;Item C&lt;/td&gt;
<i> </i> &lt;td class="middle_connector" width="31"&gt;&amp;nbsp;&lt;/td&gt;
<i> </i> &lt;td&gt;&amp;nbsp;&lt;/td&gt;
<i> </i> &lt;td&gt;&amp;nbsp;&lt;/td&gt;
<i> </i> &lt;/tr&gt;
<i> </i> &lt;tr&gt;
<i> </i> &lt;td width="33"&gt;&amp;nbsp;&lt;/td&gt;
<i> </i> &lt;td width="31" align="left" valign="top"&gt;&amp;nbsp;&lt;/td&gt;
<i> </i> &lt;td class="standard_branch" width="32"&gt;&amp;nbsp;&lt;/td&gt;
<i> </i> &lt;td rowspan="2"&gt;Item CA&lt;/td&gt;
<i> </i> &lt;/tr&gt;
<i> </i> &lt;tr&gt;
<i> </i> &lt;td width="33"&gt;&amp;nbsp;&lt;/td&gt;
<i> </i> &lt;td align="left"&gt;&amp;nbsp;&lt;/td&gt;
<i> </i> &lt;td width="31"&gt;&amp;nbsp;&lt;/td&gt;
<i> </i> &lt;td&gt;&amp;nbsp;&lt;/td&gt;
<i> </i> &lt;/tr&gt;
<i> </i> &lt;/table&gt;

&lt;/body&gt;

&lt;/html&gt;


Hope that helps you out.

Design! Design! Design!
×

Success!

Help @JaedenRuiner spread the word by sharing this article on Twitter...

Tweet This
Sign in
Forgot password?
Sign in with TwitchSign in with GithubCreate Account
about: ({
version: 0.1.9 BETA 5.26,
whats_new: community page,
up_next: more Davinci•003 tasks,
coming_soon: events calendar,
social: @webDeveloperHQ
});

legal: ({
terms: of use,
privacy: policy
});
changelog: (
version: 0.1.9,
notes: added community page

version: 0.1.8,
notes: added Davinci•003

version: 0.1.7,
notes: upvote answers to bounties

version: 0.1.6,
notes: article editor refresh
)...
recent_tips: (
tipper: @AriseFacilitySolutions09,
tipped: article
amount: 1000 SATS,

tipper: @Yussuf4331,
tipped: article
amount: 1000 SATS,

tipper: @darkwebsites540,
tipped: article
amount: 10 SATS,
)...