473,569 Members | 2,737 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Position of <p> inside <div>

nathj
938 Recognized Expert Contributor
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="mainCont ent"> 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="pageCont ainer">
<b class="rtop"><b class="r1"></b><b class="r2"></b><b class="r3"></b><b class="r4"></b></b>
<div class="topBanne rContainer"></div>
<div class="leftSide Bar">
<p>
This will contain the menus.
</p>
<p>
The menu displayed here will be dependant on the user profile.
</p>
</div>
<div class="mainCont ent">
<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 5249
nathj
938 Recognized Expert Contributor
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 Recognized Expert Expert
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 Recognized Expert Contributor
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 Recognized Expert Expert
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 Recognized Expert Contributor
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
3489
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
24420
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 'stretch'</td> <td valign="top" width="300">some data that won't 'stetch'</td> </tr> </table>
2
3746
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 used to move an object around on the web page by a javascript. As long as I define no further <div> pane everything works fine.
9
3133
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
3802
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" onclick="__doPostBack('SitesRadioButtonList_3','')" language="javascript" />
8
2005
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 correct display: http://tomasio.at/temp/Unterseite_Templ2a.jpg First I want to apologize for crossposting this, but I got no idea where this topic...
28
5330
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 </p>s included as well. <P>aaaaaaaaa</p><DIV>bbbbbbbbb</DIV><DIV>cccccccc<P>dddddddd</p></DIV>
1
4601
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 center the element in the container if the user is sloppy with positioning it. I can only test this on IE6 and IE5.5 and it fails. It positions the...
5
38994
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 that it is possible to use javascript combined with CSS for doing this? Any ideas? Chakra
0
7700
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main...
0
7614
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language...
0
8125
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that...
0
7974
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the...
0
5219
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert...
0
3653
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in...
0
3642
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
1221
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
938
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating...

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.