Harris Kosmidhs wrote:
OK I have read some docs about fluid layout. The point is to use %
instead of fixed-size staff with px, right?
As a gross simplification.
But what happens if I have an image on .left for example which let's say
is 250px width.
Then a _totally_ fluid layout is inappropriate for you in this case
(this isn't unusual).
min-width is a useful property here to give a robust layout that's
still highly fluid. Of course, guess which browser doesn't support
it....
Other techniques are to start nesting <div>s and fix the widths of the
inners, letting the outers follow percentage sizes, and letting the
browsers fight it out. Generally the results are acceptably good, but
no-one claims they're perfect.
This stuff is hard to do well. I suggest reading the source of some of
the better tutorials out there (try glish.com or bluerobot) and seeing
the issues they've had to deal with.
PS = "left" is fine as a class name, so long as you understand what
you're doing. If you really mean "Get the damned thing onto the left if
at all possible" then it's reasonable. If you can re-state it more
generally as "where the major nav menu lives" then it might be better
to give it a class name like that. Remember that sometimes your "left"
is going to find itself rendered at the top of the page anyway (on my
skinny-screened phone, for instance) -- can you live with this?
Conversely, it's better to have a class called "left" if you're really
using this as a "presentational bucket" <divin the HTML where you
collect all those things you want to force in that direction, whether
they're menus or stock tickers (you might have a further element inside
there that is called "nav-menu"). It's better than having a bucket,
calling it something like <div class="nav-menu">, using the CSS to
float it leftwards, and still having all sorts of baggage in there
that's anything but a nav-menu.
Base your class names on what you're doing with the HTML and what the
_essence_ of how you're using the HTML is. Think about the results of
applying your CSS to them as very much secondary to this. But if the
function of the HTML element is still purely presentational (and
sometimes it just is), then don't be afraid of putting anodyne
presentational names on it.