Ich habe zur Zeit eine zwei-Spalten-Div bei 50% jedes Div erstellt. Ich versuche herauszufinden, wie man das linke Div 70% und das richtige Div 30% macht.Wie stelle ich die prozentualen Breiten meiner zwei Spalten div ein?
Auch, zusätzlich zu den 2 Spalten Divs. Wenn ich eine 4 Spalten Divs von jeweils 25% und eine fünf Spalten Div von jeweils 20% erstellen wollte. Wie würde ich das tun?
Hier ist meine jsfiddle: http://jsfiddle.net/huskydawgs/zhckr47h/3/
Hier ist mein HTML:
<div class="container-2col">
<div class="container-1col">
<div class="col1">
<p>Delicious and crunchy, apple fruit is one of the most popular and favorite fruits among the health conscious, fitness lovers who firmly believe in the concept of “health is wealth.” This wonderful fruit is packed with rich phyto-nutrients that, in the true sense, indispensable for optimal health. Certain antioxidants in apple have several health promoting and disease prevention properties, and thereby, truly justifying the adage, “an apple a day keeps the doctor away.”</p>
</div>
<div class="col2">
<p>Vegetables, like fruits, are low in calories and fats but contain good amounts of vitamins and minerals. All the Green-Yellow-Orange vegetables are rich sources of calcium, magnesium, potassium, iron, beta-carotene, vitamin B-complex, vitamin-C, vitamin-A, and vitamin K.</p>
</div>
</div>
</div>
Here's my CSS:
.container-2col {
clear: left;
float: left;
width: 100%;
overflow: hidden;
background: none;
}
.container-1col {
float: left;
width: 100%;
position: relative;
right: 50%;
background: none;
}
.col1 {
float: left;
width: 46%;
position: relative;
left: 52%;
overflow: hidden;
}
.col2 {
float: left;
width: 46%;
position: relative;
left: 56%;
overflow: hidden;
}
Nicht sicher folgen ich, aber was '.col' Breite auf 64% und' .col2' Breite auf 28% zu ändern? Wie [dies] (http://jsfiddle.net/zhckr47h/4/)? Da links und rechts derzeit jeweils 46% sind, dann sind die 64% und 28% die gleiche Summe (92%), haben aber eine Bilanz von 70:30 statt 50:50. – lurker
"Wenn ich eine 4 Spalten Divs von jeweils 25% und eine Fünf Spalte Div von jeweils 20% erstellen wollte. Wie würde ich das tun?" - das ist unmöglich, es ist ein 120% der Breite :) – AleshaOleg
70% und 30% innerhalb der 100% -Tag – user3075987