...

View Full Version : Urgent! Need Helps! <center>, <float>, and <align> not working.



powertony
05-30-2012, 06:14 AM
Hi masters,
I got a html design problem about using css, float and center.

we just lunch a free online business directory site. Our users reported a problem about some web pages display not correctly. We have checked this issue and found out these problems only happen on search page , home page and directory page on our site OCEANsTown. com.

If you use normal browse size, maximum size, to view these pages. web page will display correct. When you use mobile device or change the browser size, the center web content will move to below the left nav bar or become distortion.

we use <float : left> for the left nav bar and use <center> or <div align: left> for the center web content. Do we do anything wrong?


Please help! Many thanks!!
===========================================
I just added my code below. please check it out. Thanks!

sayannayas
05-30-2012, 06:43 AM
I think the problem lies in hard-coded pixel that you have given to your center division.Try doing something like this:


<div id="main">
<table>
<tr>
<td width="20%">
left navigation
</td>
<td width="70%">
your login & search
</td>
</tr>
</table>
</div>

powertony
05-30-2012, 07:12 AM
I think the problem lies in hard-coded pixel that you have given to your center division.Try doing something like this:


<div id="main">
<table>
<tr>
<td width="20%">
left navigation
</td>
<td width="70%">
your login & search
</td>
</tr>
</table>
</div>


===========================================

first of all, I like to thank you for your quick help. Because our web page is quite complicate, we may need different solutions.:)

powertony
05-30-2012, 08:56 AM
Hi masters,
I got a html design problem about using css, float and center.

we just lunch a free online business directory site. Our users reported a problem about some web pages display not correctly. We have checked this issue and found out these problems only happen on search page , home page and directory page on our site oceanstown.com.

If you use normal browse size, maximum size, to view these pages. web page will display correct. When you use mobile device or change the browser size, the center web content will move to below the left nav bar or become distortion.

we use <float : left> for the left nav bar and use <center> or <div align: left> for the center web content. Do we do anything wrong?


Please help! Many thanks!!

the below is my code
====for left side
#l_nav-list {
float: left;
padding: 25px; padding-left:18px;
margin: auto;

width:200px;

}




<div id="l_nav-list">
<table bgcolor="#FFFFFF" width="95%" style="color: #333333;"><tr><td valign="top" align="center">




====== for center part
<div align="center" style="padding:1em; padding-right:0.8em; padding-left:1.5em; padding-top:0.5em; width:900px; margin: auto;"><div class="topicPageBanner" style="width:780px;" ><h3 class="topicPageBanner" >Top Online Business Directory</h3></div><br><div align="left" style="width:785px; ">
<br>
<table style="background-color: #e5f7df; padding:0.3em; padding-top:0.8em; padding-left:0.3em; border-style:solid; border:1; border
-width:thin; border-color:#d9f0d1; width:780px; ">

========

felgall
05-30-2012, 11:12 AM
With

<div align="center" style="padding:1em; padding-right:0.8em; padding-left:1.5em; padding-top:0.5em; width:900px; margin: auto;">

it is probably the obsolete (since 1997) align="center" that is preventing the margin:auto from centering the div.

powertony
05-31-2012, 02:12 AM
With

<div align="center" style="padding:1em; padding-right:0.8em; padding-left:1.5em; padding-top:0.5em; width:900px; margin: auto;">

it is probably the obsolete (since 1997) align="center" that is preventing the margin:auto from centering the div.

Thank you for reply.
I do not get what do you mean. Do you mean I should not use align='center'? Any suggestion?:)

Lerura
05-31-2012, 02:41 AM
Do you mean I should not use align='center'?

Exactly!
<tag align="center"></tag> and it's close equivalent <center><tag></tag></center> is the far obsolete Html ways of <tag style="margin:auto;"></tag>

Some browsers may still support the obsolete html ways, some may ignore them, while they may break the code in other browsers.

The only secure way is to use the css way.



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum