Solved

no net percent

Posted on 2002-04-07
7
177 Views
Last Modified: 2010-04-09
why dont my percentages work in netscape 6.0? i have posted the code:-. when i changed the percentages to actual width and height it worked perfectly. but i need to use percentages because i am tagetting different screen resolutions

<td><img src=images/login.jpg width=100% height=100%></td>
0
Comment
Question by:champs
7 Comments
 
LVL 14

Expert Comment

by:avner
Comment Utility
try this :

<td><img src=images/login.jpg style="width:100%;height:100%"></td>

0
 

Author Comment

by:champs
Comment Utility
no luck with that either, actually i had already tried that before. i have the same problem with certain other elements like <select> and <textarea>. it only works when i actually specify the height and width but not in percentage.
0
 
LVL 12

Expert Comment

by:lexxwern
Comment Utility
works okay in netscape 6.2;

lexxwern
0
What Security Threats Are You Missing?

Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

 

Author Comment

by:champs
Comment Utility
but please help for netscape 6 !!
0
 

Author Comment

by:champs
Comment Utility
the code:

<table border="0" cellpadding="0" cellspacing="0" height="17.5%" width="100%">
     <tr>
          <td style="width:100%;height:100%;"><img src="images/general/header_login.jpg" style="width:100%;height:100%;" border=0></td>
     </tr>
</table>
0
 
LVL 19

Accepted Solution

by:
webwoman earned 50 total points
Comment Utility
You can't use percentages on images, I doubt fractional percentages will work, and your syntax is wrong.

Don't blame the browser if you write bad code. ;-) You don't need height on the table tag, you've got it on the cells.

<table border="0" cellpadding="0" cellspacing="0" width="100%">
    <tr>
         <td width="100%" height="100%"><img src="images/general/header_login.jpg" border=0></td>
    </tr>
</table>
0
 
LVL 18

Expert Comment

by:bruno
Comment Utility
there is a difference in how browser interpret % on images.


some browsers take it to mean that it should be a percentage of the browser window.  100% would be as wide as the whole browser.  

some browsers take it to mean a percentage of the full image width.  100% would be normal size, 50% would be half the size of the original image width.

i'm assuming by your problem NS6 is probably one of the latter, not the former, in which case, you will have to use some javascript to dynamically check the window.availWidth and then dynamically write out the code for the image size.



BRUNO
0

Featured Post

How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

Join & Write a Comment

Suggested Solutions

SASS allows you to treat your CSS code in a more OOP way. Let's have a look on how you can structure your code in order for it to be easily maintained and reused.
This article explains how to prepare an HTML email signature template file containing dynamic placeholders for users' Azure AD data. Furthermore, it explains how to use this file to remotely set up a department-wide email signature policy in Office …
In this Micro Tutorial viewers will learn how to create navigation buttons that change on rollover, using CSS (Continuation of the CSS Image Sprite tutorial) Create a parent ID for all the list items       - Specify position: absolute and display: block…
The viewer will receive an overview of the basics of CSS showing inline styles. In the head tags set up your style tags: (CODE) Reference the nav tag and set your properties.: (CODE) Set the reference for the UL element and styles for it to ensu…

771 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

10 Experts available now in Live!

Get 1:1 Help Now