Tom's Guide | Tom's Hardware | Tom's Games
![]() |
![]() |
![]() |
hey hey...I just recently learned how to use css. I love it. :)
however...i'm having some problems with positioning and sizing of elements. What is the best way to position elements in a css document?
My biggest question though:
When you resize the text using the built in option on ie6 ('view' 'text size' 'larger'), the text size will change, but my elements will not expand to fit the new sizes. How can I make it so that they DO resize? Almost all of my elements are positioned absolutely and I have sized text using ems.HELP! :)
Leadership is the art of influencing and directing others in a way that will gain their respect, confidence, and loyal cooperation in achieving a common goal or objective

"What is the best way to position elements in a css document?"
Need more specifics. Whattype of elements? What are you trying to accomplish? The "best" method can change depending upon the desired outcome.
"...my elements will not expand to fit the new sizes."
What do you mean by elements? Are you refering to your text elements? If so, then when you explicitly define a font size for a text element, then the browser will not resize the text using the method you described. This, I believe, is by design. Allowing the browser to resize text would break sites that were designed around the text being a specific size.
Michael J

when I say element I mean anything refered to in my css document. for example:
#header {
}#content {
}I do not mean things like:
p {}
or
h1 {}as for resizing...I went to msn.com's website. I like the way that is set up...when you resize the text with the browser there you can see what I'm talking about.
Leadership is the art of influencing and directing others in a way that will gain their respect, confidence, and loyal cooperation in achieving a common goal or objective

Well, I'm not going to go through their code line by line, but I can think of at least one way, off the top of my head, to accomplish what I see on their page.
The trick is to first carefully plan out your site, otherwise this will become very difficult. For a simple example, assuming you have one "block": First create a master DIV. Then create the content DIV within that. Now create a "sizing" DIV (above or below the content DIV, but within the master DIV) which consists of a series of non-breaking spaces. You will need to adjust the number and size of the spaces to get the desired results. But, now when the user changes font size, the sieries of non-breaking spaces will expand and contract the size of the blocks.
The above example may not quite work as explained, but you should get the reasoning - you might have to tweak it a little.
There are probably other, and better, methods, but that is just the first one that comes to mind.

hmm....sounds like that might work. Thanks!
I think I may just give in and just define how large my text should be. :)
Leadership is the art of influencing and directing others in a way that will gain their respect, confidence, and loyal cooperation in achieving a common goal or objective

That's what I do, but...
It has been my experience that text will appear much smaller on IE on the MAC. I used to have two differnt style sheets that were determined by the platform/browser. I haven't done any sites for a coulpe years that would have heavy MAC traffic, so I haven't tested this in quite some time.
Michael J

![]() |
![]() |
![]() |

This post is quite old and has been locked from receiving new replies. Please create a new posting instead.
| Ads by Google |