1. ホーム
  2. Web制作
  3. HTML/Xhtml

自社コンパイルのDIV共通属性

2022-01-27 08:10:58
I. 属性一覧
コピーコード
コードは以下の通りです。

color : #999999 Text color
font-family : 宋体 text font
font-size : 10pt Text size
font-style:itelic text slant sports
font-variant:small-caps small font
letter-spacing : 1pt text-spacing
line-height : 200% Set line height
font-weight:bold Text bold
vertical-align:sub subscript font
vertical-align:super superscript
text-decoration:line-through add?h dividing line
text-decoration:overline Add topline
text-decoration:underline Add underline
text-decoration:none ?h except underline
text-transform : capitalize Initial capitalization
text-transform : uppercase English uppercase
text-transform : lowercase English write
text-align:right Text *right-aligned
text-align:left Text *left-aligned
text-align:center Text center-aligned
These are some simple text effects that can be applied to css pages. 
Background
background-color:black background-color
background-image : url(image/bg.gif) background-image
background-attachment : fixed fixed background
background-repeat : repeat repeat-arrange-web-preset
background-repeat : no-repeat no-repeat
background-repeat : repeat-x Repeat on x-axis
background-repeat : repeat-y in the y-axis
background-position : 90% 90% Position of background image on x and y axis  
Link
A All hyperlinks
A:link hyperlink text format
A:visited Browsed link text formatting
A:active Pressed connection formatting
A:hover Mouse over connection
Borders
border-top : 1px solid black top-frame
border-bottom : 1px solid #6699cc lower frame
border-left : 1px solid #6699cc left frame
border-right : 1px solid #6699cc right frame
border: 1px solid #6699cc four borders
dotted line
<TEXTAREA STYLE="border:1px dashed pink">
Solid Line
<TEXTAREA STYLE="border:1px solid pink">
Set the height of the div to be the same as the line height of the text, i.e. line-height and height are the same, and finally give the div an over-flow: hidden, so that the excess is hidden.

II. 共通属性
コピーコード
コードは以下の通りです。

