Bac à sable : Différence entre versions

De La Bibliothèque Impériale
m
 
(27 révisions intermédiaires par 6 utilisateurs non affichées)
Ligne 1 : Ligne 1 :
<div style="text-align: justify;">''« Ma bibliothèque regorge de savoir : les Dieux nouveaux comme oubliés, les tyrans, les héros, les cités et les civilisations perdues... ainsi que des connaissances interdites. En effet, certaines choses ne devraient pas tomber entre toutes les mains. Et si on y jetait un œil ? »''</div>
+
__NOTOC__
:::'''- Andreas Halldenstadt, scribe en chef de la Grande Bibliothèque d’Altdorf'''
+
=HTML=
  
 +
:''Documentation de référence : https://developer.mozilla.org/fr/docs/Web/HTML/Element
 +
<hr>
  
{| border="1" cellpadding="15" align="center" style="border-color: black; border-collapse: collapse; border: 1px" valign="top" width="804px"
+
 
!colspan=4 style="text-align:center; background:#656565;" | <big>Les Principales Forces Armées</big>
+
Le langage '''HTML''' permet de décrire le '''contenu''' d'une page web.
 +
 
 +
* Le code HTML s'écrit par '''balises''' qui vont s'imbriquer les unes dans les autres.
 +
* Chaque balise définit la nature du contenu. Quelques exemples :
 +
** '''<nowiki><p>...</p></nowiki>''' : paragraphe
 +
** '''<nowiki><a>...</a></nowiki>''' : un lien internet
 +
** '''<nowiki><table>...</table></nowiki>''' : une table
 +
** '''<nowiki><ul>...</ul></nowiki>''' : une liste
 +
** '''<nowiki><li>...</li></nowiki>''' : un élément d'une liste
 +
** '''<nowiki><div>...</div></nowiki>''' : un conteneur générique en bloc (prend par défaut toute la largeur de son contenant)
 +
** '''<nowiki><span>...</span></nowiki>''' : un conteneur générique en ligne ( prend juste la place nécessaire)
 +
* A chaque balise on peut définir des '''attributs'''. Les attributs sont divers, mais chacun défini une informations associé à la balise en question. Par exemple, l'attribut ''href'' permet de définir l'adresse d'un lien d'une balise ''<a>''. Nous verrons plus loin que les attributs '''style''' et '''class''' permettront d'associer des règles CSS au contenu HTML.
 +
 
 +
'''Exemple:'''
 +
<pre>
 +
 
 +
<div>
 +
  <p>Mon premier paragraphe.</p>
 +
  <p>Deuxième paragrapge.</p>
 +
  <p>Voici quelques liens
 +
      <ul>
 +
        <li><a href="https://omnis-bibliotheca.com/">lien vers l'Omnis Bibliotheca<a></li>
 +
        <li><a href="https://bibliotheque-imperiale.com/">lien vers la Bibliothèque Impériale<a></li>
 +
      </ul>
 +
  </p>
 +
</div>
 +
 
 +
</pre>
 +
 
 +
'''N.B: Il est possible d'intégrer du code HTML directement dans une page wiki. Dans l'exemple ci-dessus, le code HTML a été indenté (aéré) pour plus de lisibilité, cependant dans une page wiki <span style="color: red;">il ne faudra pas mettre d'espaces vides en début de ligne</span>, car cela a une signification bien précise dans la syntaxe wiki, ce qui emêchera le code HTML d'être reconnu comme tel.'''
 +
 
 +
=CSS=
 +
 
 +
:''Documentation de référence : Documentation de référence: https://developer.mozilla.org/fr/docs/Web/CSS
 +
<hr>
 +
 
 +
 
 +
Le '''CSS''' permet de définir des '''règles d'affichage''' du contenu HTML. C'est au navigateur web de procéder au rendu graphique (d'où le problème entre les différents navigateurs qui ont parfois des comportement un peu différents sur certaines règles CSS).
 +
 
 +
