Question : CSS script: How do I correct 3 col <div> script so that it works in firefox, ie, etc.

I'm teaching myself css and imagine this is a simple rookie question:

I'm trying out this code for a 3 col layout. This looks great in firefox -- not so much in ie and other browsers. How can I correct this prob so it looks right in all browsers? I may only need to set all three columns to be equal (somehow).

A lot of the code is borrowed, and I've spent time "rewriting" the code over and over, and I apoligize for it being a mess.

If you can, please be specific and thorough with your solution cause i'm a beginner.

BTW: i think it has to do with my using diff styles (em vs width %).

-shelingo
Code Snippet:
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
14:
15:
16:
17:
18:
19:
20:
21:
22:
23:
24:
25:
26:
27:
28:
29:
30:
31:
32:
33:
34:
35:
36:
37:
38:
39:
40:
41:
42:
43:
44:
45:
46:
47:
48:
49:
50:
51:
52:
53:
54:
55:
56:
57:
58:
59:
60:
61:
62:
63:
64:
65:
66:
67:
68:
69:
70:
71:
72:
73:
74:
75:
76:
77:
78:
79:
80:
81:
82:
83:
84:
85:
86:
87:
88:
89:
90:
91:
92:
93:
94:
95:
96:
97:
98:
99:
100:
101:
102:
103:
104:
105:
106:
107:
108:
109:
110:
111:
112:
113:
114:
115:
116:
117:
118:
119:
120:
121:
122:
123:
124:
125:
126:
127:
128:
129:
130:
131:
132:
133:
134:
135:
136:
137:
138:
139:
140:
141:
142:
143:
144:
145:
146:
147:
148:
149:
150:
151:
152:
153:
154:
155:
156:
157:
158:
159:
160:
161:
162:
163:
164:
165:
166:
167:
168:
169:
170:
171:
172:
173:
174:
175:
176:
177:
178:
179:
180:
181:
182:
183:
184:
185:
186:
187:


 

  • Explore new possibilities
  • Discover colors easily
  • Design CSS without worries
  • Plug and run your rounded corners...
  • ...without any graphics!
  • Nifty Corners Cube™

sidebar2 Content

The background color on this div will only show for the length of the content. If you'd like a dividing line instead, place a border on the right side of the #mainContent div if the #mainContent div will always contain more content than the #sidebar2 div.

Donec eu mi sed turpis feugiat feugiat. Integer turpis arcu, pellentesque eget, cursus et, fermentum ut, sapien.

Main Content

Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Praesent aliquam, justo convallis luctus rutrum, erat nulla fermentum diam, at nonummy quam ante ac quam. Maecenas urna purus, fermentum id, molestie in, commodo porttitor, felis. Nam blandit quam ut lacus.

Quisque ornare risus quis ligula. Phasellus tristique purus a augue condimentum adipiscing. Aenean sagittis. Etiam leo pede, rhoncus venenatis, tristique in, vulputate at, odio. Donec et ipsum et sapien vehicula nonummy. Suspendisse potenti. Fusce varius urna id quam. Sed neque mi, varius eget, tincidunt nec, suscipit id, libero.

H2 level heading

Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Praesent aliquam, justo convallis luctus rutrum, erat nulla fermentum diam, at nonummy quam ante ac quam. Maecenas urna purus, fermentum id, molestie in, commodo porttitor, felis. Nam blandit quam ut lacus. Quisque ornare risus quis ligula. Phasellus tristique purus a augue condimentum adipiscing. Aenean sagittis. Etiam leo pede, rhoncus venenatis, tristique in, vulputate at, odio.


Open in New Window Select All

Answer : CSS script: How do I correct 3 col <div> script so that it works in firefox, ie, etc.

renders radically different in IE6.  I think the problem is, you are not floating the DIVs left or right, align right will only align the text, it will not position the DIV to the right, middle or left of the screen.  The pixel and em issues are minor compared to positioning the DIVs correctly.  Try to avoid absolute position if you can, use the float to align DIVs on the screen.
Random Solutions  
 
programming4us programming4us