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>

nathj
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:
http://www.christianleadership.org.u...h/mainpage.php
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:

[html]
<!-- 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">
<p>
This will contain the menus.
</p>
<p>
The menu displayed here will be dependant on the user profile.
</p>
</div>
<div class="mainContent">
<p>
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.
</p>
</div>
</div>
[/html]

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. }
  10.  
  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. }                            
  21.  
  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. }
  31.  
  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.     }
  42.  
  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.     }
  55.  
  56.         div.leftSideBar p
  57.         {
  58.             padding                : 0px ;
  59.             margin                : 0px 2px 5px 2px ;
  60.         }
  61.  
  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.     }
  73.  
  74.         div.mainContent p
  75.         {
  76.             padding                : 0px ;
  77.             margin                : 0px 5px 7px 2px ;
  78.             text-align            : left ;
  79.         }
  80.  
  81.  
All help gratefully received.

Cheers
nathj
Oct 30 '07 #1
5 5239
nathj
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.

Thanks
Nathan
Oct 30 '07 #2
drhowarddrfine
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
nathj
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.
nathj
Nov 1 '07 #4
drhowarddrfine
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
nathj
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.
nathj
Nov 9 '07 #6

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

Similar topics

1
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/
61
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...
2
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...
9
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?
3
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"...
8
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...
28
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...
1
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...
5
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...
1
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...
0
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...
0
isladogs
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...
0
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...
0
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,...
0
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...
0
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...
0
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
1
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.