PDA

View Full Version : unsure what forum to put this in, but info on Cascading Style Sheets


stacyinthecity
05-18-2001, 09:38 AM
Hello again!

I'm unsure where to put this, so I thought I'd ask here and I can always be directed to the right forum.

What do you think of Cascading Style Sheets? Useful, annoying, what? Personally, I really like the possibilities that they have, so I've been playing around with them lately.

Oh, and here is a question that is unrelated, though I guess not entirely. There is one font that I really want to be able to use, but its not a very common font. Is there anyway to make sure that everyone sees the font that I've chosen? Or have a list of alternative, more common fonts, that would appear in case they do not have the font on their computer?

Thanks for the help!
Stacy

Goldilocks
05-18-2001, 09:52 AM
I expect this should have been posted in one of the other forums but I guess it will get moved in good time! ;)

Yes you can use CSS to do this thing with the fonts. To assign a list of different fonts to the body tag you would do:

<STYLE type="text/css">

BODY {font-family: arial, helvetica, sans-serif}

</STYLE>

In this example, if the user didn't have arial on their computer (unlikely!) then instead it would display helvetica, and if they didn't have that it would display sans-serif, and if they didn't have that, only then would it switch to whatever their default font is.

It gives you some control over the appearnace of your page.

HTH! :)

Dr. Web
05-18-2001, 06:46 PM
Originally posted by stacyinthecity
What do you think of Cascading Style Sheets? Useful, annoying, what

CSS, the brave new future:

There are really three different styles... with three different outcomes.

linked.... your .css file which you link to, used to control the page layout in a general sense. Widely used to control large groups of pages, or whole sites.

embedded..... placed in the header, used to override/ compliment/ add to/ replace the linked (if any) style sheet. This may add any declarations not needed in the linked style sheet, or to specify changes needed on this page alone. This is useful if a certain page looks like the rest, with general differences.

inline..... placed in a specific line of code, will override both linked and embedded styles. Useful when a particular change is needed in one, or odd places in a page. For use when specific control over some element is desired.

Developers may use all three styles to control layout, while maintaining clean code.


Additionally there are more features to CSS, such as positioning. Unfortunately positioning with CSS is still not entirely cross browser friendly.

COBOLdinosaur
05-19-2001, 09:33 AM
There is a way to make non-standard fonts available to the browser, and that
is to use downloadable versions of the fonts. And then specify them using
a style sheet. Of course it will be up to the user whether they actually
want to download the font.

Like just about everytthing else Netscape and IE do it differently,

For IE
<style>
@font-face {
font-family: aname;
src: url(http://www.example.com/font.eot);
}
</style>

The Netscape syntax is:

<style>
@fontdef url("http://www.example.com/sample.pfr");
</style>

Note that there are NO quotes on the URL for the IE version


Coverting the fonts to downloadable format is not something I do so, you
will have dig around for that information.

As to the more general Question of Cascading Style sheets:

Anyone who is using depreciated HTML tags like font instead of styling
is an idiot. Anyone who is hardcoding background and border attributes
instead of using styles is also an idiot. Anyone who is not using the
power of styles for formatting, positioning, and dynamic effects is
an idiot. IMHO.

stacyinthecity
05-19-2001, 06:01 PM
Ok, the past couple of days, I've been working with a redesign of my website, but I've done it entirely with a style sheet. It looks pretty cool in explorer, but it looks like crap in netscape!

Anyway, I've tried all different things and I just can't get it to go right, which is a bummer because I would really like to use a CSS to link to for all my pages, that way I don't have to set page attributes a billion times. I also am a big fan of links changing colors when you put your mouse over them, and I'm not sure how to do that without a style sheet.

If anyone wants to take a look at the page that I've done, its here:
http://www.stacyinthecity.com/communicate/links.htm

Thanks again!
Stacy

_mrkite
05-19-2001, 07:12 PM
Here's something that might help:

http://www.richinstyle.com/masterclass/crossbrowser.html

[the entire site is brilliant]

COBOLdinosaur
05-20-2001, 09:59 AM
There are a number of cross-browser support issues for CSS. Netscrap supports less; has some different attributes, and uses some different values.

Best documentation of the differences is at:

http://www.blooberry.com/indexdot/css/index.html

BTW, Netscrap looks crappy with or without style sheets the technology of NS4 is 5 years out of date, and NS 6 has continued the tradition of making life miserable for any developer who has to support it.

stacyinthecity
05-20-2001, 12:24 PM
Thank you so much for those links.

I've finally got it worked out! http://www.stacyinthecity.com/communicate/links.htm

It still looks so much better in explorer, but at least it doesn't look like total crap in netscape anymore.

Everyone here has been so incredibly helpful to me, I wish I could help you all half as much as you've helped me!

Stacy