Visit Jeremy's Blog.
Go Back > Forums > Non-*NIX Forums > Programming
User Name
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.


  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>.
<h6 style="height:100px; text-align:center; background:black; color:white;">Text.</h6>
Old 06-24-2012, 09:33 AM   #2
LQ Veteran
Registered: Nov 2005
Location: Annapolis, MD
Distribution: Arch/XFCE
Posts: 17,802

Rep: Reputation: 738Reputation: 738Reputation: 738Reputation: 738Reputation: 738Reputation: 738Reputation: 738
Take a look here:

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.


center, css, header

Thread Tools Search this Thread
Search this Thread:

Advanced Search

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 > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 09:14 AM.

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