布局模型(一) - 洛水三千
首先来了解什么包含块,css包含块是css标准布局中的一个重要的概念,它是绝对定位的基础。包含块就是为绝对定位元素提供坐标偏移和显示范围的参照物,即确定绝对定位的偏移起点和百分比长度的参考。
由于ie浏览器在解析多层包含时会存在一些问题,在ie浏览器中只有当绝对定位的元素拥有层特征时才能准确解析,层特征应该包含:width:100px;height:100px;position:
例如:
<span style="color: #000000;">div id="div1"> </span><span style="color: #0000ff;"><span style="color: #800000;">h2</span><span style="color: #0000ff;">></span>标题<span style="color: #0000ff;"></span><span style="color: #800000;">h2</span><span style="color: #0000ff;">></span> <span style="color: #0000ff;"><span style="color: #800000;">div </span><span style="color: #ff0000;">id</span><span style="color: #0000ff;">="div2"</span><span style="color: #0000ff;">></span> <span style="color: #0000ff;"><span style="color: #800000;">p</span><span style="color: #0000ff;">></span><span style="color: #800000;">p</span><span style="color: #0000ff;">></span> <span style="color: #0000ff;"><span style="color: #800000;">span</span><span style="color: #0000ff;">></span><span style="color: #800000;">span</span><span style="color: #0000ff;">></span> <span style="color: #0000ff;"><span style="color: #800000;">p</span><span style="color: #0000ff;">></span><span style="color: #800000;">p</span><span style="color: #0000ff;">></span> <span style="color: #0000ff;"></span><span style="color: #800000;">div</span><span style="color: #0000ff;">></span> <span style="color: #0000ff;"></span><span style="color: #800000;">div</span><span style="color: #0000ff;">></span></span></span></span></span></span>
CSS:
<span style="color: #800000;">#div1</span>{<span style="color: #ff0000;"> position</span>:<span style="color: #0000ff;">relative</span>;<span style="color: #ff0000;"> background</span>:<span style="color: #0000ff;">blue</span>; <span style="color: #008000;">/*</span><span style="color: #008000;">height:200px; width:200px;加上宽、高后ie6才能够正常解析</span><span style="color: #008000;">*/</span> }<span style="color: #800000;"> #div2</span>{<span style="color: #ff0000;"> position</span>:<span style="color: #0000ff;">absolute</span>;<span style="color: #ff0000;"> width</span>:<span style="color: #0000ff;">100px</span>;<span style="color: #ff0000;"> height</span>:<span style="color: #0000ff;">100px</span>;<span style="color: #ff0000;"> background</span>:<span style="color: #0000ff;">red</span>;<span style="color: #ff0000;"> left</span>:<span style="color: #0000ff;">50%</span>;<span style="color: #ff0000;"> top</span>:<span style="color: #0000ff;">50%</span>; }

Outils d'IA chauds

Undresser.AI Undress
Application basée sur l'IA pour créer des photos de nu réalistes

AI Clothes Remover
Outil d'IA en ligne pour supprimer les vêtements des photos.

Undress AI Tool
Images de déshabillage gratuites

Clothoff.io
Dissolvant de vêtements AI

AI Hentai Generator
Générez AI Hentai gratuitement.

Article chaud

Outils chauds

Bloc-notes++7.3.1
Éditeur de code facile à utiliser et gratuit

SublimeText3 version chinoise
Version chinoise, très simple à utiliser

Envoyer Studio 13.0.1
Puissant environnement de développement intégré PHP

Dreamweaver CS6
Outils de développement Web visuel

SublimeText3 version Mac
Logiciel d'édition de code au niveau de Dieu (SublimeText3)

Sujets chauds

Difficulté à mettre à jour la mise en cache des pages Web officielles du compte: comment éviter l'ancien cache affectant l'expérience utilisateur après la mise à jour de la version?

Comment utiliser les attributs de validation du formulaire HTML5 pour valider l'entrée utilisateur?

Comment ajouter efficacement les effets de course aux images PNG sur les pages Web?

Quelles sont les meilleures pratiques pour la compatibilité entre les navigateurs dans HTML5?

Quel est le but du & lt; datalist & gt; élément?

Quel est le but du & lt; Progress & gt; élément?

Quel est le but du & lt; mètre & gt; élément?

Comment utiliser le html5 & lt; time & gt; élément pour représenter les dates et les temps sémantiquement?
