CSS2 Overflow and clipping
0Generally, the content of a block box is confined to the content edges of the box. In certain cases, a box may overflow, meaning its content lies partly or entirely outside of the box, e.g.:
- A line cannot be broken, causing the line box to be wider than the block box.
- A block-level box is too wide for the containing block. This may happen when an element’s ‘width’ property has a value that causes the generated block box to spill over sides of the containing block.
- An element’s height exceeds an explicit height assigned to the containing block (i.e., the containing block’s height is determined by the ‘height’ property, not by content height).
- A box is positioned absolutely.
- It has negative margins.
Whenever overflow occurs, the ‘overflow’ property specifies how (and whether) a box More >
Specifying media-dependent style sheets
0There are currently two ways to specify media dependencies for style sheets:
Specify the target medium from a style sheet with the @media or @import at-rules. Example(s):
@import url(“loudvoice.css”) aural;@media print { /* style sheet for print goes here */}
Specify the target medium within the document language. For example, in HTML 4.0 ([HTML40]), the “media” attribute on the LINK element specifies the target media of an external style sheet:
The body…
The @import rule is defined in the chapter on the cascade.
7.2.1 The @media ruleAn @media rule specifies the target media types (separated by commas) of a set of rules (delimited by curly braces). The @media construct allows style sheet rules for various media in the same style sheet:
@media print { BODY { font-size: 10pt } } @media screen { BODY { font-size: 12pt } } @media screen, print { BODY { line-height: 1.2 } }
Font family: the ‘font-family’ property
0- ‘font-family’
- Value: [[ | ],]* [ | ] | inherit Initial: depends on user agent Applies to: all elements Inherited: yes Percentages: N/A Media: visual
This property specifies a prioritized list of font family names and/or generic family names. To deal with the problem that a single font may not contain glyphs to display all the characters in a document, or that not all fonts are available on all systems, this property allows authors to specify a list of fonts, all of the same style and size, that are tried in sequence to see if they contain a glyph for a certain character. This list is called a font set.
For example, text that contains English words mixed with mathematical symbols may need
A sample style sheet for HTML 4.0
0This style sheet describes the typical formatting of all HTML 4.0 ([HTML40]) elements based on extensive research into current UA practice. Developers are encouraged to use it as a default style sheet in their implementations.
The full presentation of some HTML elements cannot be expressed in CSS2, including replaced elements (IMG, OBJECT), scripting elements (SCRIPT, APPLET), form control elements, and frame elements.
ADDRESS,BLOCKQUOTE,BODY, DD, DIV,DL, DT,FIELDSET, FORM,FRAME, FRAMESET,H1, H2, H3, H4,H5, H6, IFRAME,NOFRAMES,OBJECT, OL, P,UL, APPLET,CENTER, DIR,HR, MENU, PRE { display: block }LI { display: list-item }HEAD { display: none }TABLE { display: table }TR { display: table-row }THEAD { display: table-header-group }TBODY { display: table-row-group }TFOOT { display: table-footer-group }COL { display: table-column }COLGROUP { display: table-column-group }TD, TH { display: table-cell }CAPTION { display: table-caption }TH { font-weight: bolder; text-align: center }CAPTION { text-align: center }BODY { padding: 8px; line-height: 1.33 }H1 { font-size: CSS text-shadow in firefox and internet explorer
0With my discovery of almost cross browser text-shadow something kept nagging me: It didn’t work in Firefox. A couple of days ago I went back to my experiments and succeeded in a reasonable looking text-shadow effect in Firefox. What’s more, In some configurations I can even make it look 3D!
Rationale
Before we delve into the code I want to give you a little insight into how I came up with this text-shadow implementation. What a text-shadow basically is, is a blurred version of the text placed behind it (with or without a slight offset). This idea helped me implement text-shadow in IE by using the glow and blur filters it has.
For Firefox I had to go one step further. Firefox doesn’t offer glow or blur filters, So I had to rebuild them in another way. A blur, in essence, is the same image layered over itself for a More >
Pure CSS Footer
0We’ve all had problems with getting the Footer to always stay on the bottom of the page. Now that problem is gone with Sicky-Footer written by Ryan Fait. This is very easy to implement and with minimum coding for both the CSS and HTML. It works in all browsers IE 5 and up, Firefox, Safari and Opera.
Popularity: 82%
CSS3 Opacity Property
0If you haven’t heard, you can create an opacity for an image in CSS3 without using JavaScript or any hack. To see the whole image use opacity:1.0 and to see nothing use opacity:0.0;. In order for the opacity to work in IE you must use filter:alpha(opacity=100). For CSS opacity to work in the browser it must have some placement specified, like float:left and that works for Internet Explorer, Mozilla Firefox and Opera. The code is below for a 50% Opaque:
.image_opacity {
float:left;
opacity: 0.5
filter: alpha(opacity = 50); }
