Faire des marges en CSS
Dernière réponse : dans Programmation
Bonjour à tous, alors voilà, j'ai lu beaucoup de tuto sur le HTMl et le CSS.
j'ai créer un petit site pour m'entrainer, et je veux qu'il sois séparer en différence partie (comme sur cette image) >>>
<<<<
en HTML sa me pose pas problème. Mais j'aimerais le faire en css (car en HTML sa ne scrool pas verticalement et d'autre petite contraintes).
voilà mon code html
<frame name="haut" scrolling="no" src="haut.html" noresize="no">
</frame>
<frameset cols=15%,15%,60%,15%,15%>
<frame name="espace" scrolling="no" frameborder="0" src="espace.html" noresize="no">
<frame name="menu" scrolling="no" frameborder="0" src="menu.html" noresize="no">
<frame name="principal" scrolling="no" frameborder="0" src="principal.html" noresize="no">
<frame name="menu2" scrolling="no" frameborder="0" src="menu2.html" noresize="no">
<frame name="espace" scrolling="no" frameborder="0" src="espace.html" noresize="no">
</frame></frame></frame></frame></frame>
Ma question est la suivant :
Quel est le code équivalent pour arriver à se résultat en CSS ?
Merci à tous de vos réponses :=)
j'ai créer un petit site pour m'entrainer, et je veux qu'il sois séparer en différence partie (comme sur cette image) >>>
<<<<en HTML sa me pose pas problème. Mais j'aimerais le faire en css (car en HTML sa ne scrool pas verticalement et d'autre petite contraintes).
voilà mon code html
Citation :
<frameset rows=20%,80%><frame name="haut" scrolling="no" src="haut.html" noresize="no">
</frame>
<frameset cols=15%,15%,60%,15%,15%>
<frame name="espace" scrolling="no" frameborder="0" src="espace.html" noresize="no">
<frame name="menu" scrolling="no" frameborder="0" src="menu.html" noresize="no">
<frame name="principal" scrolling="no" frameborder="0" src="principal.html" noresize="no">
<frame name="menu2" scrolling="no" frameborder="0" src="menu2.html" noresize="no">
<frame name="espace" scrolling="no" frameborder="0" src="espace.html" noresize="no">
</frame></frame></frame></frame></frame>
Ma question est la suivant :
Quel est le code équivalent pour arriver à se résultat en CSS ?
Merci à tous de vos réponses :=)
Autres pages sur : marges css
Lassé par la pub ? Créez un compte
Salut,
Tu n'as pas dû lire les bons vu ton code html.
Pourquoi tu utilises des frames?
Si tu veux faire comme l'image, c'est à dire :
- bannière
- menu gauche
- corps
Utilises des div dans ta page html et des flottants dans ton css.
Page html:
Page css:
Je te laisse continuez le CSS, faut apprendre par soit même, si tu veux des bon tutoriels regarde ici: http://www.siteduzero.com
Citation :
beaucoup de tuto sur le HTMl et le CSS.Tu n'as pas dû lire les bons vu ton code html.
Pourquoi tu utilises des frames?
Si tu veux faire comme l'image, c'est à dire :
- bannière
- menu gauche
- corps
Utilises des div dans ta page html et des flottants dans ton css.
Page html:
<div id="global">
<div id="banniere"></div>
<div id="menu_gauche">
<ul>
<li><a href="#">Lien 1</a></li>
<li><a href="#">Lien 2</a></li>
<li><a href="#">Lien 3</a></li>
<li><a href="#">Lien 4</a></li>
</ul>
</div>
<div id="corps">
<p>Texte</p>
</div>
</div>
Page css:
/* global */
/* banniere */
/* menu gauche */
div#menu_gauche{
float:left;
height:auto;
width:200px;
border:1px solid black;}
div#menu_gauche a{
font-size:12px;
color:black;
text-decoration:none;
padding:5px;}
div#menu_gauche a:hover{
color:white;
text-decoration:underline;}
/* corps */
Je te laisse continuez le CSS, faut apprendre par soit même, si tu veux des bon tutoriels regarde ici: http://www.siteduzero.com
Merci de ta réponses
Maintenent, j'avance bien, mais je suis blocker à un passages : Voilà mon nouveau "index.html"
<head>
<title> Création site web</title>
<div id="global">
<div id="banniere"></div>
<img src="image/ban.jpg">
</div>
<div id="menu1">
<a href="news.html" target="principal"><img src="image/bouton.jpg">
<a href="news.html" target="principal"><img src="image/bouton.jpg">
<a href="news.html" target="principal"><img src="image/bouton.jpg">
<a href="news.html" target="principal"><img src="image/bouton.jpg">
<a href="news.html" target="principal"><img src="image/bouton.jpg">
<a href="news.html" target="principal"><img src="image/bouton.jpg">
<a href="news.html" target="principal"><img src="image/bouton.jpg">
<a href="news.html" target="principal"><img src="image/bouton.jpg">
</div>
<div id="principal">
<text> Salut </text>
<a href="principal.html">
</div>
<style type="text/css">
#banniere {
float:top;
width: 100%;
height: 20%;
}
#menu1 {
position:absolute; left: 10%; top: 30%;
float:left;
width: 10%;
height: auto;
background-color: #000000;
}
#principal {
possition: absolute; left: 20%; top: 30%;
float: left;
witdh: 60%;
height: auto;
}
</style>
</head>
<body>
</body>
</html>
les problèmes sont que :
1/ Le cadre "principal" ne s'affiche pas après le menu mais au desus du menu.
2/ Quand je clic sur un bouton du menu, une nouvelle fenêtre s'ouvre, et ne s'affiche pas dans le cadre principal comme je le voudrais, pourtent il me semble avoir tout bien fait (nomer target="principal")
Merci à toi pour tes réponses :=)
Maintenent, j'avance bien, mais je suis blocker à un passages : Voilà mon nouveau "index.html"
Citation :
<html><head>
<title> Création site web</title>
<div id="global">
<div id="banniere"></div>
<img src="image/ban.jpg">
</div>
<div id="menu1">
<a href="news.html" target="principal"><img src="image/bouton.jpg">
<a href="news.html" target="principal"><img src="image/bouton.jpg">
<a href="news.html" target="principal"><img src="image/bouton.jpg">
<a href="news.html" target="principal"><img src="image/bouton.jpg">
<a href="news.html" target="principal"><img src="image/bouton.jpg">
<a href="news.html" target="principal"><img src="image/bouton.jpg">
<a href="news.html" target="principal"><img src="image/bouton.jpg">
<a href="news.html" target="principal"><img src="image/bouton.jpg">
</div>
<div id="principal">
<text> Salut </text>
<a href="principal.html">
</div>
<style type="text/css">
#banniere {
float:top;
width: 100%;
height: 20%;
}
#menu1 {
position:absolute; left: 10%; top: 30%;
float:left;
width: 10%;
height: auto;
background-color: #000000;
}
#principal {
possition: absolute; left: 20%; top: 30%;
float: left;
witdh: 60%;
height: auto;
}
</style>
</head>
<body>
</body>
</html>
les problèmes sont que :
1/ Le cadre "principal" ne s'affiche pas après le menu mais au desus du menu.
2/ Quand je clic sur un bouton du menu, une nouvelle fenêtre s'ouvre, et ne s'affiche pas dans le cadre principal comme je le voudrais, pourtent il me semble avoir tout bien fait (nomer target="principal")
Merci à toi pour tes réponses :=)
bonjour
tu peux t'inspirer de ça...
Tes div ne doivent pas se trouver dans le head mais dans le body.
tu peux aussi mettre ton css dans un fichier spécifique et l'intégrer par un link.
++
tu peux t'inspirer de ça...
Tes div ne doivent pas se trouver dans le head mais dans le body.
tu peux aussi mettre ton css dans un fichier spécifique et l'intégrer par un link.
++
pour l'instant, fait dans la simplicité...
remets ton style dans le head... tu pourras toujours le placer dans un fichier séparé par la suite...
si tu veux qu'en cliquant sur tes liens tu "restes" sur la même page, tu le fais en ajax, sinon, tu recharges la page et tu te fais un "pseudo-moteur" dans ton index... oublies le target dans <a href="news.html" target="principal">
pour le "moteur", tu peux faire un truc du genre <a href="index.php?page=news">
couplé à un switch sur la page pour faire un include $page .'.html'); ou en testant la valeur du GET et si existant...
je sais pas si je suis clair...
Ou alors, tu attends d'autres infos des idnautes
remets ton style dans le head... tu pourras toujours le placer dans un fichier séparé par la suite...
si tu veux qu'en cliquant sur tes liens tu "restes" sur la même page, tu le fais en ajax, sinon, tu recharges la page et tu te fais un "pseudo-moteur" dans ton index... oublies le target dans <a href="news.html" target="principal">
pour le "moteur", tu peux faire un truc du genre <a href="index.php?page=news">
couplé à un switch sur la page pour faire un include $page .'.html'); ou en testant la valeur du GET et si existant...
je sais pas si je suis clair...
Ou alors, tu attends d'autres infos des idnautes
Enfet, mon problème le plus grand est surtout que le cadre central de ma page n'affiche pas au centre mais audesus du menu à gauche...
j'ai changer les codes, j'ai tenter pas mal de truc mais rien à y refaire.
Une petit idée ?
(voici les code :
dans ma page INDEX.HTML
<head> <title> Création site web</title>
<link rel="stylesheet" type="text/css" href="style.css" />
</head>
<body>
<div id="global">
<div id="banniere"></div>
<img src="image/ban.jpg">
</div>
<div id="menu1">
<a href="news.html" target="principal"><img src="image/bouton.jpg">
<a href="news.html" target="principal"><img src="image/bouton.jpg">
<a href="news.html" target="principal"><img src="image/bouton.jpg">
<a href="news.html" target="principal"><img src="image/bouton.jpg">
<a href="news.html" target="principal"><img src="image/bouton.jpg">
<a href="news.html" target="principal"><img src="image/bouton.jpg">
<a href="news.html" target="principal"><img src="image/bouton.jpg">
<a href="news.html" target="principal"><img src="image/bouton.jpg">
</div>
<div id="principal">
<a href="principal.html">
</div>
<div id="menu2">
<a href="news.html" target="principal"><img src="image/bouton.jpg">
<a href="news.html" target="principal"><img src="image/bouton.jpg">
<a href="news.html" target="principal"><img src="image/bouton.jpg">
<a href="news.html" target="principal"><img src="image/bouton.jpg">
<a href="news.html" target="principal"><img src="image/bouton.jpg">
<a href="news.html" target="principal"><img src="image/bouton.jpg">
<a href="news.html" target="principal"><img src="image/bouton.jpg">
<a href="news.html" target="principal"><img src="image/bouton.jpg">
</div>
</body>
</html>
dans ma page STYLE.CSS :
#banniere {
float:top;
width: 100%;
height: 20%;
}
#menu1 {
position:absolute; left: 10%; top: 30%;
float:left;
width: 10%;
height: auto;
background-color: #000000;
}
}
#principal {
possition: absolute; left: 20%; top: 30%;
float: left;
witdh: 60%;
height: auto;
}
#menu2 {
position:absolute; left: 80%; top: 30%;
float:left;
width: 10%;
height: auto;
background-color: #000000;
}
</style>
html (dans index.html)
C'est comme si il igniorai mes lignes :
<a href="principal.html">
</div>
CSS (dans style.css)
possition: absolute; left: 20%; top: 30%;
float: left;
witdh: 60%;
height: auto;
}
j'ai changer les codes, j'ai tenter pas mal de truc mais rien à y refaire.
Une petit idée ?
(voici les code :
dans ma page INDEX.HTML
Citation :
<html><head> <title> Création site web</title>
<link rel="stylesheet" type="text/css" href="style.css" />
</head>
<body>
<div id="global">
<div id="banniere"></div>
<img src="image/ban.jpg">
</div>
<div id="menu1">
<a href="news.html" target="principal"><img src="image/bouton.jpg">
<a href="news.html" target="principal"><img src="image/bouton.jpg">
<a href="news.html" target="principal"><img src="image/bouton.jpg">
<a href="news.html" target="principal"><img src="image/bouton.jpg">
<a href="news.html" target="principal"><img src="image/bouton.jpg">
<a href="news.html" target="principal"><img src="image/bouton.jpg">
<a href="news.html" target="principal"><img src="image/bouton.jpg">
<a href="news.html" target="principal"><img src="image/bouton.jpg">
</div>
<div id="principal">
<a href="principal.html">
</div>
<div id="menu2">
<a href="news.html" target="principal"><img src="image/bouton.jpg">
<a href="news.html" target="principal"><img src="image/bouton.jpg">
<a href="news.html" target="principal"><img src="image/bouton.jpg">
<a href="news.html" target="principal"><img src="image/bouton.jpg">
<a href="news.html" target="principal"><img src="image/bouton.jpg">
<a href="news.html" target="principal"><img src="image/bouton.jpg">
<a href="news.html" target="principal"><img src="image/bouton.jpg">
<a href="news.html" target="principal"><img src="image/bouton.jpg">
</div>
</body>
</html>
dans ma page STYLE.CSS :
Citation :
<style type="text/css">#banniere {
float:top;
width: 100%;
height: 20%;
}
#menu1 {
position:absolute; left: 10%; top: 30%;
float:left;
width: 10%;
height: auto;
background-color: #000000;
}
}
#principal {
possition: absolute; left: 20%; top: 30%;
float: left;
witdh: 60%;
height: auto;
}
#menu2 {
position:absolute; left: 80%; top: 30%;
float:left;
width: 10%;
height: auto;
background-color: #000000;
}
</style>
html (dans index.html)
C'est comme si il igniorai mes lignes :
Citation :
<div id="principal"><a href="principal.html">
</div>
CSS (dans style.css)
Citation :
#principal {possition: absolute; left: 20%; top: 30%;
float: left;
witdh: 60%;
height: auto;
}
J'ai fait les modifications, et tu as corriger un beug que j'avais :
La banniére s'affiche en css depuis que j'ai retirer : <style type="text/css"></style> de ma feuille de style.
Mais le problème est que le cadre du centre n'apparait toujours pas...
Et j'ai un petit soucis lors du redimentionnement de la page web la banniére ne se redimensionne pas mais est coupée? normal ? ou j'ai oublier un code (encore?)
La banniére s'affiche en css depuis que j'ai retirer : <style type="text/css"></style> de ma feuille de style.
Mais le problème est que le cadre du centre n'apparait toujours pas...
Et j'ai un petit soucis lors du redimentionnement de la page web la banniére ne se redimensionne pas mais est coupée? normal ? ou j'ai oublier un code (encore?)
Lassé par la pub ? Créez un compte
- Contenus similaires :
Tags :
- ForumComment faire des skins pour css
- ForumFaire une demo css
- ForumComment faire du bunny sur css
- ForumFaire un video css
- ForumCss plante au lancement que faire
- ForumComment faire un connect sur css
- ForumComment faire une bind sur css
- ForumCss html supprimer des marges entre images
- ForumComment faire des bind css
- ForumFaire un dégradé css
- Voir plus