LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices


Reply
  Search this Thread
Old 06-24-2012, 08:22 AM   #1
Mr. Alex
Senior Member
 
Registered: May 2010
Distribution: No more Linux. Done with it.
Posts: 1,238

Rep: Reputation: Disabled
Question Question about centering text vertically in a line


Hi. How to center text vertically in this header? I don't want to make it in a <div>.
Code:
<h6 style="height:100px; text-align:center; background:black; color:white;">Text.</h6>
 
Old 06-24-2012, 09:33 AM   #2
pixellany
LQ Veteran
 
Registered: Nov 2005
Location: Annapolis, MD
Distribution: Mint
Posts: 17,809

Rep: Reputation: 743Reputation: 743Reputation: 743Reputation: 743Reputation: 743Reputation: 743Reputation: 743
Take a look here:
http://www.w3schools.com/css/css_text.asp

This is for CSS, but I think anything in CSS can also be put into inline styles. In particular, look at "line-height" and "vertical-align"
 
1 members found this post helpful.
Old 06-24-2012, 10:49 AM   #3
Mr. Alex
Senior Member
 
Registered: May 2010
Distribution: No more Linux. Done with it.
Posts: 1,238

Original Poster
Rep: Reputation: Disabled
Thanks! line-height makes text centered automatically.
 
  


Reply

Tags
center, css, header



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 Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Sed append text to end of line if line contains specific text? How can this be done? helptonewbie Linux - Newbie 4 10-23-2013 01:48 PM
[SOLVED] centering text in a table cell and using transform:rotate at the same time. Dafydd Programming 2 05-04-2012 10:21 PM
Perl question: delete line from text file with duplicate match at beginning of line mrealty Programming 7 04-01-2009 06:46 PM
How do i enter text as background vertically in Openoffice 2.0 Ubuntu avinash.rao Ubuntu 3 08-08-2008 10:51 AM
Centering text on an image using ImageMagick barisdemiray Linux - Software 2 09-20-2004 11:07 AM

LinuxQuestions.org > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 02:52 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration