CSS vs. Frames

B

bejewell

What exactly, do you think you get from frames that you cannot get
otherwise?

Consistency!! I have tried just creating a table-based layout and using
that layout from page to page, but when I try to add sub-menus, etc., I run
into all kinds of problems - especially problems with my columns resizing,
etc. Frames seem like the easiest way to keep each page looking the same,
with the only thing changing from page to page being the content in the main
frame.

I know I will probably get jumped on again for saying that frames seem like
the easiest option to me - all I mean is that I know I won't run into the
same formatting problems with frames that I have with a simple table-based
layout, and I can create a frames site without having to learn everything
from scratch, as I would with CSS.

But, if frames are goind to create a maintenance nightmare, I would rather
start training myself on CSS or some other option - but I need to know where
I can go to get the training I need, preferably by using free online
tutorials, etc.
 
V

Viken Karaguesian

I know I will probably get jumped on again for saying that frames seem like
the easiest option to me - all I mean is that I know I won't run into the
same formatting problems with frames that I have with a simple table-based
layout, and I can create a frames site without having to learn everything
from scratch, as I would with CSS.

Well...I, for one, won't jump on you :>) The truth is, frames *are*
the easiest option, but not the best option. Learning CSS is not all
that hard. Basic to intermediate css is somewhat easy to learn. Go to
http://www.w3schools.com/css/default.asp. That's where I learned all
my basic css. Then, once you get more comfortable with it you can start
reading the W3C specs, etc and getting more familiar.

Say, for instance, you want to have a company logo at the top of every
page. The logo is 300px wide and it must be centered. Putting it in a
frame seems like the best way to go, right? But look at how easy the
css would be. This is what that portion of the stylesheet would look
like:

div.logo {
width: 300px;
margin-right: auto; /* auto margins ensure page centering */
margin-left: auto; /* auto margins ensure page centering */
border: solid black 1px;
}

Then, every page would have this HTML at the top (we'll start at the
body):

<body>
<div class="logo"><img src="company_logo.jpg"></div>
....rest of content...
</body>

That's it! In my example, I've chosen a <div> (or Layer, in FrontPage
speak), but you can choose a table instead if you'd like.

I'm not going to slam you for wanting to use a frame. I, myself, am a
recent convert, so I still remember how easy and tempting it was. In
the long run, though, frames will not be optimal.

Viken K.
http://home.comcast.net/~vikenk
www.sayatnova.com
 
W

Windsun

That IS a compelling argument for beginners - I fell into the same trap a
few years ago. But then I had to do a makeover of the site, and ended up
finding out it was easier to start from scratch. So I was actually kind of
forced into learning CSS, although I did not get into it very deep for quite
some time.

CSS has a steep learning curve, especially when you are trying to accomodate
different browsers, but you don't need to go that deep for basic pages - you
can use a combination of tables and CSS if you don't have time to get deep
into it.
 
C

Clark

Look, you dont have to learn CSS. And you dont have to use frames to
have the same navigation menu at the top of each page.

Just make your navigation menu its own page like menu.htm and the on
every page of your site, insert it as an Include page right at the
top.

Yes, if your page has a lot of stuff on it so that people can scroll
down the page, the menu will go out of site on the top, but site
visitors understand they can scroll back "up" and get the menu.

If you want your pages all to have a similar look and feel, save a
copy of the first page you make and call it something like
template.htm

Then whenever you need a new page. open template.htm, save it with a
new name like newpage.htm, and then modify the contents to suit the
new page.

Your menu is always at the top. You dont need frames or CSS
 
J

Jim Carlock

Windsun said:
CSS has a steep learning curve, especially when you are trying
to accomodate different browsers,

CSS needs an easy-to-understand definition.

HTML provides the content of a page.
CSS provides a way to layout each element of the content.

The HTML "elements" (commonly called "tags") get subgrouped
into two different styles, "inline" and "block". <div> represents the
block style, <span> represents the "inline" style. The difference
between the two, involves the fact that block elements all employ
two dimensions, height and width, and represent a retangular area
to hold content. On the other hand, "inline" styles represents flows
of text that fall inline with the surrounding text, and some examples
include the <a> tags which wrap a link up, the <span> tag which
you utilize to format the text contained, the <b>, <i> and <u> tags,
all of which format the style of text presented.

Where CSS comes in handy, it provides a way to reformat the
way the HTML tags display things.

To add some padding to the top of all <p> elements, you employ
a style to reformat it.

<style type="text/css">
/* apply the padding to all <p> tags */
p {padding-top: 20px;}
</style>
</head>
<body>
<h1>Simple Cascading Style Sheets</h1>
<p>Hello world!</p>
<p>I'm a new paragraph.</p>
<p>Change the padding-top quantity and refresh the browser.</p>
</body></html>

And one of the most important things to remember involves the
fact that all elements get classified as inline or block, and line-height
is not the same as height. line-height applies to the spacing between
lines of text for "inline" elements. height applies to height of an object.

All elements (HTML tags) also provide margin and padding to space
the element in relation to surrounding elements.

Get to know "block" and "inline". Then get to know "padding" and
"margin". You're 80% complete in knowing CSS at that point. The
rest involves layering, centering, and floating elements. I liked the
margin-left: auto; and margin-right: auto; examples. Thanks for
providing those.

Hope this helps.

Jim Carlock
Post replies to the newsgroup.
 
M

Murray

The problem is that you wouldn't need to know a trice of CSS to do this page
without frames....
 
M

Murray

The OP's question was based on a lack of understanding of the real options.
There's no need to accept it as the real alternative decisions.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top