* Le code HTML peut intégrer lui-même directement du code CSS à appliquer pour une balise, via l'attibut '''style'''.
 +
* Une autre manière (plus structurée) d'appliquer du CSS, c'est de définir des '''règles''' CSS. Chaque règle commence par indiquer sa cible dans le HTML, puis le code CSS à lui appliquer. Dans un wiki, les Admins du site peuvent définir des règles CSS du site dans une page consacré : [[:MediaWiki:Common.css]].
 +
** Une manière d'invoquer des règles CSS depuis le HTML, est de définir un ou plusieurs nom de classe via l'attribut '''class'''. Ces nom de classe pourront être utiliser pour définir les cibles des règles CSS.
 +
 
 +
 
 +
'''Exemple:'''
 +
Voici une règle ciblant toutes les tables de classe ''custom-table'', indiquant de leur appliquer un background rouge et de colorer le texte en bleu.
 +
:Règle CSS :
 +
<pre>
 +
table.custom {
 +
  background: red;
 +
  color: blue;
 +
}
 +
</pre>
 +
:HTML cible :
 +
<pre>
 +
<table class="custom-table">
 +
...
 +
</table>
 +
</pre>
 +
:Code wiki cible :
 +
<pre>
 +
{| class="custom-table"
 +
...
 +
|}
 +
</pre>
 +
 
 +
 
 +
'''N.B: Il existe l'extension wiki [https://www.mediawiki.org/wiki/Extension:CSS Extension:CSS] à installer sur le serveur d'un wiki, permettant de définir des règles CSS directement dans la page d'un wiki, sans passer par la page ''MediaWiki:Common.css''.
 +
 
 +
=Applications=
 +
 
 +
==Table simple==
 +
 
 +
