Pages: [1]
How do I...
  • haxer
  • Hero Member
  • *****
  • Karma: 60004
  • Offline Offline
  • Posts: 647
  •  
  • View Profile WWW
How do I...
« on: September 11, 2007, 11:55:45 PM »

Anyone here know how to center text properly using XHTML, or CSS with XHTML? I'm trying to do the whole website thing, and I want validated clean CSS and XHTML, without messy center tags that are apparently out dated, according to the w3 validation site. Thanks guys.
« Last Edit: September 12, 2007, 12:24:12 AM by haxer »
Logged

  • mickeblue
  • Sr. Member
  • ****
  • Karma: 60004
  • Offline Offline
  • Posts: 437
  •  
  • View Profile WWW
Re: How do I...
« Reply #1 on: September 12, 2007, 05:57:26 AM »

Not sure what you are wanting to do haxer, whether it is text or for including an image, but imagine this for a text sub-heading ~

CSS :
h2 {
text-align: center;
}


and as XHTML strict:
<h2 style="text-align: center">This is valid XHTML strict</h2>

If it is for an image, for CSS you should use the float property.

You should be able to find relevant code on the w3 pages ~ http://www.w3.org/Style/CSS/learning and you might also find this page useful ~ http://webdesign.about.com/od/htmltags/p/blatalign.htm
« Last Edit: September 12, 2007, 09:24:54 AM by mickeblue »
Logged

  • mrbiotech
  • Administrator
  • Hero Member
  • *****
  • Karma: 25
  • Offline Offline
  • Posts: 560
  •  
  • View Profile WWW
Re: How do I...
« Reply #2 on: September 12, 2007, 10:16:39 AM »

Mickeblue's got it right on the head Smiley

I'd like to add http://w3schools.com to the list as well.  This is pretty much how I learned all the technical stuff for web design.  Not only do they have the specs and reference material, but excellent examples.

For help with positioning and browser-specific bugs/hacks, I'd recommend http://www.positioniseverything.net/

As an aside: For another purpose (portfolio for an interested potential client) I've put up all my completed web-template projects in http://www.skinyourscreen.com/templates - the fun part for me was looking back on the original Skinyourscreen.com templates used in the past.  Perhaps I'll have to cycle 'em through again just for ol' times sake!
Logged

  • haxer
  • Hero Member
  • *****
  • Karma: 60004
  • Offline Offline
  • Posts: 647
  •  
  • View Profile WWW
Re: How do I...
« Reply #3 on: September 12, 2007, 10:33:57 AM »

Awesome, thanks a lot guys. I knew I could count on y'all. Smiley
Logged

  • haxer
  • Hero Member
  • *****
  • Karma: 60004
  • Offline Offline
  • Posts: 647
  •  
  • View Profile WWW
Re: How do I...
« Reply #4 on: September 12, 2007, 10:43:34 AM »

Not sure what you are wanting to do haxer, whether it is text or for including an image, but imagine this for a text sub-heading ~
Quote

Actually i was going for both. I'm used to the old school HTML, and just recently learned some XHTML.

Logged

Pages: [1]
Jump to: