There's no such thing as a stupid question, but they're the easiest to answer.
JoinTour
Login
 
Tag Cloud
acer black screen blue screen blue screen of death boot bsod computer connection crash css dell display driver drivers email error explorer firefox firefox 3 hard drive internet internet explorer itunes laptop lcd malware monitor network networking outlook outlook 2003 outlook express printer problem problems ram router security slow software sound sprtcmd.exe trojan usb video virus vista windows windows xp wireless
Web Design & Development
Search
Search in:
 
Advanced Search
Tech Support Guy Forums > Internet & Networking > Web Design & Development >
using % instead of px


HELLO AND WELCOME! Before you can post your question, you'll have to register -- it's completely free! Click here to join today! We highly recommend that you print a copy of our Guide for New Members. Enjoy!

Closed Thread
 
Thread Tools
tex0gen's Avatar
Computer Specs
Member with 95 posts.
 
Join Date: Jun 2007
Experience: Advanced
15-May-2008, 06:58 AM #1
using % instead of px
Just wondering about this, by default the screen is 100% meaning it covers all sreens no matter what size right? so it i put something 20% of the way down the screen it would be 20% for all screens now matter what resolution? and how do i centre my whole page so most screens are supported for size.
DotHQ's Avatar
Senior Member with 327 posts.
 
Join Date: May 2008
Location: Ohio USA
Experience: Advanced
15-May-2008, 07:11 AM #2
I believe so. I use percentage for the width of my tables. If I want a five column layout I make each 20% or maybe 18% to leave room to show a border, and it works great for all resolutions.
Until I discovered percentages designing was a nightmare. Percentages make things so much easier. Hope they do for you too.
__________________
"May you buld a ladder to the stars and climb on every rung" - Bob Dylan
"In this age of Fiberglass I'm searching for a gem" - Bob Dylan
DotHQ.com
Off Topic Forum Fun
tex0gen's Avatar
Computer Specs
Member with 95 posts.
 
Join Date: Jun 2007
Experience: Advanced
15-May-2008, 07:13 AM #3
Okay but would you show me an example of this? and how to use the % instead of PX beacause i tried to change mine to % before and i lost all my tables despite puting them 10% on the screen? :S
DotHQ's Avatar
Senior Member with 327 posts.
 
Join Date: May 2008
Location: Ohio USA
Experience: Advanced
15-May-2008, 09:26 AM #4
Here is a code snipet of one of my tables using 20% for each td.
I use the percentage for width. I've used it for height but it's alway been 90%, so you'll need to experiment with that.

<table width="100%" height="28" border="0" cellpadding="0" cellspacing="0">

<tr valign="top">

<td width="20%" align="center">
<br>
<A HREF="index.html"><IMG SRC="images/home2.gif"></A>
</td>

<td width="20%" align="center">
<br>
<A HREF="inventory.html"><IMG SRC="images/Inventory2.gif"></A>
</td>

<td width="20%" align="center">
<br>
<A HREF="aboutus.html"><IMG SRC="images/AboutUs2.gif"></A>
</td>

<td width="20%" align="center">

<br>
<A HREF="contactus.html"><IMG SRC="images/ContactUs2.gif"></A>

</td>
<td width="20%" align="center">
<br>
<A HREF="directions.html"><IMG SRC="images/Directions2.gif"></A>
</td>
</tr>
</table>
__________________
"May you buld a ladder to the stars and climb on every rung" - Bob Dylan
"In this age of Fiberglass I'm searching for a gem" - Bob Dylan
DotHQ.com
Off Topic Forum Fun
matt-h's Avatar
Computer Specs
Senior Member with 315 posts.
 
Join Date: Apr 2006
Location: Warks, ENGLAND
16-May-2008, 07:14 AM #5
Note that you may also want to make use of min-width and max-width - say 600px and 1200px or else the pages could look ridiculous when squashed or stretched.
tomdkat's Avatar
Computer Specs
Distinguished Member with 3,716 posts.
 
Join Date: May 2006
Location: S.F. Bay Area, CA
Experience: Intermediate
16-May-2008, 04:28 PM #6
Quote:
Originally Posted by matt-h View Post
Note that you may also want to make use of min-width and max-width
Unfortunately, IE6 doesn't support min-width and max-width. I'm not sure if IE7 does or not.

Peace...
matt-h's Avatar
Computer Specs
Senior Member with 315 posts.
 
Join Date: Apr 2006
Location: Warks, ENGLAND
16-May-2008, 04:30 PM #7
Ah yes I've noticed that with my latest site. IE7 is fine, but IE6 not. What's the way around this?
tomdkat's Avatar
Computer Specs
Distinguished Member with 3,716 posts.
 
Join Date: May 2006
Location: S.F. Bay Area, CA
Experience: Intermediate
16-May-2008, 04:34 PM #8
Stop using IE?

EDIT: I don't know of any workarounds for IE6.

Peace...
matt-h's Avatar
Computer Specs
Senior Member with 315 posts.
 
Join Date: Apr 2006
Location: Warks, ENGLAND
16-May-2008, 04:52 PM #9
You're about 3 years to late :P been on Firefox for a few years now, but not everyone is as sensible, although my current site is for a uni sports club so I'm hoping they're all tech-savy enough to at least have IE7...

Btw, sorry for the thread hijack, it was partially relevant.
Big-K's Avatar
Distinguished Member with 6,883 posts.
 
Join Date: Nov 2003
Location: Kansas
Experience: Advanced
16-May-2008, 07:37 PM #10
just google something like 'IE6 min-width', theres dozens of blog entries out there detailing ways to get an equivalent to min-width. Max-width is the same as just using the width tag in IE. The most common way is to do something like this

HTML Code:
<div style="width:500px;"><!--max width container--> <div><!--content container-->
this is the content!
<div style="width:200px;"></div><!--box for the minimum width, because of this box the container will never go less than 200px--> </div><!--end of content--> </div><!--end of container-->
tomdkat's Avatar
Computer Specs
Distinguished Member with 3,716 posts.
 
Join Date: May 2006
Location: S.F. Bay Area, CA
Experience: Intermediate
16-May-2008, 08:01 PM #11
Well, there you have it.

Peace...
Closed Thread

THIS THREAD HAS EXPIRED.
Are you having the same problem? We have volunteers ready to answer your question, but first you'll have to join for free. Need help getting started? Check out our Welcome Guide.


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
WELCOME TO TECH SUPPORT GUY! Are you looking for the solution to your computer problem? Join our site today to ask your question -- for free! Our site is run completely by volunteers who help people like you solve computer problems. See our Welcome Guide to get started.



Thread Tools


You Are Using:
Server ID
Advertisements do not imply our endorsement of that product or service.
All times are GMT -4. The time now is 01:45 AM.
Copyright © 1996 - 2008 TechGuy, Inc. All rights reserved.
Powered by vBulletin, Copyright © 2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.1.0
Powered by Cermak Technologies, Inc.