It always makes me wonder why some approach a
content-separate-from-style type of site as if they
were trying to re-create a tabular layout...not saying
that's what you're doing but many are.
Anyway, get to know block-level vs. inline tag behaviors
and specifically how to alter them with CSS. It seems
you're just starting out, since as mdoigny pointed out,
using top:value; left:value; etc. is of no use without a
position:relative; [or absolute or fixed, etc.] property.
Remember with positioning, it's easiest to use the 'natural'
flow as much as you possibly can. Floats / clearing is usually
pretty good - ditto for using % instead of px on certain major
elements for a more fluid layout. Relative posit. means rel. to
where it'd *normally* be. Absolute removes it altogether from
the flow and sets it according to browser window - not always
a great trait.
Using inline styles: <tag style="allroperty; valueairs;">
is okay when you want something to be unique from those
styles you've set elsewhere - in an internal or external style
[Again, class="" is for many that will share the same styles,
id="" is for one unique instance of them.]
Okay, sorry about that...
Guess 'content sep. from style' means coding the html content as is - without inline styles or deprecated tags/attributes. Selecting tags that will best fit their contents and keeping all appearance-related coding in a separate .css file [external] that is linked to the .html page in the head section.
Ok. Then here is a question that contains even more stupidity than the first one.
How do I make an external CSS sheet and how do I apply it.
So far what I have been doing is making my index page then using it as a template for the rest of the pages..merely switching text and images as needed...which..come to think of it, of it may not be too helpful for what I plan to do.
Oh..please forgive my rudeness..thank you to all who have responded.
External CSS files are plain text, just like HTML, except the file names end in .css. CSS files ONLY contain CSS rules. No HTML. Linking to CSS files is easy too. Its done using two methods, both of which get placed in the HEAD of your HTML document.
The above method allows a style sheet to be downloaded by 4.0 and newer browsers. Netscape 4.x has a quirk where it ignores the above tag completely because of the media attribute. If you want a style sheet to be read by ALL 4.0 and newer browsers, use the above HTML tag and omit the media attribute and value.
Browsers 5.0 and newer will download the style sheet using the @import method. Using a combination of LINK and @import style sheets, you can feed simple style sheets to 4.x browsers and more complex style sheets to 5+ browsers. Browsers 5.0 and newer will read the LINK style sheet and the @import style sheet. Advanced CSS 1.0 and 2.0 styles can be put in the @import style sheet, while commonly supported CSS 1.0 styles can be placed in the LINK stylesheet.
Last edited by toicontien; 04-04-2006 at 12:02 AM.
Hi Robert Wellock! I know its a v late reaction but i m a new joiny to this forum nad I must say i hv solved many of my problems by just goin to the replies of the queries posted here. My question goes directly to u. Hw is ID more powerful than Class as u hv stated in yr reply? I hv wondered many times but hv found no reply till now. I would be highly delighted if I get a reply!!!