Last updated 2004-06-28 by Roedy
Green ©1996-2004 Canadian Mind Products
Java definitions: 0-9 A B C D E F G H I J K L M N O P Q R S T U V W X Y Z
You are here : home : Java Glossary : C words : css.
<link href="mindprod.css" type="text/css" rel="stylesheet">
<span class="frog">... </span>
Note the there is no dot before frog when you used the tag, just when you define it.
table.gridmenu td /* cells used for creating menus of clickable buttons */
{
background : #fbf4d8;
border-color : #808080;
border-style : outset;
border-width : 2px;
padding : 5px;
}
<table class="gridmenu">
and all the text in the table will use those defaults. You no longer use any of the traditional HTMLtags in your <table commands such border="0" cellpadding="4" cellspacing="4".
Click any ball to view the corresponding colour palette.
Look for websites that display this logo
,
and study their html and their style sheets to learn how these tools are used in
practiced. I switched over the mindprod.com site over to use them. You can
specify styles that only take effect under special nested conditions. You can
override styles with more styles or with ordinary HTML tags. There are currently
two CSS standards, CSS1 and CSS2. CSS2 has many more features, including the
ability to specify different styles for display on screen and for printing. It
also allows you to include fonts with your document.
CSS is actually much easier to learn and much less work to apply than the old system. The philosophy is different. You don't mix your style and text information. You put all your style thoughts in one place to be globally applied. You mark up your text with what flavour of thing each chunk of text is, not how it is to be painted. The biggest problem is you can make syntax errors, and nothing complains and nothing happens. E.g. it is color not foreground-colour. It is margin-left: 100px not left-margin: 100 px, font-size: 125% not size: +25 %, padding-top: 6pt not top-padding: 6 pt.
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-3">
Opera is relatively bug free in css, and is faster that Netscape and IE, but not all plug-ins work with it, and it has bugs in FORMs and JavaScript. You might consider using Opera to get your css working, then switch over to dodge the bugs in the other two browsers.
<head> <title>...</title> <link rel="stylesheet" media="screen" title="Default Style" href="..." type="text/css"> <link rel="stylesheet alternate" media="screen" title="Alt-Style 1" href="..." type="text/css"> <link rel="stylesheet alternate" media="screen" title="Alt-Style 2" href="..." type="text/css"> </head>
When I refer to an image in a style sheet e.g.
TopStyle is a program that lets you edit style sheets. It mainly just lists all the possible attributes and lets you fill in the ones you want for each style. You soon discover there are hundreds of possible attributes you can apply to a style. Further, you discover, that unlike HTML, you can apply any attribute to any style. This makes CSS much more flexible than HTML.
You can, for example, fudge the way text and images align vertically together with the vertical-align attribute. You can add that to any style.
Don't worry too much about understanding what all the style attributes mean. If you see something promising, try setting the attribute to all of its allowed values and look at the results. You will figure it out much faster than if you try to make sense of the lawyerly W3C specification prose. The trick is finding likely candidates in the overwhelming sea of possibilities, and remembering to try them at the table, row and cell level to see the varying effects.
The other thing to keep in mind is you must be brave and try out unlikely combinations. Coming from a standard HTML background, you may be too timid to try attributes you have traditionally associated with only one tag on another.
The documentation I use most frequently myself is the Web Design Group CSS reference manual, particularly the CSS Properties section. The best tutorial I found is the W3Schools. W3C is the master site. It has links to hundreds of resources. It also has the official spec.
To learn more about CSS, ask questions in the newsgroup: comp.infosystems.www.authoring.stylesheets. Read the FAQ for it before posting. There is a wealth of information there if you follow the links.
home |
Canadian Mind Products | |||
| mindprod.com IP:[24.87.56.253] | ||||
| Your IP:[80.134.30.163] | ||||
| You are visitor number 5933. | ||||
| Please send errors, omissions and suggestions | ||||
| to improve this page to Roedy Green. | ||||
| You can get a fresh copy of this page from: | or possibly from your local J: drive mirror: | |||
| http://mindprod.com/jgloss/css.html | J:\mindprod\jgloss\css.html | |||