Text position inside DIV element.

This is a discussion on "Text position inside DIV element." within the Web Page Design section. This forum, and the thread "Text position inside DIV element. 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 Sep 11th, 2007, 00:20
Most Reputable Member
Join Date: Feb 2004
Location: Borneo
Age: 27
Posts: 1,602
Blog Entries: 2
Thanks: 0
Thanked 4 Times in 3 Posts
Send a message via Yahoo to Monie
Text position inside DIV element.

I have a footer in my css page:

Code: Select all
#footer {
 clear: both;
 margin: auto;
 Width: 872px; 
 Height: 30px;
 padding: 0.2em 0.2em;
 border-top: 1px dotted #99C;
}
Code: Select all
 
#footer h3 {
 font: Small Verdana;
 font-size: 10px;
 text-align: center;
 padding: 0 0 5px 0;
}
The problem is, when I view this page in internet explorer (ie7), the text is not in the center of the div.
Maybe this illustrator will help me explain:

ie7:
______________
This is my footer <-- The text is on top of the div element
______________

Firefox:
______________

This is my footer <-- The text is on the bottom of the div element


How do I make so that the text is in the center of the div element something like this:
______________

This is my footer <-- The text is in the center of the div element
______________


Thank you.
Last Blog Entry: ASP Programming Tips and Technique (Oct 26th, 2007)

Last edited by Monie; Sep 11th, 2007 at 00:23.
Reply With Quote

  #2 (permalink)  
Old Sep 11th, 2007, 01:08
SuperMember

SuperMember
Join Date: Sep 2006
Location: Pink House
Posts: 3,946
Thanks: 0
Thanked 0 Times in 0 Posts
Re: Text position inside DIV element.

Here's a link to center things vertically with css. http://murphy.cz/victoria-s-vertical-centering/
Reply With Quote
  #3 (permalink)  
Old Sep 12th, 2007, 02:45
Most Reputable Member
Join Date: Feb 2004
Location: Borneo
Age: 27
Posts: 1,602
Blog Entries: 2
Thanks: 0
Thanked 4 Times in 3 Posts
Send a message via Yahoo to Monie
Re: Text position inside DIV element.

Thanks Lchad for that links.
I solved my problem already. Now I can move on...
Last Blog Entry: ASP Programming Tips and Technique (Oct 26th, 2007)
Reply With Quote
  #4 (permalink)  
Old Sep 12th, 2007, 12:15
karinne's Avatar
SuperMember

SuperMember
Join Date: Jan 2007
Location: You know where
Age: 31
Posts: 4,617
Thanks: 0
Thanked 0 Times in 0 Posts
Re: Text position inside DIV element.

Why not post the solution? It could help other members with the same problem.
Reply With Quote
  #5 (permalink)  
Old Sep 13th, 2007, 01:50
Most Reputable Member
Join Date: Feb 2004
Location: Borneo
Age: 27
Posts: 1,602
Blog Entries: 2
Thanks: 0
Thanked 4 Times in 3 Posts
Send a message via Yahoo to Monie
Re: Text position inside DIV element.

Quote:
Originally Posted by karinne View Post
Why not post the solution? It could help other members with the same problem.
Sorry about that,
Well it was actually my <h3> problem. I put my <h3> inside the footer div.
and I started to give padding, margin and bla..bla..bla.. to the div instead of the <h3>

After playing around with the code I've come up with this code that looks perfect inside Firefox and IE7:

Code: Select all
#footer {
    clear: both;
    margin: auto;
    Width: 872px; 
    Height: 36px;
    border-top: 1px dotted #99C;
}
#footer h3 {
    margin: 0;
    padding-top: 0.5em;
    padding-bottom: 0.5em;
    font: Small Verdana;
    font-size: 10px;
    text-align: center;
}
Last Blog Entry: ASP Programming Tips and Technique (Oct 26th, 2007)
Reply With Quote
  #6 (permalink)  
Old Sep 13th, 2007, 06:11
Most Reputable Member
Join Date: Feb 2004
Location: Borneo
Age: 27
Posts: 1,602
Blog Entries: 2
Thanks: 0
Thanked 4 Times in 3 Posts
Send a message via Yahoo to Monie
Re: Formatting ASP results using Float and CSS

I will make it my habbit from now on
Last Blog Entry: ASP Programming Tips and Technique (Oct 26th, 2007)
Reply With Quote
  #7 (permalink)  
Old Sep 13th, 2007, 13:14
SuperMember

SuperMember
Join Date: Sep 2006
Location: Pink House
Posts: 3,946
Thanks: 0
Thanked 0 Times in 0 Posts
Re: Text position inside DIV element.

Good job Monie!!
Reply With Quote
Reply

Tags
div

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
dynamic text field inside movieclip shan Flash & Multimedia Forum 0 May 1st, 2008 13:47
position of text within div tag Craigj1303 Web Page Design 4 Apr 24th, 2007 23:04
Picture wrap around text? (more info inside) KOinMotion Web Page Design 1 Nov 13th, 2006 09:59
text position bean_2k1 Web Page Design 2 May 13th, 2006 21:58
XHTML Block Element in an Inline Element gohankid77 Web Page Design 6 Jul 27th, 2004 10:15


All times are GMT. The time now is 04:12.


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