iEntry 10th Anniversary Webforumz RegistrationAnnouncements Contact Webforumz StaffContact
Home Resources Blogs Meet the Team Contact Register
 

Go Back   WebForumz.com > The Code > HTML, XHTML and CSS

Reply
 
LinkBack Thread Tools
Old July 28th, 2007, 06:08 PM   #1
New Member
 

Join Date: Apr 2007
Location: England
Posts: 22
Thanks: 0
Thanked 0 Times in 0 Posts
Rep Altering Power: 0 tobymather is on a distinguished road
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:
<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:
#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
tobymather is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
Old July 28th, 2007, 06:23 PM   #2
Elite Veteran
 

Join Date: Sep 2006
Location: Pink House
Posts: 3,941
Thanks: 0
Thanked 0 Times in 0 Posts
Rep Altering Power: 0 Lchad is a name known to all Lchad is a name known to all Lchad is a name known to all Lchad is a name known to all Lchad is a name known to all Lchad is a name known to all
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:
*
{
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.
Lchad is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
Old July 28th, 2007, 07:14 PM   #3
New Member
 

Join Date: Apr 2007
Location: England
Posts: 22
Thanks: 0
Thanked 0 Times in 0 Posts
Rep Altering Power: 0 tobymather is on a distinguished road
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.
tobymather is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
Old July 28th, 2007, 09:21 PM   #4
Elite Veteran
 

Join Date: Sep 2006
Location: Pink House
Posts: 3,941
Thanks: 0
Thanked 0 Times in 0 Posts
Rep Altering Power: 0 Lchad is a name known to all Lchad is a name known to all Lchad is a name known to all Lchad is a name known to all Lchad is a name known to all Lchad is a name known to all
Re: text appearing outside <div> PLEASE HELP!

I always feel text should be defined though. I'd leave the <p> tags.
Lchad is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
Old July 28th, 2007, 09:25 PM   #5
Most Reputable Member
 

Join Date: May 2006
Location: North West, UK
Age: 23
Posts: 1,170
Thanks: 0
Thanked 0 Times in 0 Posts
Rep Altering Power: 0 pa007 has a spectacular aura about pa007 has a spectacular aura about
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.
pa007 is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
Old July 28th, 2007, 09:31 PM   #6
Elite Veteran
 

Join Date: Sep 2006
Location: Pink House
Posts: 3,941
Thanks: 0
Thanked 0 Times in 0 Posts
Rep Altering Power: 0 Lchad is a name known to all Lchad is a name known to all Lchad is a name known to all Lchad is a name known to all Lchad is a name known to all Lchad is a name known to all
Re: text appearing outside <div> PLEASE HELP!

"Nothingness" is not good!
Lchad is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
Reply

Bookmarks

Tags
css , div , text


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
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 HTML, XHTML and CSS 3 March 18th, 2008 12:24 PM
Graphics Not Appearing teranceh HTML, XHTML and CSS 5 September 24th, 2007 12:00 PM
Frame appearing around Hotspot JennyChaos Your Design and Layout 1 July 6th, 2007 09:45 PM
mystery non-appearing image jessixcate Graphic Specifics 1 April 13th, 2007 11:48 PM
My URL icon isn't appearing. Waa, waa, waa! timmytots HTML, XHTML and CSS 10 November 13th, 2005 08:54 PM


Search Engine Optimization by vBSEO 3.2.0 RC8