logo-dw

Go Back   Dreamweaver Club Forums > Hand Coders Forum > HTML and CSS
Register FAQ Members List Search Today's Posts Mark Forums Read

Reply
 
Thread Tools Display Modes
Old 08-09-2011, 12:24 PM   #1
JBD
 
Join Date: Feb 2007
Location: Bristol, UK
Posts: 178
Default centre aligning H tag within a div

What's the correct way to centre align a h tag within a div?

My code:

Code:
h3 {
    font-size: 13px;
    font-weight: bold;
    font-style:italic;
    color: #333333;
}

#SVquote {
width: 576px;
float: left;
display:inline;
margin:auto;
padding: 10px;
border: 0px;
clear:both;
}

<div id="SVquote">
  <h3 align="centre">A diverse range of vintage industrial furniture suitable for home and business</h3>
  </div>
I can't seem to centre align the text within the containing div
JBD is offline   Reply With Quote
Old 08-09-2011, 02:58 PM   #2
Corrosive
Corrosive's Avatar
 
Join Date: Feb 2008
Location: Bristol, England
Posts: 7,103
Default

I believe the display inline is the issue. It needs to be block (natural) to align text inside. Try losing that and then adding text-align: center; to the div styles and see what that does.
Corrosive is offline   Reply With Quote
Old 08-09-2011, 03:10 PM   #3
JBD
 
Join Date: Feb 2007
Location: Bristol, UK
Posts: 178
Default

This is what I have now but it still doesn't seem to work?

Code:
h3 {
    font-size: 13px;
    font-weight: bold;
    font-style:italic;
    color: #333333;
    text-align:centre;
}
#SVquote {
width: 576px;
float: left;
display:block;
margin:auto;
padding: 10px;
border: 0px;
clear:both;
}

<div id="SVquote">
  <h3>A diverse range of vintage industrial furniture suitable for home and business</h3>
  </div>
JBD is offline   Reply With Quote
Old 08-09-2011, 03:35 PM   #4
domedia
Administrator
domedia's Avatar
 
Join Date: Dec 2003
Posts: 9,730
Default

'center' not 'centre'
domedia is offline   Reply With Quote
Old 08-09-2011, 03:41 PM   #5
JBD
 
Join Date: Feb 2007
Location: Bristol, UK
Posts: 178
Default

lol I need to remember to use American English! cheers
JBD is offline   Reply With Quote
Old 08-09-2011, 03:53 PM   #6
Corrosive
Corrosive's Avatar
 
Join Date: Feb 2008
Location: Bristol, England
Posts: 7,103
Default

Quote:
Originally Posted by JBD View Post
lol I need to remember to use American English! cheers
I find myself spelling colour without a 'u' a lot now *shudder*.
Corrosive is offline   Reply With Quote
Old 08-16-2011, 12:59 AM   #7
edbr
edbr's Avatar
 
Join Date: Aug 2005
Location: Bali
Posts: 11,164
Default

don't get me started!
__________________
If you're happy and you know it shake your meds!
different style links examples

Flight / Hotel search
Free script download
Bali Villas
edbr is offline   Reply With Quote
Reply


Thread Tools
Display Modes

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

Forum Jump


All times are GMT. The time now is 09:52 AM.


Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2017, vBulletin Solutions, Inc.
Copyright 2006 DreamweaverClub.com