Wrox Programmer Forums
|
BOOK: Beginning HTML and CSS (published March 2013)
This is the forum to discuss the Wrox book Beginning HTML and CSS by Rob Larsen; ISBN: 978-1-1183-4018-9
Welcome to the p2p.wrox.com Forums.

You are currently viewing the BOOK: Beginning HTML and CSS (published March 2013) section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old July 24th, 2013, 04:54 PM
Registered User
 
Join Date: Jul 2013
Posts: 5
Thanks: 1
Thanked 0 Times in 0 Posts
Default CSS question, need to center a header.

I have inherited a "free" webpage and am trying to get it ready to upload to a paid hosting service after registering its name. At the moment I am trying to center our name and city and have tried to specify text-align: center in the h1 and h3 in the css (replacing "start") as well as within those areas of the HTML code.

Most of what I've done on hobby webpages has been in HTML and JavaScript with very little CSS. I need to be able to learn how to track down problems like this.

My (testing) webpage is MCO and my other stuff is on the same site, just take out "MCO".

Thanks in advance.
 
Old July 24th, 2013, 05:52 PM
Wrox Author
 
Join Date: Apr 2012
Posts: 19
Thanks: 0
Thanked 3 Times in 3 Posts
Default

The element you're looking at, the H3 in the header, is set to display:inline that's why it won't center. If you take display:inline off of that element it will center. The problem then is to put the black background back on in order to have the background collapse to the width of the text. You can do that with a span surrounding the text inside the h3. Apply the background to that and it will collapse to the width of the text just like it's doing now.
The Following User Says Thank You to roblarsen For This Useful Post:
wbport (July 25th, 2013)
 
Old July 24th, 2013, 08:05 PM
Registered User
 
Join Date: Jul 2013
Posts: 5
Thanks: 1
Thanked 0 Times in 0 Posts
Default

Many thanks! That's enough to start getting my feet wet in this area.
 
Old July 25th, 2013, 01:12 AM
Authorized User
 
Join Date: Jun 2013
Posts: 14
Thanks: 0
Thanked 0 Times in 0 Posts
Default

I have a question what is required to insert a whole page into the the browser..What are your opinions about it.
__________________
REI Coupon
 
Old July 25th, 2013, 06:53 AM
Registered User
 
Join Date: Jul 2013
Posts: 5
Thanks: 1
Thanked 0 Times in 0 Posts
Default

Starting from where? Do you mean a pop up window? Child window? Or just let your browser open an .html file on your computer?
 
Old July 26th, 2013, 10:31 AM
Wrox Author
 
Join Date: Apr 2012
Posts: 19
Thanks: 0
Thanked 3 Times in 3 Posts
Default

I'm not sure what you're asking about. If you could describe it in more detail I'm sure I'll have an opinion.





Similar Threads
Thread Thread Starter Forum Replies Last Post
Rookie question: center webpage on screen mike123abc HTML Code Clinic 2 February 13th, 2012 05:41 AM
Formatting CSS to center Monochrome CSS SamuelMSr BOOK: Beginning ASP.NET 4 : in C# and VB 2 September 20th, 2011 03:50 AM
How to center the header image kherrerab BOOK: ASP.NET 2.0 Website Programming Problem Design Solution ISBN: 978-0-7645-8464-0 2 May 29th, 2010 11:51 PM
Pure CSS Scrollable Table with Fixed Header rupen CSS Cascading Style Sheets 4 June 4th, 2007 08:30 PM
align="center" in CSS crmpicco CSS Cascading Style Sheets 5 February 21st, 2006 09:31 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.