1. Height:set the height of the DIV; Width:set the width of the DIV.
2, margin: used to set the outer margin of the DIV, that is, the distance to the parent container. margin: followed by four distances to the top-right-bottom-left of the parent container; margin: [top][right][bottom][left]
You can set: margin-left: the distance to the left border of the parent container; margin-right: the distance to the right border of the parent container; margin-top: the distance to the top border of the parent container; margin-bottom: the distance to the bottom border of the parent container, respectively.
3. padding: is used to set the inner margin of the DIV (the distance between the inner element and the border of the DIV). padding: is followed by four distances to the top-right-bottom-left of the parent container; margin: [top][right][bottom][left]: it should be noted that the distance set by padding is not included in the For example, if the width of a DIV is set to 100px and the padding-left is set to 50px, then the DIV will be 150px wide on the page.
4、border:Set the border style of the DIV; display:Set the display property. The values are block, none; float: set the flow direction of the DIV on the page, the values are left (left display), right (right display), none.
background:Set the background style of the DIV; background can be directly followed by the background color, background image, tiling method and other styles. It can also be set separately with the following attributes.
background-color: sets the background color; background-attachment: the way the background image is attached, the values are scroll, fixed; background-image: specifies the background image to be used; background-repeat: the way the background image is tiled. The values are no-repeat (not tiled), repeat (tiled in both directions), repeat-x (tiled horizontally), repeat-y (tiled vertically); background-position: position the background in the DIV. Its value has different combinations of top bottom left right. The specific position can also be specified in coordinates.
5、position:Set the positioning of the DIV. position has four properties: static, fixed, relative, absolute. If specified as static, the DIV follows HTML rules; if specified as relative, you can use top, left, right, and bottom to set the DIV's offset (relative to itself) in the page, but you cannot use layers at this time; if specified as absolute, you can use top, left, right, and bottom to set the DIV's offset in the page. If specified as absolute, you can use top, left, right, bottom to position the DIV absolutely (to its nearest parent element); if specified as fixed, the position of the DIV is fixed relative to the screen in IE7 and FF, and has no effect in IE6 (I don't know why).
6, font: specify the style of the text in the DIV, followed by multiple styles of text. font-family: set the name of the font to be used; font-weight: specify the thickness of the text, the value of bold bolder lighter, etc.; font-size: specify the size of the text; font-style: specify the text style font-style: specify the text style, the values are italic normal oblique, etc.; color: specify the text color; text-align: specify the text horizontal alignment, the values are center (center) left right justify; text-decorator: for the text modification; the values are none underline overline line-through and blink combinations; text-indent: set the text indent; text-transform: set the text case. The values are lowercase uppercase capitalize (initial capitalization) none; direction: the flow of content. The values are ltr (left to right), rtl (right to left); line-height: specify the line height of the text; Word-spacing: word spacing.
7, overflow: content overflow control, its value is scroll (always show scroll bar), visible (do not show scroll bar, but beyond the part visible), auto (content beyond the display of scroll bar), hidden (beyond the content hidden).

III. いくつかの特殊効果
1. z-index。DIVのカスケード順序を設定します。z-index属性を使用する場合、positionはabsoluteで指定しないと機能しません。
2.カーソル DIV上のカーソルのスタイルを設定します。
3、clip:クリップの矩形を設定する。 clip:rect(top right bottom left);上下の距離を設定し、位置を絶対値で指定する。
4、不透明度 透明度 filter:alpha(opacity=value) 例: filter:alpha(opacity=50);opacity:0.5;
IV. 位置決めと制御
絶対位置と相対位置(ポジション)
絶対位置決め。
ポジショニング属性は、ネットユーザーにとって幸せへの扉を開く鍵になるでしょう:。
H4 { position: absolute; left: 100px; top: 43px }
このCSSルールにより、ブラウザは<H4>の開始位置を、ブラウザの左からちょうど100ピクセル、上から43ピクセルに設定することができます。ここで設定されているのは左と上だけなので、テキストは左から右、上から下の順にブラウザウィンドウに読み込まれることに注意してください。
leftとtopのプロパティは、直感的に理解できるように、left(左)はブラウザウィンドウの左側からの要素の距離、top(上)はブラウザウィンドウの上からの距離を設定する。これらの距離を設定する際には、学習した様々な度数単位やスケール値を利用することができます。スケール値を使用する場合、スケール値は親要素のサイズに対する相対値です。
どのようなポジションが可能ですか?何でもOK! 段落、単語、GIFやJPEG画像、QUICKTIMEムービーなどなど。
相対的な位置決め。
絶対位置決めでは、ページ上の他の要素の位置設定に関係なく、ページ上の独立した要素を正確に位置決めすることができます。相対的な位置決めとは、位置決めする要素の位置が、文書内でその要素に割り当てられている位置と相対的であることを意味します。例
I { position: relative; left: 40px; top: 10px }.
相対位置決めのポイントは、位置決めされた要素の位置が、通常あるべき場所に対して相対的に位置決めされていることです。相対配置されたセルは、通常の静的配置されたセルの行間に表示され、静的配置されたセルから完全に離れることなく位置決めされます。相対配置の使用を中止すると、テキストの表示位置は通常通りに戻ります。相対配置を使用すると、簡単にページが非常にゴチャゴチャになるので注意が必要です。
相対位置と絶対位置の他に、staticパラメータ値も使用できます。staticは、position機能のデフォルト値です。通常のHTMLのpositionメソッドと同じように使用され、特別な位置決め設定は付加されません。つまり、margin機能や、float機能を使ってセルを浮かせたりすると、セルの位置決めに影響を与えることがありますが、それを除けば、そのようなことはありません。
位置決めユニット制御(幅、高さ、可視性)
ポジショニングセルの左上隅の位置を制御するだけでなく、セルの幅と高さ、ページ上でのセルの可視性を制御することができます。
幅:位置決めされた要素は、ページ上に表示される際にも左から右へずっと表示されます。widthプロパティを使って、文字がどこまで右に流れるかの制限を設定する、つまり要素の幅を設定することができます。
DIV { position: absolute; left: 200px; top: 40px; width: 150px }.
このルールを受け取ったブラウザは、ルールで指定された通りにテキストを表示し、さらに段落の水平方向の最大サイズを150ピクセルに制限します。
widthプロパティは、絶対位置指定された要素にのみ適用されます。幅は、これまでに学んだ長さの単位のいずれかを使用するか、親要素との相対的な比率を参照するスケール値を使用して設定できます。IE 4では、このプロパティは画像にも適用されます。widthの設定で、画像を人為的に広げたり縮めたりすることができます。
高さ:理論的には、高さは縦方向以外は幅と同様に設定する必要があります。
DIV { position: absolute; left: 200px; top: 40px; height: 150px }.
ここで "theoretically" としたのは、height 属性に対応していないブラウザがあるためです。
可視性を確保する。CSS を使用すると、ページ上に表示されないように要素を隠すことができます。このプロパティは、配置された要素とされていない要素の両方で機能します。
H4 { visibility: hidden }.
オプション
可視化 要素を可視化する
hidden 要素を非表示にします。
inherit は、親要素の可視性設定を継承することを意味します。
inheritという値はデフォルトの値です。これにより、セルは親セルの可視性を継承する。従って、段落が隠された場合、それが含むすべてのインターリニアセルも隠される。この継承は、明示的に指定された可視性によって置き換えることができる。例えば、段落内のEMセルがvisibleとして指定されている場合、段落が隠されると、段落内の他のすべての内容が消え、EMセルのテキストのみが見えるようになります。
要素を非表示にした場合でも、ブラウザのウィンドウ内に元のスペースを確保する必要があります。そのため、非表示の画像をテキストで囲むと、空白の領域をテキストで囲んだ表示になってしまいます。このニュース
この属性は、言語を書くときや動的なHTMLを使うときに便利で、例えば、マウスがスライドしたときだけ段落や画像を表示させることができます。
単位階層(z-index)
機能 z-indexは、画面上のセルを積み重ねるために使用されます。デフォルトでは、セルはHTMLマークアップに表示される順序で積み重ねられる。つまり、後から現れたセルは先に現れたセルの上に積み重ねられる。仕様書案によると、z-indexが正の値を持つセル群は親の上に積み上げられ、自身の積み上げ順は値の大きさによって決まる(値が大きいものが上になる)。同様に、負のz-index値を持つセル群は親の下に積み上げられ、それら自身の積み上げ順序は値の大きさによって決定される(より大きな値が上に、例えば、-1の上に-2があるように)。
パラメータ値には純粋な整数が使用されます。z-indexは絶対的または相対的に配置される要素に使用されます。また、画像にz-indexを設定することもできます。(Communicatorの場合、<IMG>タグを<SPAN>または<DIV>タグで囲み、その中にz-indexを適用するとよいでしょう(<SPAN> または<DIV>)。
クリップ絶対位置決め単位(clip)

絶対位置指定されたセルをクリップすることができます。つまり、ユーザーに表示される範囲にクリップして、セルの一部だけを表示し、残りは透明にすることができます。従来のテキストや画像ベースのWebページでは、これはあまり便利な機能ではありません。しかし、マルチメディアのページが必要な場合には有効である。例えば、Netscape Communivator 4とInternet Explorer 4は、ドキュメントのスクリプト・インターフェースを通じてセル周辺のクリップ領域を動的に調整し、実線のテキスト"スクラッチ"や画像のフェードなどの表示機能を実現するマルチメディア・ページをサポートしています。
CSSでは、クリップはクリップ機能によって制御されます。この機能は、セルを絶対的に配置する場合にのみ使用でき、デフォルト値はautoで、セルの外縁でセルをクリップします(これは事実上クリップ無しと同じです)。また、クリップボックスは次のような表現で設定することもできます。
clip : rect(top,right.bottom,left) ;
top、right、bottom、leftの値には、絶対長、相対長の値(ただしパーセント値は不可)、またはキーワードautoを指定することができる。autoの値は、クリップ領域のすべての辺が配置されると、クリップされたセルの何もこの領域からはみ出さないことを意味します。
コントロールユニットのオーバーフロー(溢れ)
セルの幅と高さの絶対位置または相対位置を固定すると、指定された領域が実際のセルの内容を収容できないため、セルの内容がオーバーフローする可能性があります。この場合、overflowを使用して、ブラウザがオーバーフローをどのように処理するかを指定することができます:値none(デフォルト)は、ブラウザにオーバーフローを表示させるので、セルは指定された領域からはみ出すことができます。値clipは、ブラウザがセルの下部と右側でセルの内容をクリップすることを要求し、指定された領域を超えたセルの内容が表示されないようにします。値のスクロールもブラウザにセルの下部と右側でセルの内容をクリップするよう要求します(clip と同じ)が、ブラウザは(可能であれば)セルのスクロールバーを提供し、ユーザーがクリップされた内容をスクロールできるようにする必要があります。