| Code | Result |
|---|---|
<div style="width:300px; height:100px; overflow:scroll;" id=ex_1> This is some sample text. This is some sample text. This is some sample text. This is some sample text. This is some sample text. This is some sample text. This is some sample text. This is some sample text. This is some sample text. This is some sample text. </div> |
This is some sample text. This is some sample text. This is some sample text. This is some sample text. This is some sample text.
This is some sample text. This is some sample text. This is some sample text. This is some sample text. This is some sample text. |
<div style="width:300px; height:100px; overflow:visible;" id=ex_1> This is some sample text. This is some sample text. This is some sample text. This is some sample text. This is some sample text. This is some sample text. This is some sample text. This is some sample text. This is some sample text. This is some sample text. This is some sample text. This is some sample text. This is some sample text. This is some sample text. This is some sample text. This is some sample text. </div> |
This is some sample text. This is some sample text. This is some sample text. This is some sample text. This is some sample text.
This is some sample text. This is some sample text.
This is some sample text. This is some sample text.
This is some sample text. This is some sample text.
This is some sample text. This is some sample text. This is some sample text. This is some sample text. This is some sample text. |
<div style="width:300px; height:100px; overflow:hidden;" id=ex_1> This is some sample text. This is some sample text. This is some sample text. This is some sample text. This is some sample text. This is some sample text. This is some sample text. This is some sample text. This is some sample text. This is some sample text. This is some sample text. This is some sample text. This is some sample text. This is some sample text. This is some sample text. This is some sample text. </div> |
| Code | Result |
|---|---|
Some text before.<span>Some text inside</span> Some text after. |
Some text before. Some text inside Some text after. |
Some text before.<span style="visibility:hidden;">Some text inside</span> Some text after. |
Some text before. Some text after. |
Some text before.<span style="visibility:collapse;">Some text inside</span> Some text after. |
Some text before. Some text inside Some text after. |
| Code | Result |
|---|---|
Some text before.<span>Some text inside</span> Some text after. |
Some text before. Some text inside Some text after. |
Some text before.<span style="display:block;">Some text inside</span> Some text after. |
Some text before. Some text inside Some text after. |
Some text before.<span style="display:none;">Some text inside</span> Some text after. |
Some text before. Some text after. |
Please notice that when display property is set to none that not only the element does not appear,
but also the space for the element is not allocated.
| Code | Result |
|---|---|
.rel_pos {
position: relative;
top: 5px;
left: -5px;
}
/* element of the class should be shifted 5 pixels down
and 5 pixels to the left from its original position */
...
Some text before.
<span class=rel_pos>Some text inside</span>
Some text after.
|
Some text before. Some text inside Some text after. |
An element is said to be positioned if its position property has a value other than static. Positioned elements generate positioned boxes, laid out according to four properties:
filter: chroma(color=desired_color);Let's look at the following example. We want to create a button that contains a picture and some text. The problem is we have our picture on white background and we don't know the default button background. We also don't want to make it white. Using the described filter we can make all pixel of white color transparent. The first example below illustrates button without color and the second example shows how the filter changes it:
| Code | Result |
|---|---|
<form> <button><img src="../images/check.bmp">OK</button> </form> | |
<form> <button> <img src="../images/check.bmp" style="filter:chroma(color=white);"> OK </button> </form> |
Let us shortly describe some CSS filters:
| Filter | Parameters | Code | Result |
|---|---|---|---|
| FlipH | none |
<div style="width:200px; filter: fliph();"> Horizontal flip filter </div> |
Horizontal flip filter
|
| FlipV | none |
<div style="width:200px; filter: flipv();"> Vertical flip filter </div> |
Vertical flip filter
|
| Shadow |
#shadow_fltr {
width: 200px;
filter: shadow(color=blue, direction=100);
}
...
<div id=shadow_fltr>
Shadow filter
</div>
|
Shadow filter
|
|
| Glow |
#glow_fltr {
width: 200px;
filter: glow(color=#f4ef98, strength=4);
}
...
<div id=glow_fltr>
Glow filter
</div>
|
Glow filter
|
|
| DropShadow |
#drop_shadow_fltr {
width: 200px;
filter: dropshadow(color=gray, OffX=3, offy=3);
}
...
<div id=drop_shadow_fltr>
Drop shadow filter
</div>
|
Drop shadow filter
|
|
Note: Most filters work only in MSIE.