text appearing outside <div> PLEASE HELP!

This is a discussion on "text appearing outside <div> PLEASE HELP!" within the Web Page Design section. This forum, and the thread "text appearing outside <div> PLEASE HELP! are both part of the Design Your Website category.



Go Back   Webforumz.com > Main Forums > Design Your Website > Web Page Design

Notices


Reply
 
LinkBack Thread Tools
  #1 (permalink)  
Old Jul 28th, 2007, 21:08
Junior Member
Join Date: Apr 2007
Location: England
Posts: 22
Thanks: 0
Thanked 0 Times in 0 Posts
text appearing outside <div> PLEASE HELP!

Dear all,

a particular problem has been bugging me for a while, and I was wondering if anyone could provide a solution. I have been trying to set a box of one colour against a background of another, and put text or navigation inside the box (created using a div with an external css sheet) However the div (say it is a white box against a black background) appears fine, yet the text contained inside it appears to drop down below the div, and appear instead against the {body} -Here is the html
Code: Select all
<div id="navigation"> 
    <p>Text goes here inside div and yet appears when previed below div (preview in firefox)</p>
</div>
Here is the CSS:
Code: Select all
#navigation{
    left:0px;
    position:absolute;
    background-color:#FFFF00;
    border-color:#FFFFFF;
    border-width:5px;
    border:double;
    width:100%;
    height: 31px;
    top: 173px;
    font-size:24px;
    text-align:center;
}
Could anyone offer advice as to how to make the text appear inside the div in firefox. My IE is not working so I can't test in that.



Thanks,

Toby Mather
Reply With Quote

  #2 (permalink)  
Old Jul 28th, 2007, 21:23
SuperMember

SuperMember
Join Date: Sep 2006
Location: Pink House
Posts: 3,946
Thanks: 0
Thanked 0 Times in 0 Posts
Re: text appearing outside <div> PLEASE HELP!

Hi Toby:
That was a really good question. I played and played and played with all sorts of varieties of code and ended up with exactly what you had except I added this to the css

Code: Select all
*
{
margin: 0;
padding: 0;
}
This called the Universal Reset or Global Reset. It sets all the margins and paddings to zero. This fixed the issue, so I'm assuming there was some margins or paddings pushing your text down.
Reply With Quote
  #3 (permalink)  
Old Jul 28th, 2007, 22:14
Junior Member
Join Date: Apr 2007
Location: England
Posts: 22
Thanks: 0
Thanked 0 Times in 0 Posts
Re: text appearing outside <div> PLEASE HELP!

I played and played as well, and struck on something really simple: Remove the <p> tags, and the text goes back to normal. The idea of a new paragraph was pushing it down I guess.

I'll add yours as an extra measure. Thanks.
Reply With Quote
  #4 (permalink)  
Old Jul 29th, 2007, 00:21
SuperMember

SuperMember
Join Date: Sep 2006
Location: Pink House
Posts: 3,946
Thanks: 0
Thanked 0 Times in 0 Posts
Re: text appearing outside <div> PLEASE HELP!

I always feel text should be defined though. I'd leave the <p> tags.
Reply With Quote
  #5 (permalink)  
Old Jul 29th, 2007, 00:25
SuperMember

SuperMember
Join Date: May 2006
Location: North West, UK
Age: 21
Posts: 1,173
Thanks: 0
Thanked 0 Times in 0 Posts
Re: text appearing outside <div> PLEASE HELP!

Yeah, you should leave the p tags in. Otherwise the text will be floating in nothingness, which is never good.

Pete.
Reply With Quote
  #6 (permalink)  
Old Jul 29th, 2007, 00:31
SuperMember

SuperMember
Join Date: Sep 2006
Location: Pink House
Posts: 3,946
Thanks: 0
Thanked 0 Times in 0 Posts
Re: text appearing outside <div> PLEASE HELP!

"Nothingness" is not good!
Reply With Quote
Reply

Tags
css, div, text

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Similar Threads
Thread Thread Starter Forum Replies Last Post
more margin appearing in IE than FFox monkeymafia Web Page Design 3 Mar 18th, 2008 14:24
Graphics Not Appearing teranceh Web Page Design 5 Sep 24th, 2007 15:00
Frame appearing around Hotspot JennyChaos Starting Out 1 Jul 7th, 2007 00:45
mystery non-appearing image jessixcate Graphics and 3D 1 Apr 14th, 2007 02:48
My URL icon isn't appearing. Waa, waa, waa! timmytots Web Page Design 10 Nov 13th, 2005 23:54


All times are GMT. The time now is 21:55.


Powered by vBulletin®
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.2.0 RC8
© 2003-2008 Webforumz.com : All Rights Reserved

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