473,382 Members | 1,309 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,382 software developers and data experts.

Position of <p> inside <div>

938 Expert 512MB
Hi All,

I'm working on a new site that has a two column layout underneath a title bar. If you check out:
using IE or Opera you will see what I am after as these browsers work fine.

However, in FF the results are slightly different - take a look and you'll see that the <p>, within <div class="mainContent"> has shot way over to the right.

I've been working on this for 2days now and I'm getting more and more frustrated by the second.

Does anyone know why the layout would behave like this?

The code is simple:

<!-- style sheets included above this -->
<div class="pageContainer">
<b class="rtop"><b class="r1"></b><b class="r2"></b><b class="r3"></b><b class="r4"></b></b>
<div class="topBannerContainer"></div>
<div class="leftSideBar">
This will contain the menus.
The menu displayed here will be dependant on the user profile.
<div class="mainContent">
This will contain the controls that allow the data to be created, viewed and edited. The data being manipulated is determined by the menu item selected.

Expand|Select|Wrap|Line Numbers
  1. /* General Document Format */ 
  2. html, body, ul, ol, li, p, blockquote, q,
  3. h1, h2, h3, h4, h5, h6, fieldset, legend,
  4. form, label, a, div, img, dd, dt, dl, input, span, img
  5. {
  6.     margin                : 0px;
  7.     padding                : 0px;
  8.     border                : 0px;
  9. }
  11. body
  12. {    
  13.     font-family            : verdana, "trebuchet MS", helvetica, sans-serif;
  14.     font-size            : 11px; 
  15.     line-height            : 1.637; 
  16.     margin                : 0px 0px;
  17.     padding                : 0px;
  18.     height                : 100%;    
  19.     text-align            : center ; 
  20. }                            
  22. /* Containers */
  23. div.pageContainer                         
  24. {
  25.     width                : 765px ;
  26.     margin-left            : auto ;
  27.     margin-right        : auto ;
  28.     margin-top            : 15px ;   
  29.     overflow            : auto ;
  30. }
  32.     div.topBannerContainer
  33.     {
  34.         position            : relative ;
  35.         margin-left            : 0px ;
  36.         margin-right        : 0px ;
  37.         width                : 765px ;
  38.         height                : 125px ;
  39.         background-image    : url("../image/ResponseTrackerLogo.png") ;
  40.         background-repeat    : no-repeat ;    
  41.     }
  43.     div.leftSideBar
  44.     {
  45.         position            : relative ; 
  46.         float                : left ;
  47.         margin-left            : 0px ;
  48.         margin-right        : 0px ;    
  49.         padding                : 0px ;
  50.         left                : 2px ;     
  51.         width                : 180px ;
  52.         text-align            : left ; 
  53.         border                : solid 1px ;
  54.     }
  56.         div.leftSideBar p
  57.         {
  58.             padding                : 0px ;
  59.             margin                : 0px 2px 5px 2px ;
  60.         }
  62.     div.mainContent
  63.     {                               
  64.         position            : relative ;
  65.         margin-left            : 0px ;
  66.         margin-right        : 0px ;      
  67.         padding             : 0px ;
  68.         left                : 200px ;
  69.         width                : 560px ;
  70.         text-align            : left ; 
  71.         border                : solid 1px ;         
  72.     }
  74.         div.mainContent p
  75.         {
  76.             padding                : 0px ;
  77.             margin                : 0px 5px 7px 2px ;
  78.             text-align            : left ;
  79.         }
All help gratefully received.

Oct 30 '07 #1
5 5239
938 Expert 512MB
Hi All,

I have resolved this issue so I thought I'd post back the solution.

On the div mainContent I removed the left: 200px and added float: right then on the div leftSideBar I added float: left and all is now well on IE, FF and O.

Oct 30 '07 #2
7,435 Expert 4TB
That gets around the issue but the problem was actually displaying a bug in IE. Your link is down so ...........
Oct 31 '07 #3
938 Expert 512MB
That gets around the issue but the problem was actually displaying a bug in IE. Your link is down so ...........
The link is now:
www.response-tracker.co.uk/mainpage.php and it's working again.

The bug in IE was also manifest in Opera as that displayed the same behaviour. The solution I have (outlined previously) works a treat.

Thanks for stopping by.
Nov 1 '07 #4
7,435 Expert 4TB
You are in 'quirks mode' and will continue to have problems until this is corrected. You cannot have anything before the doctype. This triggers the problem and all browsers will be unpredictable.

Also, you have 53 html errors.
Nov 2 '07 #5
938 Expert 512MB
You are in 'quirks mode' and will continue to have problems until this is corrected. You cannot have anything before the doctype. This triggers the problem and all browsers will be unpredictable.

Also, you have 53 html errors.
Thank you for this. The site is now fine in terms of errors and the DOCType is positioned correctly. I think you must have seen the site in the middleof some changes. Anyway as you would have been able to tell from the site it is currently in the very early stages of development.

Thank you for your input it is appreciated.
Nov 9 '07 #6

Sign in to post your reply or Sign up for a free account.

Similar topics

by: Xah Lee | last post by:
with strict HTML spec, can one have <p> tags inside table's <td> tag? also, in strict XHTML, can one have <p> tages inside <div>? Thanks. Xah xah@xahlee.org ∑ http://xahlee.org/
by: Toby Austin | last post by:
I'm trying to replace <table>s with <div>s as much as possible. However, I can't figure out how to do the following… <table> <tr> <td valign="top" width="100%">some data that will...
by: Marcus Otmarsen | last post by:
Ok, the situation is as follows: I defined a <DIV> like: <div id="myid" style="position: absolute; height: 10; width: 10;"><img src="images/object.gif" height=10 width=10></div> This pane is...
by: Julia Briggs | last post by:
How do I construct a <iframe> or equivalent for FireFox/NS browsers, inside a screen centered <div> tag? Can it be done?
by: Josef K. | last post by:
Asp.net generates the following html when producing RadioButton lists: <td><input id="RadioButtonList_3" type="radio" name="MyRadioButtonList" value="644"...
by: tomasio | last post by:
Dear NG-Readers, I forgot to post the URL to the html-file and the linked CSS. Here they are: html: http://tomasio.at/temp/Unterseite_Templ2.html CSS: http://tomasio.at/temp/stylesheet.css...
by: Kent Feiler | last post by:
1. Here's some html from a W3C recommendations page. <P>aaaaaaaaa<DIV>bbbbbbbbb</DIV><DIV>cccccccc<P>dddddddd</DIV> 2.Although I didn't think it would make any difference, I tried it with the...
by: Carl | last post by:
Hi all I have a javascript function that drags and drops an element (ie img) into a container (ie bordered div). The function works and returns the element and and container. My next step is to...
by: chakradhari.ashish | last post by:
Does anybody know how can I load an html page inside a <div</div> where the content gets update on the onclick even of anchor <a href=> </a>? I googled around and followed some links pointing me...
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.