Comment modifier la largeur d'une colonne?

Le premier forum francophone sur l'éditeur de pages Web multiplateforme (Linux, Mac OS X, Windows) qui monte… KompoZer, héritier de Nvu, permet de créer vos pages Web graphiquement (wysiwyg) sans aucune connaissance du langage HTML.

Modérateur : chinon37

Cyclo
Arias
Messages : 3
Inscription : 07 mars 2009, 04:29

Comment modifier la largeur d'une colonne?

Message par Cyclo »

Bonjour,

J'ai téléchargé un modèle avec trois colonnes (fluide, fixe, fluide)
Je voudrais diminuer la largeur de la colonne de gauche.
Est-ce bien complexe?
Voici le code :

Code : Tout sélectionner

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" lang="en" xml:lang="en">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<title>Dynamic Drive: CSS Liquid Layout #3.8- (Fluid-Fluid-Fixed)</title>
<style type="text/css">

body{
margin:0;
padding:0;
line-height: 1.5em;
}

b{font-size: 110%;}
em{color: red;}

#topsection{
background: #EAEAEA;
height: 90px; /*Height of top section*/
}

#topsection h1{
margin: 0;
padding-top: 15px;
}

#columnwrapper{
float: left;
width: 100%;
margin-left: -65%; /*Set left margin to -(contentcolumnWidth)*/
}

#leftcolumn{
margin: 0 180px 0 65%; /*Set margin to 0 (rightcolumnWidth) 0 (contentcolumnWidth)*/
background: #C8FC98;
}

#rightcolumn{
float: left;
width: 180px; /*Width of right column*/
margin-left: -180px; /*Set left margin to -(RightColumnWidth)*/
background: #FDE95E;
}

#contentcolumn{
float: left;
width: 65%; /*Width of content column*/
}

#footer{
clear: left;
width: 100%;
background: black;
color: #FFF;
text-align: center;
padding: 4px 0;
}

#footer a{
color: #FFFF80;
}

.innertube{
margin: 10px; /*Margins for inner DIV inside each column (to provide padding)*/
margin-top: 0;
}

</style>

<script type="text/javascript">
/*** Temporary text filler function. Remove when deploying template. ***/
var gibberish=["This is just some filler text", "Welcome to Dynamic Drive CSS Library", "Demo content nothing to read here"]
function filltext(words){
for (var i=0; i<words; i++)
document.write(gibberish[Math.floor(Math.random()*3)]+" ")
}
</script>

</head>
<body>
<div id="maincontainer">

<div id="topsection"><div class="innertube"><h1>CSS Liquid Layout #3.8- (Fluid-Fixed-Fluid)</h1></div></div>

<div id="columnwrapper">
<div id="leftcolumn">
<div class="innertube"><b>Left Column: <em>Fluid</em></b> <script type="text/javascript">filltext(12)</script></div>
</div>
</div>

<div id="rightcolumn">
<div class="innertube"><b>Right Column: <em>180px</em></b> <script type="text/javascript">filltext(10)</script></div>

</div>

<div id="contentcolumn">
<div class="innertube"><b>Content Column: <em>65%</em></b> <script type="text/javascript">filltext(65)</script></div>
</div>

<div id="footer"><a href="http://www.dynamicdrive.com/style/">Dynamic Drive CSS Library</a></div>

</div>
</body>
</html>
Message envoyé avec : Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.9.0.7) Gecko/2009030422 Ubuntu/8.04 (hardy) Firefox/3.0.7

[modo]amélioration de la lisibilité du code[/modo]
Ymai
Tyrannosaurus Rex
Messages : 4220
Inscription : 12 mars 2005, 11:36

Message par Ymai »

Bonjour
Je pense qu'il suffit de jouer sur

Code : Tout sélectionner

#leftcolumn {
  background: #c8fc98 none repeat scroll 0% 50%;
  float: left;
  width: 100%;
  margin-left: -75%;
}

#contentcolumn {
  float: left;
  width: 75%;
}
en changeant la valeur de margin-left pour #leftcolumn et width pour contentcolumn. La colonne de droite restant à 180px.

Message envoyé avec : Mozilla/5.0 (X11; U; Linux i686; fr; rv:1.9.0.7) Gecko/2009030422 Ubuntu/8.04 (hardy) Firefox/3.0.7
ymai
« Un enfant de cinq ans comprendrait cela ! Allez me chercher un enfant de cinq ans ! »
Groucho Marx.
Cyclo
Arias
Messages : 3
Inscription : 07 mars 2009, 04:29

Message par Cyclo »

Merci Ymai pour cette piste qui m'a permis de comprendre comment faire certaines modifications.
Mais je constate que c'est plus complexe que ce à quoi je m'attendais!
En fait, je dois vous expliquer ce que j'essaie de faire au juste.
Je veux créer un message courriel où le sommaire apparaîtra dans une colonne fixe à gauche et où les différents articles apparaîtront dans une colonne fluide à droite.
J'ai déjà trouvé un modèle (Colonne gauche fixe et colonne droite fluide) qui rempli parfaitement ces exigences (voir le code plus bas). Or, mon problème vient du fait que je veux faire en sorte que les destinataires, pour qui l'option html ne serait pas pris en charge et qui recevront le message en texte brut, obtiennent un message lisible. Or, malheureusement lorsque ce modèle est converti en texte brut, le sommaire (colonne de gauche en html) apparaît en bas, après le texte de la colonne de droite.

À cause de ce problème, j'ai cherché d'autres modèles et j'en ai trouvé un en trois colonnes (gauche fluide, centre fixe et droite fluide) (voir le code dans mon premier message) qui, une fois converti en texte brute, fait en sorte que le texte de la colonne de gauche apparaît en premier, puis celui de la colonne du centre en deuxième et finalement celui de la colonne de droite en troisième. C'est précisément dans cet ordre que je voudrais que les textes des colonne apparaisse. Mon problème avec ce deuxième modèle est qu'il y a une colonne inutile. C'est pour cette raison que je voulais savoir comment réduire la largeur de la colonne de gauche. En fait, j'aimerais la faire disparaître.
Il existe peut-être d'autre modèles qui répondraient mieux à mes exigence particulières?

Code : Tout sélectionner

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<html>
<head>
  <title>Layout 24</title>
  <meta http-equiv="content-type"
 content="text/html; charset=iso-8859-1">
  <meta name="generator" content="HAPedit 3.1">
  <style type="text/css">
html,body{margin:0;padding:0}
body{font: 76% arial,sans-serif}
p{margin:0 10px 10px}
a{display:block;color: #981793;padding:10px}
div#header h1{height:80px;line-height:80px;margin:0;
  padding-left:10px;background: #EEE;color: #79B30B}
div#content p{line-height:1.4}
div#navigation{background:#B9CAFF}
div#extra{background:#FF8539}
div#footer{background: #333;color: #FFF}
div#footer p{margin:0;padding:5px 10px}

div#wrapper{float:right;width:100%;margin-left:-200px}
div#content{margin-left:200px}
div#navigation{float:left;width:200px}
div#extra{float:left;clear:left;width:200px}
div#footer{clear:both;width:100%}
  </style>
</head>
<body style="color: rgb(0, 0, 0);" alink="#ee0000"
 link="#0000ee" vlink="#551a8b">
<div id="container">
<div style="background-color: white; height: 108px;"
 id="header">
<div style="font-weight: bold;"><big><big><big>En
tête 1</big></big></big></div>
<div style="text-align: right; height: 40px;"><big
 style="font-weight: bold;"><big
 style="color: rgb(255, 102, 0);">En tête 2 </big><br>
<span style="color: rgb(80, 143, 216);">Sous
titre&nbsp;</span></big> </div>
<div
 style="background-color: rgb(80, 143, 216); margin-top: 5px; height: 22px; color: white;"><small><span
 style="font-weight: bold;">&nbsp;5 mars 2009</span></small></div>
</div>
<div id="wrapper">
<div id="content">
<p><strong><big><big
 style="color: rgb(255, 102, 0);"><big
 style="font-weight: bold;">Titre 1</big></big></big></strong></p>
<p><strong></strong>Texte<span
 style="font-weight: bold;"></span></p>
<p><big><strong><big
 style="color: rgb(255, 102, 0);"><big
 style="font-weight: bold;">Titre 2</big></big></strong>
</big></p>
<p>Texte</p>
<p><big><strong><big
 style="color: rgb(255, 102, 0);"><big
 style="font-weight: bold;">Titre 3</big></big></strong></big></p>
<p>Texte</p>
</div>
</div>
<div style="background-color: white;" id="navigation">
<p
 style="color: white; margin-top: 0px; background-color: white; height: 8px;"><strong><span
 style="color: black;">Sommaire</span></strong></p>
<p
 style="color: white; margin-top: 0px; height: 20px; background-color: rgb(255, 102, 0);"><strong>1.
Titre&nbsp;</strong></p>
<p
 style="color: rgb(80, 143, 216); background-color: rgb(237, 237, 237);"><small><span
 style="font-weight: bold;"> </span>Texte</small></p>
<p
 style="color: white; background-color: rgb(255, 102, 0); margin-top: 0px; height: 20px;"><strong>2.
Titre</strong></p>
<p
 style="color: rgb(80, 143, 216); background-color: rgb(237, 237, 237);"><small>Texte</small></p>
<p
 style="color: white; background-color: rgb(255, 102, 0); height: 21px;"><strong>3.
Titre</strong></p>
<p style="background-color: rgb(237, 237, 237);"><small><span
 style="color: rgb(80, 143, 216);"></span></small><small><span
 style="color: rgb(80, 143, 216);">Texte</span></small><small></small></p>
</div>
<br>
<div style="text-align: center;" id="footer">
<p style="background-color: rgb(80, 143, 216);">http://www.quebecsolidaire.net/montreal</p>
</div>
</div>
</body>
</html>

Message envoyé avec : Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.9.0.7) Gecko/2009030422 Ubuntu/8.04 (hardy) Firefox/3.0.7
Répondre

Qui est en ligne ?

Utilisateurs parcourant ce forum : Aucun utilisateur inscrit et 1 invité