Specify the background-repeat property as no-repeat. You can also use the background property as a shortcut for specifying multiple background-* properties at once. Here's an example:
BODY {background: #FFF url(watermark.jpg) no-repeat;}
a:link, a:visited {text-decoration: none}
or
<a style="text-decoration: none" HREF="...">
...will show the links without underlining. However, suppressing the underlining of links isn't a very smart idea as most people are used to having them underlined. Also, such links are not spotted unless someone coincidentally runs a mouse over them. If, for whatever reason, links without underline are required background and foreground colors can be instead declared to them so that they can be distinguished from other text, e.g.;
a:link, a:visited {text-decoration: none; background: red; color: blue}
<a style="text-decoration: none; background: red; color: blue" HREF="...">
Both background and foreground colors should be specified as the property that is not specified can be overridden by user's own settings.
Layout and style should be tackled by the same language and the two are intertwined. Trying to split the two is like splitting the HTML specification in two, one specification describing inline elements and the other describing block elements. It's not worth the effort. CSS is capable of describing beautiful and scalable layouts. The CSS Zen Garden has been a eye-opening showcase of what is possible today. If MS IE had supported CSS tables, another set of layouts would have been possible. So, there is still lots of potential in the existing CSS specifications which should be the next milestone.
I always wanted to have "included" substyles or "aliases" in my CSS definition, to save redundancy. (For includes)
.class1 { color:#ff0000; } .class2 { background-color:#ffffff; } .class3 { include:class1,class2;font-weight:bold; }
(For aliases)
@alias color1 #ff0000; @alias color2 #ffffff; @alias default_image url('/img/image1.jpg');
.class1 { color:color1; } .class2 { background-image:default_image;background-color:co lor2; }
This way we could change colors or images for a whole webpage by editing a reduced number of lines.
The attribute values can contain both single quotes and double quotes as long as they come in matching pairs. If two pair of quotes are required include single quotes in double ones or vice versa:
<P STYLE="font-family: 'New Times Roman'; font-size: 90%"> <P STYLE='font-family: "New Times Roman"; font-size: 90%'>
It's been reported the latter method doesn't work very well in some browsers, therefore the first one should be used.
Class selector is a "stand alone" class to which a specific style is declared. Using the CLASS attribute the declared style can then be associated with any HTML element. The class selectors are created by a period followed by the class's name. The name can contain characters a-z, A-Z, digits 0-9, period, hyphen, escaped characters, Unicode characters 161-255, as well as any Unicode character as a numeric code, however, they cannot start with a dash or a digit. (Note: in HTML the value of the CLASS attribute can contain more characters).It is a good practice to name classes according to their function than their appearance.
.footnote {font: 70%} /* class as selector */
<ADDRESS CLASS=footnote/>This element is associated with the CLASS footnote</ADDRESS> <P CLASS=footnote>And so is this</P>
You need to know what the 100% is of, so the parent div must have a height set. One problem that people often come up against is making the main page fill the screen if there's little content. You can do that like this : CSS body, html { height:100%; } body { margin:0; padding:0; } #wrap { position:relative; min-height:100%; } * html #wrap { height:100%; }
Here, the #wrap div goes around your whole page - it's like a sub-body.
You need to use 'min-height' rather than 'height' for Firefox because otherwise it will set it to 100% of the viewport and no more. Internet Explorer, being well... crap, treats 'height' as it should be treating 'min-height' which it doesn't recognise. (You can target IE by preceding your code with ' * html ').
To make floated divs within this #wrap div 100% of the #wrap div... well that's more difficult. I think the best way is to use the 'faux columns' technique which basically means that you put the background in your body rather than your columns. If the body has columns and your floats don't then it looks like your floated content is in a column that stretches to the bottom of the page. I've used this technique in my layout demos.
The problem is often not that the columns aren't 100% height, but that they're not equal lengths. Columns usually don't start from the top of the page and end at the bottom - there's often a header and a footer or sometimes, more interesting designs don't have a recognisable columnar layout, but do require div boxes to be equal heights. This can be done with the aid of a couple of images and some css or with some javascript.
There are two types of CSS rules: ruleset and at-rule. Ruleset identifies selector or selectors and declares style which is to be attached to that selector or selectors. For example P {text-indent: 10pt} is a CSS rule. CSS rulesets consist of two parts: selector, e.g. P and declaration, e.g. {text-indent: 10pt}.
P {text-indent: 10pt} - CSS rule (ruleset) {text-indent: 10pt} - CSS declaration text-indent - CSS property 10pt - CSS value
With CSS, you can use the background-attachment property. The background attachment can be included in the shorthand background property, as in this example:
body { background: white url(example.gif) fixed ; color: black ; }
Note that this CSS is supported by Internet Explorer, Mozilla, Firefox Opera, Safari, and other browsers. In contrast, Microsoft's proprietary BGPROPERTIES attribute is supported only by Internet Explorer.
In vertical margins, auto is always equal to 0. In horizontal margins, auto is only equal to 0 if the width property is also auto. Here are three examples, assume that there is a <P> that is a child of<BODY>:
Example 1: auto value on the width.
BODY {width: 30em;} P {width: auto; margin-left: auto; margin-right: auto;}
Since the width property is auto, the auto values of the two margins will be ignored. The result is a P that is 30em wide, with no margins.
Example 2: two auto margins
BODY {width: 30em;} P {width: 20em; margin-left: auto; margin-right: auto;}
The P will be 20em wide and the remaining 10em will be divided between the two margins. Paragraphs will be indented 5em at both sides.
Example 3: one auto margin
BODY {width: 30em;} P {width: 20em; margin-left: 2em; margin-right: auto;}
In this case, paragraphs are 20em wide and are indented 2em on the left side. Since the total width available is 30em, that means the right margin will be 8em. Note that the default value of width is auto, so setting one or both margins to auto is only useful if you set the width to something other than auto at the same time.
Cascade is a method of defining the weight (importance) of individual styling rules thus allowing conflicting rules to be sorted out should such rules apply to the same selector.
Declarations with increased weight take precedence over declaration with normal weight:
P {color: white ! important} /* increased weight */ P (color: black} /* normal weight */
Are Style Sheets case sensitive? No. Style sheets are case insensitive. Whatever is case insensitive in HTML is also case insensitive in CSS. However, parts that are not under control of CSS like font family names and URLs can be case sensitive - IMAGE.gif and image.gif is not the same file.
A Great Tutorials Portal
Aquarian Infotech System
Copyright © 2008 interviewmaterial.com. All rights reserved.