473,503 Members | 5,284 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Relative width in CSS

Hi,

In Yahoo YUI Grid CSS,

It specified the relative width of a container (e.g. 750px) by, e.g.

width : 57.6293em; /* 750 div 13 */
*width : 56.25em; /* 750 div 13.3333 for IE */

1. Is this the standard way to define the width if we are using
relative width?
2. Should we also define the relative padding, margin using the above
formula?

Thanks.

Jun 27 '08 #1
6 4879
howa wrote:
>
In Yahoo YUI Grid CSS,

It specified the relative width of a container (e.g. 750px) by, e.g.

width : 57.6293em; /* 750 div 13 */
Huh? There is *no* such correlation between screen pixels and ems. Em is
a measure of font size, which could be any value. I don't know where the
13 comes from, but it is an arbitrary number at best.
1. Is this the standard way to define the width if we are using
relative width?
Relative to what? If it's relative to window size, use %.

I strongly advise against setting anything to 60em, unless it's
max-width. If you used a large default type size like I do, you'd
understand why.

--
Berg
Jun 27 '08 #2
On 4$B7n(B10$BF|(B, $B2<8a(B12$B;~(B30$BJ,(B, Bergamot <berga...@visi.comwrote:
howa wrote:
Huh? There is *no* such correlation between screen pixels and ems. Em is
a measure of font size, which could be any value. I don't know where the
13 comes from, but it is an arbitrary number at best.
13 mean the default font-size being used by YUI CSS, so the width is
relative to the current font size, this is how YAHOO/YUI currently
work. The advantage is when you zoom in using a larger font, the width
of your container also increase.

I found the above formula really work (hence..IE suck)

I just wonder if any other has used this method if not.
Howard
Jun 27 '08 #3
howa wrote:
On 4月10日, 下午12時30分, Bergamot <berga...@visi.comwrote:
>>
There is *no* such correlation between screen pixels and ems. Em is
a measure of font size, which could be any value. I don't know where the
13 comes from, but it is an arbitrary number at best.

13 mean the default font-size being used by YUI CSS,
So they are setting a fixed font-size, which is a bad beginning. I
assume that is 13px. BTW, my default text size is 20px, with a 17px
minimum. 13px is intolerably small to me.
so the width is
relative to the current font size, this is how YAHOO/YUI currently
work. The advantage is when you zoom in using a larger font, the width
of your container also increase.
I'm sorry, but that isn't necessarily an advantage when you set a fixed
width at near 60ems. That just creates a huge amount of horizontal
scrolling for those of us using a larger than average default text size
and/or smaller window sizes. A fixed width in ems can be tolerable for
things like a column down one side of the page as long as it isn't
excessive.

60em may be good for a max-width setting, but never for a fixed width.
I found the above formula really work
I found the formula really sucks. It's not so noticeable when you use a
small default font size, or very large window sizes.

--
Berg
Jun 27 '08 #4
On 4$B7n(B10$BF|(B, $B2<8a(B9$B;~(B45$BJ,(B, Bergamot <berga...@visi.comwrote:
howa wrote:
On 4$B7n(B10$BF|(B, $B2<8a(B12$B;~(B30$BJ,(B, Bergamot <berga...@visi.comwrote:
There is *no* such correlation between screen pixels and ems. Em is
a measure of font size, which could be any value. I don't know where the
13 comes from, but it is an arbitrary number at best.
13 mean the default font-size being used by YUI CSS,

So they are setting a fixed font-size, which is a bad beginning. I
assume that is 13px. BTW, my default text size is 20px, with a 17px
minimum. 13px is intolerably small to me.
Nope, default font-size is 13px, but they will use relative font size
relative to this default, e.g. write 12px as 93%.

Their way to use CSS is very flexible and nice with different zoom
level, e.g. you can zoom in or zoom out in Yahoo.com and see.

Jun 27 '08 #5
howa wrote:
On 4$B7n(B10$BF|(B, $B2<8a(B9$B;~(B45$BJ,(B, Bergamot <berga...@visi.comwrote:
>howa wrote:
>>On 4$B7n(B10$BF|(B, $B2<8a(B12$B;~(B30$BJ,(B, Bergamot <berga...@visi.comwrote:
There is *no* such correlation between screen pixels and ems. Em is
a measure of font size, which could be any value. I don't know where the
13 comes from, but it is an arbitrary number at best.
13 mean the default font-size being used by YUI CSS,
So they are setting a fixed font-size, which is a bad beginning. I
assume that is 13px. BTW, my default text size is 20px, with a 17px
minimum. 13px is intolerably small to me.

Nope, default font-size is 13px, but they will use relative font size
relative to this default, e.g. write 12px as 93%.
What do you mean "nope"? Setting the base font in pixels and then
defining other rules in "%" from that absolute value is *not* relative
font sizes! Relative font sizes are using %, em, ex, from the user's
default! I.e., default "body { font-size: 100%; }"

He just wrote 13px is too small for him to read so why would 93% of 13px
be any more legible? Especially if he is stuck using IE6.
>
Their way to use CSS is very flexible and nice with different zoom
level, e.g. you can zoom in or zoom out in Yahoo.com and see.
Which browser here? IE7? If they have IE6 your 13px will be 13px...no
zoom. I guess he could change his monitor resolution for your page, now
that would be "flexible"

--
Take care,

Jonathan
-------------------
LITTLE WORKS STUDIO
http://www.LittleWorksStudio.com
Jun 27 '08 #6
howa wrote:
On 4月10日, 下午9時45分, Bergamot <berga...@visi.comwrote:
>>
So they are setting a fixed font-size, which is a bad beginning. I
assume that is 13px. BTW, my default text size is 20px, with a 17px
minimum. 13px is intolerably small to me.

Nope, default font-size is 13px
Excuse me? *My* default font size in *my* browser is 20px. What they set
in their stylesheet as a default is irrelevant.
>, but they will use relative font size
relative to this default, e.g. write 12px as 93%.
Um, if I have trouble reading 13px, how do you expect me to read 12px?
Their way to use CSS is very flexible and nice with different zoom
level, e.g. you can zoom in or zoom out in Yahoo.com and see.
All I see when I go to yahoo.com is a whole bunch of horizontal
scrolling. How is that "very flexible and nice"? Must be like beauty -
in the eye of the beholder. :-\

BTW, the whole thing would be quite unreadable if I didn't enforce that
17px minimum font size. The only good thing I can say about it is that
there don't seem to be a bunch of overlapping elements like I find at
many other sites.

--
Berg
Jun 27 '08 #7

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
7740
by: Stephen Weatherly | last post by:
Could anyone please help me with a problem I am having with my table widths??? If I have 2 images within a td tag, but using CSS relative positioning I position one over the top of the second (I...
8
42507
by: Asad | last post by:
Hi, I am basically trying to accomplish drop down menus for navigation on a site. And I'm pretty much done except I am having one problem. The z-index is not working with relative positioning! ...
1
5349
by: Wilhelm Kutting | last post by:
Hi i like to make a complex layout with css. All the content is inside a container div. I like to get the following sequence without the css-layout: logo title mainnav content i can only...
3
19748
by: Markus Ernst | last post by:
Hello Reading the follwing document: http://www.w3.org/TR/WD-positioning-970131#In-flow it seems very clear that position:relative should be relative to the parent element. So in the following...
9
1737
by: Garann Means | last post by:
I have a subfolder under wwwroot set up as a virtual directory with its own application name in IIS. I pulled it down from Visual Source Safe and, on the machine where it's normally hosted, it...
19
60310
by: derelicten | last post by:
hello , I have an issue positionating some pics I want to anchor to an existing table cell but I cant just place regular position on the cell because the background is fixed height and the set of...
1
3157
by: GGG | last post by:
Neither go the way I want them to... Absolute doesn't get it right over multiple browsers. Relative puts it in the right place, but only the portion that it is "relative" the style, #wleMenu, is...
4
9673
by: Alex | last post by:
Hello, I'm rewriting our corporate website, and to make editing the format later I want to rewrite it completely using CSS with no table tags. I've used CSS for years, but never exclusively, so...
1
1208
by: empiresolutions | last post by:
In the following code i need *Signup* to align just to the right of *Login*. Due to *SearchContainer* location, it must be absolute positioned. Thanks for the help. <!DOCTYPE HTML PUBLIC...
2
709
by: howa | last post by:
Hi, In Yahoo YUI Grid CSS, It specified the relative width of a container (e.g. 750px) by, e.g. width : 57.6293em; /* 750 div 13 */ *width : 56.25em; /* 750 div 13.3333 for IE */ 1. Is...
0
7194
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
7316
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
7449
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
5566
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development projectplanning, coding, testing,...
1
4993
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
4666
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
3160
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
3148
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
729
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.