Voici un exemple de codage d'une table simple.
 +
 
 +
{|
 
|-
 
|-
|style="border-color: black; width: 25%;height: 160px;background:#999;" align=center|[[Image:Logo Bretonnie.png|center|130px|link=Catégorie:La Bretonnie]]
+
! En-tête 1 !! En-tête 2 !! En-tête 3
|style="border-color: black; width: 25%;background:#999;" align=center|[[Image:Logo Vampire.jpg|center|136px|link=Catégorie:Comtes Vampires]]
 
|style="border-color: black; width: 25%;background:#999;" align=center|[[Image:Logo Démons.png|center|130px|link=Catégorie:Démons]]
 
|style="border-color: black; width: 25%;background:#999;" align=center|[[Image:Whm V3 Elfe Noir.png|center|140px|link=Catégorie:Elfes Noirs]]
 
 
|-
 
|-
|style="border-color: black; background:#F4661B;" align=center|[[:Catégorie:La Bretonnie|La Bretonnie]]
+
| A1 || A2 || A3
|style="border-color: black; background:#003366;" align=center|[[:Catégorie:Comtes Vampires|Les Comtes Vampires]]
 
|style="border-color: black; background:#DB1702;" align=center|[[:Catégorie:Démons|Les Démons]]
 
|style="border-color: black; background:#A10684;" align=center|[[:Catégorie:Elfes Noirs|Les Elfes Noirs]]
 
 
|-
 
|-
|style="border-color: black; height: 160px;background:#999;" align=center|[[Image:Whm V3 Elfeb.png|center|154px|link=Catégorie:Elfes Sylvains]]
+
| B1 || B2 || B3
|style="border-color: black; background:#999;" align=center|[[Image:Logo Empire.png|center|130px|link=Catégorie:L'Empire]]
 
|style="border-color: black; background:#999;" align=center|[[Fichier:ChaosHelmSmoke.png|center|160px|link=Catégorie:Esclaves des Ténèbres]]
 
|style="border-color: black; background:#999;" align=center|[[Image:Whm V3 Elfe.png|center|121px|link=Catégorie:Hauts Elfes]]
 
 
|-
 
|-
|style="border-color: black; background:#3A9D23;" align=center|[[:Catégorie:Elfes Sylvains|Les Elfes Sylvains]]
+
| C1 || C2 || C3
|style="border-color: black; background:#0000FF;" align=center|[[:Catégorie:L'Empire|L'Empire]]
+
|}
|style="border-color: black; background:#303030;" align=center|[[:Catégorie:Esclaves des Ténèbres|Les Guerriers du Chaos]]
+
 
|style="border-color: black; background:#7ac;" align=center|[[:Catégorie:Hauts Elfes|Les Hauts Elfes]]
+
 
 +
===Code wiki===
 +
Documentation : https://www.mediawiki.org/wiki/Help:Tables/fr
 +
 
 +
<pre>
 +
{|
 
|-
 
|-
|style="border-color: black; height: 160px;background:#999;" align=center|[[Image:Logo HB.jpg|center|140px|link=Catégorie:Hordes du Chaos]]
+
! En-tête 1 !! En-tête 2 !! En-tête 3
|style="border-color: black; background:#999;" align=center|[[Image:Logo HL.png|center|150px|link=Catégorie:Hommes-Lézards]]
 
|style="border-color: black; background:#999;" align=center|[[Image:Logo Nain.png|center|150px|link=Catégorie:Nains]]
 
|style="border-color: black; background:#999;" align=center|[[Image:Chaos-dwarfs.jpg|center|140px|link=Catégorie:Nains du Chaos]]
 
 
|-
 
|-
|style="border-color: black; background:#730800;" align=center|[[:Catégorie:Hordes du Chaos|Les Hommes-Bêtes]]
+
| A1 || A2 || A3
|style="border-color: black; background:#01796F;" align=center|[[:Catégorie:Hommes-Lézards|Les Hommes-Lézards]]
 
|style="border-color: black; background:#56739A;" align=center|[[:Catégorie:Nains|Les Nains]]
 
|style="border-color: black; background:#FF4901;" align=center|[[:Catégorie:Nains du Chaos|Les Nains du Chaos]]
 
 
|-
 
|-
|style="border-color: black; height: 160px;background:#999;" align=center|[[Image:la Gueule.png|center|150px|link=Catégorie:Royaumes Ogres]]
+
| B1 || B2 || B3
|style="border-color: black; background:#999;" align=center|[[Fichier:Orc symbol.png|center|120px|link=Catégorie:Peaux-Vertes]]
 
|style="border-color: black; background:#999;" align=center|[[Image:Logo_RdT.png|center|125px|link=Catégorie:Rois des Tombes]]
 
|style="border-color: black; background:#999;" align=center|[[Image:Logo Skaven.png|center|140px|link=Catégorie:Skavens]]
 
 
|-
 
|-
|style="border-color: black; background:#985717;" align=center|[[:Catégorie:Royaumes Ogres|Les Ogres]]
+
| C1 || C2 || C3
|style="border-color: black; background:#00561B;" align=center|[[:Catégorie:Peaux-Vertes|Les Peaux-Vertes]]
 
|style="border-color: black; background:#c96;" align=center|[[:Catégorie:Rois des Tombes|Les Rois des Tombes]]
 
|style="border-color: black; background:#2F1B0C;" align=center|[[:Catégorie:Skavens|Les Skavens]]
 
 
|}
 
|}
 +
</pre>
  
  
 +
===Code HTML équivalent===
  
 +
<pre>
  
 +
<table>
 +
    <tr>
 +
        <th> En-tête 1 </th>
 +
        <th> En-tête 2 </th>
 +
        <th> En-tête 3 </th>
 +
    </tr>
 +
    <tr>
 +
        <td> A1 </td>
 +
        <td> A2 </td>
 +
        <td> A3 </td>
 +
    </tr>
 +
    <tr>
 +
        <td> B1 </td>
 +
        <td> B2 </td>
 +
        <td> B3 </td>
 +
    </tr>
 +
    <tr>
 +
        <td> C1 </td>
 +
        <td> C2 </td>
 +
        <td> C3 </td>
 +
    </tr>
 +
</table>
  
 +
</pre>
  
::''« Nous avons consulté les connaissances interdites des anciens, de sages scribes et de puissants idiots. Ils ont tous leur place dans ma bibliothèque. Et puis, il y a les… coins obscurs… Oserons-nous ? »''
 
::::'''- Andreas Halldenstadt, scribe en chef de la Grande Bibliothèque d’Altdorf'''
 
  
 +
==Table avec code CSS==
  
{| class="wikitable" style="border-color: black; margin: auto; background:#999; border-style: solid; border-width: 3px 3px 3px 3px" align=center
+
Voici un exemple de codage d'une table avec code CSS.
|colspan=5 style="border-color: black; text-align:center; color:black; background:#656565; height:43px; border-style: solid; border-width: 1px 3px 1px 1px"| <big>'''Les Autres Peuples et États'''</big>|| colspan="2" style="border-color: black; text-align:center;background:#656565; height:43px; border-style: solid; border-width: 3px 3px 1px 1px" | <big>'''Le Monde'''</big>
+
 
 +
{| style="background: white; color: blue; text-align: center; width: 350px; border: 4px solid green;"
 
|-
 
|-
|colspan=4 style="border-color: black; text-align:center; color:black; background:#656565;" | '''Au Sud du Vieux Monde'''||colspan=1 style="border-color: black; text-align:center; color:black; background:#656565; border-style: solid; border-width: 1px 3px 1px 2px" | '''Le [[Nouveau Monde d'Or|Nouveau Monde]]'''||colspan=2 style="border-color: black; text-align:center; color:black; background:#656565; border-style: solid; border-width: 1px 3px 1px 2px" | '''Géographie et Langages'''
+
! En-tête 1 !! En-tête 2 !! En-tête 3
 +
|-
 +
| A1 || A2 || A3
 +
|- style="font-style: italic; color: green;"
 +
| B1 || B2 || B3
 +
|- style="font-weight: bold; color: red;"
 +
| style="background: lightgrey;" | C1
 +
| style="background: grey;" | C2
 +
| style="background: teal;" | C3
 +
|}
 +
 
 +
 
 +
===Code wiki avec code CSS===
 +
Documentation : https://www.mediawiki.org/wiki/Help:Tables/fr
 +
 
 +
<pre>
 +
{| style="background: white; color: blue; text-align: center; width: 350px; border: 4px solid green;"
 
|-
 
|-
|style="border-color: black; height:170px; width:170px;" |[[Fichier:Araby logo.png|130px|center|link=Catégorie:Arabie]]
+
! En-tête 1 !! En-tête 2 !! En-tête 3
|style="border-color: black; height:170px; width:170px;" |[[Fichier:Estalie logo.png|130px|center|130px|link=Estalie]]
+
|-  
|style="border-color: black; height:170px; width:170px;" |[[Fichier:Border princes.png|center|130px|link=Principautés Frontalières]]
+
| A1 || A2 || A3
|style="border-color: black; height:170px; width:170px;" |[[Fichier:Tilée logo.jpg|130px|center|link=Catégorie:Tilée]]
+
|- style="font-style: italic; color: green;"
|style="border-color: black; height:170px; width:170px; border-style: solid; border-width: 1px 3px 1px 2px" |[[Fichier:Logo amazones.png|130px|center|link=Amazone]]
+
| B1 || B2 || B3
|style="border-color: black; height:170px; width:170px;" |[[Image:Monde.png|center|130px|link=Catégorie:Le Monde Connu]]
+
|- style="font-weight: bold; color: red;"
|style="border-color: black; height:170px; width:170px;" |[[Fichier:Livre elfe.jpg|center|130px|link=Catégorie:Langages]]
+
| style="background: lightgrey;" | C1
 +
| style="background: grey;" | C2
 +
| style="background: teal;" | C3
 +
|}
 +
</pre>
 +
 
 +
 
 +
===Code HTML équivalent avec code CSS===
 +
 
 +
<pre>
 +
 
 +
<table style="background: white; color: blue; text-align: center; width: 350px; border: 4px solid green;">
 +
    <tr>
 +
        <th> En-tête 1 </th>
 +
        <th> En-tête 2 </th>
 +
        <th> En-tête 3 </th>
 +
    </tr>
 +
    <tr>
 +
        <td> A1 </td>
 +
        <td> A2 </td>
 +
        <td> A3 </td>
 +
    </tr>
 +
    <tr style="font-style: italic; color: green;">
 +
        <td> B1 </td>
 +
        <td> B2 </td>
 +
        <td> B3 </td>
 +
    </tr>
 +
    <tr style="font-weight: bold; color: red;">
 +
        <td style="background: lightgrey;"> C1 </td>
 +
        <td style="background: grey;"> C2 </td>
 +
        <td style="background: teal;"> C3 </td>
 +
    </tr>
 +
</table>
 +
 
 +
</pre>
 +
 
 +
 
 +
 
 +
==Table avec classe associée==
 +
 
 +
Voici un exemple de codage d'une table à laquelle il a été associé la '''classe''' ''"wikitable"''.
 +
 
 +
Ce qui n'apparait pas ici, c'est qu'il existe des régles CSS existante sur le site qui s'appliquent à toute <table> de classe "wikitable".
 +
 
 +
{| class="wikitable"
 
|-
 
|-
|style="border-color: black; background:#303030; height:43px;" align=center|[[:Catégorie:Arabie|L’Arabie]]
+
! En-tête 1 !! En-tête 2 !! En-tête 3
|style="border-color: black; background:#303030; height:43px;" align=center|[[Estalie|L’Estalie]]
 
|style="border-color: black; background:#303030; height:43px;" align=center|[[Principautés Frontalières|Les Principautés<br />Frontalières]]
 
|style="border-color: black; background:#303030; height:43px;" align=center|[[:Catégorie:Tilée|La Tilée]]
 
|style="border-color: black; background:#303030; height:43px; border-style: solid; border-width: 1px 3px 1px 2px" align=center|[[Amazone|Les Amazones]]
 
|style="border-color: black; background:#303030; height:43px;" align=center|[[:Catégorie:Le Monde Connu|Le Monde Connu]]
 
|style="border-color: black; background:#303030; height:43px;" align=center|[[:Catégorie:Langages|Les Langages]]
 
 
|-
 
|-
|colspan=2 style="border-color: black; text-align:center; color:black; background:#656565; border-style: solid; border-width: 1px 2px 1px 1px" | '''Au Nord du Vieux Monde'''||colspan=3 style="border-color: black; text-align:center; color:black; background:#656565; border-style: solid; border-width: 1px 3px 1px 1px" | '''L’[[:Catégorie:L'Extrême-Orient|Extrême-Orient]]'''||colspan=2 style="border-color: black; text-align:center; color:black; background:#656565;" | '''La Faune et la Flore'''
+
| A1 || A2 || A3
 
|-
 
|-
|style="border-color: black; height:170px; width:170px;" |[[Fichier:Kislev logo.jpg|130px|center|link=Catégorie:Le Tsarat de Kislev]]
+
| B1 || B2 || B3
|style="border-color: black; height:170px; width:170px; border-style: solid; border-width: 1px 2px 1px 1px" |[[Fichier:Norse logo.png|130px|center|link=Norse]]
 
|style="border-color: black; height:170px; width:170px;" |[[Fichier:Logo cathay.png|130px|center|link=Catégorie:Cathay]]
 
|style="border-color: black; height:170px; width:170px;" |[[Fichier:Logo inja.png|130px|center|link=Catégorie:Inja]]
 
|style="border-color: black; height:170px; width:170px; border-style: solid; border-width: 1px 3px 1px 1px" |[[Fichier:Logo nippon.png|130px|center|link=Catégorie: Nippon]]
 
|style="border-color: black; height:170px; width:170px;" |[[Image:Bestiaire.jpg|center|130px|link=Catégorie:Bestiaire]]
 
|style="border-color: black; height:170px; width:170px;" |[[Fichier:Flore logo.jpg|center|130px|link=Catégorie:Flore]]
 
 
|-
 
|-
|style="border-color: black; background:#303030; height:43px; border-style: solid; border-width: 1px 1px 3px 1px;" align=center|[[:Catégorie:Le Tsarat de Kislev|Le Kislev]]
+
| C1 || C2 || C3
|style="border-color: black; background:#303030; height:43px; border-style: solid; border-width: 1px 2px 3px 1px;" align=center|[[Norse|Les Norses]]
+
|}
|style="border-color: black; background:#303030; height:43px; border-style: solid; border-width: 1px 1px 3px 1px;" align=center|[[:Catégorie:Cathay|Le Cathay]]
+
 
|style="border-color: black; background:#303030; height:43px; border-style: solid; border-width: 1px 1px 3px 1px;" align=center|[[:Catégorie:Inja|L’Inja]]
+
 
|style="border-color: black; background:#303030; height:43px; border-style: solid; border-width: 1px 3px 3px 1px;" align=center|[[:Catégorie:Nippon|Le Nippon]]
+
===Code wiki avec classe associée===
|style="border-color: black; background:#303030; height:43px; border-style: solid; border-width: 1px 1px 3px 3px;" align=center|[[:Catégorie:Bestiaire|Le Bestiaire]]
+
Documentation : https://www.mediawiki.org/wiki/Help:Tables/fr
|style="border-color: black; background:#303030; height:43px; border-style: solid; border-width: 1px 1px 3px 1px;" align=center|[[:Catégorie:Flore|La Flore]]
+
 
|-
+
<pre>
| colspan="4" style="border-color: black; text-align:center;background:#656565; height:43px; border-style: solid; border-width: 1px 3px 1px 1px;" | <big>'''L’[[:Catégorie:Équipement|Équipement]]'''</big>|| colspan="3" style="border-color: black; text-align:center;background:#656565; height:43px;" | <big>'''L’Histoire du Monde'''</big>
+
{| class="wikitable"
|-
 
|style="border-color: black; height:170px; width:170px;" |[[Fichier:Weapon.jpg|center|130px|link=Catégorie:Armement]]
 
|style="border-color: black; height:170px; width:170px;" |[[Fichier:Armure logo.png|130px|center|link=Armures]]
 
|style="border-color: black; height:170px; width:170px;" |[[Fichier:Poison logo.jpg|center|130px|link=Catégorie:Poisons, Drogues et Élixirs]]
 
|style="border-color: black; height:170px; width:170px; border-style: solid; border-width: 1px 3px 1px 1px;" |[[Fichier:Marine.jpg|center|130px|link=Catégorie:Forces Navales]]
 
|style="border-color: black; height:170px; width:170px;" |[[Fichier:Gardienvérité.png|center|130px|link=Catégorie:Histoire du Monde]]
 
|style="border-color: black; height:170px; width:170px;" |[[Fichier:Batailles.jpg|center|130px|link=Catégorie:Batailles du Vieux Monde]]
 
|style="border-color: black; height:170px; width:170px;" |[[Fichier:Chrono.jpg|center|130px|link=Catégorie:Chronologie Générale]]
 
 
|-
 
|-
|style="border-color: black; background:#303030; height:43px; border-style: solid; border-width: 1px 1px 3px 1px;" align=center|[[:Catégorie:Armement|L’Armement]]
+
! En-tête 1 !! En-tête 2 !! En-tête 3
|style="border-color: black; background:#303030; height:43px; border-style: solid; border-width: 1px 1px 3px 1px;" align=center|[[Armures|Les Armures]]
 
|style="border-color: black; background:#303030; height:43px; border-style: solid; border-width: 1px 1px 3px 1px;" align=center|[[:Catégorie:Poisons, Drogues et Élixirs|Poisons, Drogues<br />et Élixirs]]
 
|style="border-color: black; background:#303030; height:43px; border-style: solid; border-width: 1px 3px 3px 1px;" align=center|[[:Catégorie:Forces Navales|Les Différentes<br />Forces Navales]]
 
|style="border-color: black; background:#303030; height:43px; border-style: solid; border-width: 1px 1px 3px 1px;" align=center|[[:Catégorie:Histoire du Monde|L’Histoire]]
 
|style="border-color: black; background:#303030; height:43px; border-style: solid; border-width: 1px 1px 3px 1px;" align=center|[[:Catégorie:Batailles du Vieux Monde|Les Batailles du<br />Vieux Monde]]
 
|style="border-color: black; background:#303030; height:43px; border-style: solid; border-width: 1px 1px 3px 1px;" align=center|[[:Catégorie:Chronologie Générale|Chronologies]]
 
 
|-
 
|-
|colspan=7 style="border-color: black; text-align:center;background:#656565; height:43px;" | <big>'''Les Autres [[:Catégories|Catégories]]'''</big>
+
| A1 || A2 || A3
 
|-
 
|-
|style="border-color: black; height:170px; width:170px;" |[[Fichier:Mercenaire logo.jpg|center|link=Catégorie:Mercenaires]]
+
| B1 || B2 || B3
|style="border-color: black; height:170px; width:170px;" |[[Image:Sigmar Icon.png|center|130px|link=Catégorie:Dieux et Déesses]]
 
|style="border-color: black; height:170px; width:170px;" |[[Image:Personnages.jpg|center|130px|link=Catégorie:Personnages du Monde de Warhammer]]
 
|style="border-color: black; height:170px; width:170px;" |[[Image:windsofmagic.png|center|130px|link=Catégorie:Magie]]
 
|style="border-color: black; height:170px; width:170px;" |[[Fichier:Armées.jpg|center|130px|link=Catégorie:Listes d'Armées]]
 
|style="border-color: black; height:170px; width:170px;" |[[Fichier:Armement.jpg|130px|center|link=Catégorie:Les Carrières]]
 
|style="border-color: black; height:170px; width:170px;" |[[Fichier:Dice.jpg|center|130px|link=Le Jeu de Rôle]]
 
 
|-
 
|-
|style="border-color: black; background:#303030; height:43px;" align=center|[[:Catégorie:Mercenaires|Les Mercenaires]]
+
| C1 || C2 || C3
|style="border-color: black; background:#303030; height:43px;" align=center|[[:Catégorie:Dieux et Déesses|Dieux et Déesses]]
 
|style="border-color: black; background:#303030; height:43px;" align=center|[[:Catégorie:Personnages du Monde de Warhammer|Personnages]]
 
|style="border-color: black; background:#303030; height:43px;" align=center|[[:Catégorie:Magie|La Magie]]
 
|style="border-color: black; background:#303030; height:43px;" align=center|[[:Catégorie:Listes d'Armées|Les Listes d’Armées]]
 
|style="border-color: black; background:#303030; height:43px;" align=center|[[:Catégorie:Les Carrières|Les Carrières]]
 
|style="border-color: black; background:#303030; height:43px;" align=center|[[Le Jeu de Rôle|Le JdR]]
 
 
|}
 
|}
 +
</pre>
 +
 +
 +
===Code HTML équivalent avec classe associée===
 +
 +
<pre>
 +
 +
<table class="wikitable">
 +
    <tr>
 +
        <th> En-tête 1 </th>
 +
        <th> En-tête 2 </th>
 +
        <th> En-tête 3 </th>
 +
    </tr>
 +
    <tr>
 +
        <td> A1 </td>
 +
        <td> A2 </td>
 +
        <td> A3 </td>
 +
    </tr>
 +
    <tr>
 +
        <td> B1 </td>
 +
        <td> B2 </td>
 +
        <td> B3 </td>
 +
    </tr>
 +
    <tr>
 +
        <td> C1 </td>
 +
        <td> C2 </td>
 +
        <td> C3 </td>
 +
    </tr>
 +
</table>
 +
 +
</pre>
 +
 +
 +
===Règles CSS des tables de classe "wikitable"===
 +
 +
Voici les règles CSS définit sur le serveur du wiki.
 +
 +
<pre>
 +
 +
table.wikitable {
 +
    background-color: #f8f9fa;
 +
    color: #222;
 +
    margin: 1em 0;
 +
    border: 1px solid #a2a9b1;
 +
    border-collapse: collapse;
 +
}
 +
 +
table.wikitable > tr > th {
 +
    background-color: #eaecf0;
 +
    text-align: center;
 +
}
 +
table.wikitable > tr > th,
 +
table.wikitable > tr > td {
 +
    border: 1px solid #a2a9b1;
 +
    padding: 0.2em 0.4em;
 +
}
 +
 +
</pre>
 +
 +
 +
A SUIVRE ...

Version actuelle datée du 29 novembre 2023 à 19:49

HTML[modifier]

Documentation de référence : https://developer.mozilla.org/fr/docs/Web/HTML/Element


Le langage HTML permet de décrire le contenu d'une page web.

  • Le code HTML s'écrit par balises qui vont s'imbriquer les unes dans les autres.
  • Chaque balise définit la nature du contenu. Quelques exemples :
    • <p>...</p> : paragraphe
    • <a>...</a> : un lien internet
    • <table>...</table> : une table
    • <ul>...</ul> : une liste
    • <li>...</li> : un élément d'une liste
    • <div>...</div> : un conteneur générique en bloc (prend par défaut toute la largeur de son contenant)
    • <span>...</span> : un conteneur générique en ligne ( prend juste la place nécessaire)
  • A chaque balise on peut définir des attributs. Les attributs sont divers, mais chacun défini une informations associé à la balise en question. Par exemple, l'attribut href permet de définir l'adresse d'un lien d'une balise <a>. Nous verrons plus loin que les attributs style et class permettront d'associer des règles CSS au contenu HTML.

Exemple:


<div>
   <p>Mon premier paragraphe.</p>
   <p>Deuxième paragrapge.</p>
   <p>Voici quelques liens 
      <ul>
         <li><a href="https://omnis-bibliotheca.com/">lien vers l'Omnis Bibliotheca<a></li>
         <li><a href="https://bibliotheque-imperiale.com/">lien vers la Bibliothèque Impériale<a></li>
      </ul>
   </p>
</div>

N.B: Il est possible d'intégrer du code HTML directement dans une page wiki. Dans l'exemple ci-dessus, le code HTML a été indenté (aéré) pour plus de lisibilité, cependant dans une page wiki il ne faudra pas mettre d'espaces vides en début de ligne, car cela a une signification bien précise dans la syntaxe wiki, ce qui emêchera le code HTML d'être reconnu comme tel.

CSS[modifier]

Documentation de référence : Documentation de référence: https://developer.mozilla.org/fr/docs/Web/CSS


Le CSS permet de définir des règles d'affichage du contenu HTML. C'est au navigateur web de procéder au rendu graphique (d'où le problème entre les différents navigateurs qui ont parfois des comportement un peu différents sur certaines règles CSS).

  • Le code HTML peut intégrer lui-même directement du code CSS à appliquer pour une balise, via l'attibut style.
  • Une autre manière (plus structurée) d'appliquer du CSS, c'est de définir des règles CSS. Chaque règle commence par indiquer sa cible dans le HTML, puis le code CSS à lui appliquer. Dans un wiki, les Admins du site peuvent définir des règles CSS du site dans une page consacré : MediaWiki:Common.css.
    • Une manière d'invoquer des règles CSS depuis le HTML, est de définir un ou plusieurs nom de classe via l'attribut class. Ces nom de classe pourront être utiliser pour définir les cibles des règles CSS.


Exemple: Voici une règle ciblant toutes les tables de classe custom-table, indiquant de leur appliquer un background rouge et de colorer le texte en bleu.

Règle CSS :
table.custom {
   background: red;
   color: blue;
}
HTML cible :
<table class="custom-table">
...
</table>
Code wiki cible :
{| class="custom-table"
...
|}


N.B: Il existe l'extension wiki Extension:CSS à installer sur le serveur d'un wiki, permettant de définir des règles CSS directement dans la page d'un wiki, sans passer par la page MediaWiki:Common.css.

Applications[modifier]

Table simple[modifier]

Voici un exemple de codage d'une table simple.

En-tête 1 En-tête 2 En-tête 3
A1 A2 A3
B1 B2 B3
C1 C2 C3


Code wiki[modifier]

Documentation : https://www.mediawiki.org/wiki/Help:Tables/fr

{|
|-
! En-tête 1 !! En-tête 2 !! En-tête 3
|-
| A1 || A2 || A3
|-
| B1 || B2 || B3
|-
| C1 || C2 || C3
|}


Code HTML équivalent[modifier]


<table>
    <tr>
        <th> En-tête 1 </th>
        <th> En-tête 2 </th>
        <th> En-tête 3 </th>
    </tr>
    <tr>
        <td> A1 </td>
        <td> A2 </td>
        <td> A3 </td>
    </tr>
    <tr>
        <td> B1 </td>
        <td> B2 </td>
        <td> B3 </td>
    </tr>
    <tr>
        <td> C1 </td>
        <td> C2 </td>
        <td> C3 </td>
    </tr>
</table>


Table avec code CSS[modifier]

Voici un exemple de codage d'une table avec code CSS.

En-tête 1 En-tête 2 En-tête 3
A1 A2 A3
B1 B2 B3
C1 C2 C3


Code wiki avec code CSS[modifier]

Documentation : https://www.mediawiki.org/wiki/Help:Tables/fr

{| style="background: white; color: blue; text-align: center; width: 350px; border: 4px solid green;"
|-
! En-tête 1 !! En-tête 2 !! En-tête 3
|- 
| A1 || A2 || A3
|- style="font-style: italic; color: green;"
| B1 || B2 || B3
|- style="font-weight: bold; color: red;"
| style="background: lightgrey;" | C1
| style="background: grey;" | C2
| style="background: teal;" | C3
|}


Code HTML équivalent avec code CSS[modifier]


<table style="background: white; color: blue; text-align: center; width: 350px; border: 4px solid green;">
    <tr>
        <th> En-tête 1 </th>
        <th> En-tête 2 </th>
        <th> En-tête 3 </th>
    </tr>
    <tr>
        <td> A1 </td>
        <td> A2 </td>
        <td> A3 </td>
    </tr>
    <tr style="font-style: italic; color: green;">
        <td> B1 </td>
        <td> B2 </td>
        <td> B3 </td>
    </tr>
    <tr style="font-weight: bold; color: red;">
        <td style="background: lightgrey;"> C1 </td>
        <td style="background: grey;"> C2 </td>
        <td style="background: teal;"> C3 </td>
    </tr>
</table>


Table avec classe associée[modifier]

Voici un exemple de codage d'une table à laquelle il a été associé la classe "wikitable".

Ce qui n'apparait pas ici, c'est qu'il existe des régles CSS existante sur le site qui s'appliquent à toute de classe "wikitable".
En-tête 1 En-tête 2 En-tête 3
A1 A2 A3
B1 B2 B3
C1 C2 C3


Code wiki avec classe associée[modifier]

Documentation : https://www.mediawiki.org/wiki/Help:Tables/fr

{| class="wikitable"
|-
! En-tête 1 !! En-tête 2 !! En-tête 3
|-
| A1 || A2 || A3
|-
| B1 || B2 || B3
|-
| C1 || C2 || C3
|}


Code HTML équivalent avec classe associée[modifier]


<table class="wikitable">
    <tr>
        <th> En-tête 1 </th>
        <th> En-tête 2 </th>
        <th> En-tête 3 </th>
    </tr>
    <tr>
        <td> A1 </td>
        <td> A2 </td>
        <td> A3 </td>
    </tr>
    <tr>
        <td> B1 </td>
        <td> B2 </td>
        <td> B3 </td>
    </tr>
    <tr>
        <td> C1 </td>
        <td> C2 </td>
        <td> C3 </td>
    </tr>
</table>


Règles CSS des tables de classe "wikitable"[modifier]

Voici les règles CSS définit sur le serveur du wiki.


table.wikitable {
    background-color: #f8f9fa;
    color: #222;
    margin: 1em 0;
    border: 1px solid #a2a9b1;
    border-collapse: collapse;
}

table.wikitable > tr > th {
    background-color: #eaecf0;
    text-align: center;
}
table.wikitable > tr > th,
table.wikitable > tr > td {
    border: 1px solid #a2a9b1;
    padding: 0.2em 0.4em;
}


A SUIVRE ...