Questions tagged [text-align]

a property of CSS which determines the alignment of the text

The text-align property, as defined in CSS, can have one of the five values: left, right, center, justify and inherit.

The default value depends on the used locale and is left for languages in which text is written from left to right and right for languages in which text is written from right to left.

509 questions
7
votes
3 answers

text-align: right on a span inside li tag

my structure looks like this:
7
votes
3 answers

Can i use text-align inside div by pixel?

Is there any way that i can align the text inside a div but without using text-align. I dont want to align it to a specific position(center,left etc) but i want to align it where ever i want by pixel.For example between the values center and left.…
laaposto
  • 10,927
  • 15
  • 49
  • 67
6
votes
6 answers

Text Centering Using CSS not working in IE

I am having problems getting text within a table to appear centered in IE. In Firefox 2, 3 and Safari everything work fine, but for some reason, the text doesn't appear centered in IE 6 or 7. I'm using: h2 { font: 300 12px "Helvetica", serif; …
Shady Studios
  • 63
  • 1
  • 2
  • 4
6
votes
2 answers

IE7 text-align not working

I have a simple horizontal UL LI main nav which I am trying to align to the center of the page. Text-align, which works in the other browsers is working but this does not work in IE7. Is there something I am missing about this bug in IE7? Thanks!
Sixfoot Studio
  • 2,743
  • 7
  • 24
  • 35
6
votes
1 answer

Bootstrap max-width columns responsive

I am trying to code a section of a one-page responsive Bootstrap design that has two side-by-side columns of text. The designer wants these two columns to have a max-width, but once it reaches its max, it is no longer centered (as the rest of the…
user3389584
  • 105
  • 1
  • 2
  • 7
6
votes
2 answers

Strange behaviour when using text-align justify/text-justify and right

I ran into one IE-specific problem that I just can't wrap my head around. The following HTML and CSS can be seen live in this pen. :: HTML
Dummy
5
votes
5 answers

How can I use text-align-last except when I have only one line of text?

I would like to align text to the center, but last line to the left: section { text-align: center; text-align-last: left; } It works well, but what if there is only one line? In this case, I would like to align text to the center, which…
Vesmy
  • 842
  • 2
  • 10
  • 23
5
votes
0 answers

Why do horizontal and vertical alignment use different terms for centering (center vs middle)?

text-align has center as possible value and vertical-align has middle as possible value. As far as I know center and middle have no different meaning. So why there is a different term for the same thing? Maybe someone here can tell me the reason of…
5
votes
3 answers

Jekyll kramdown how to center text

I am using Jekyll (kramdown), and want to make some text align center. I found works for font color and size, but not work for text-align. How can I align some text. I have tried:
vancexu
  • 1,348
  • 3
  • 17
  • 26
5
votes
1 answer

Aligning Text with a ContentControl using the HorizontalContentAlignment property

I am attempting to apply a "text alignment" to a ContentControl. Since the ContentControl does not have a horizontal or vertical text alignment property like the TextBlock, I am attempting to use the ContentControl's HorizontalContentAlignment…
Frinavale
  • 3,666
  • 7
  • 40
  • 71
5
votes
1 answer

DOM Equidistant divs with inline-blocks and text justify won't work when inserting through JS

I have been trying to implement Chris Coyier's inline-block + text justify solution to automatically distribute div's horizontally in a given wrapper's width. http://css-tricks.com/equidistant-objects-with-css/ This works great when the elements are…
Rodrigo Neves
  • 210
  • 1
  • 12
5
votes
5 answers

CSS making text align left and justify at same time

Is there any way to make the text align left and justify as same time? Mean something like left-justify. Is there any way to achieve this? Thanks for help.
Anees Ahmad
  • 111
  • 1
  • 1
  • 5
4
votes
2 answers

Text-align is not working on a img tag

Take a look at my fiddle: http://jsfiddle.net/jVsQY/ As you can see, I'm using text-align: center on a image tag, with a class and it doesn't show any results. I was trying using an display: inline-block and so, but did not helped.
Cyclone
  • 13,241
  • 22
  • 76
  • 112
4
votes
2 answers

html5 or css 'smart text flow' to evenly distribute a sentence or paragraph over equally wide lines?

Suppose I have a dynamic HTML element (a span or div or whatever) with a sentence or paragraph of text inside, like this: Now if I make the sentence slightly longer, it might need an extra line, like this: Note how the last word is on a separate…
RocketNuts
  • 7,383
  • 6
  • 29
  • 64
4
votes
4 answers

CSS text-align delay with width animation

I am trying to animate my text to appear from left to right on page load. This is done by simply setting @keyframes to transition from 0% max-width to 100%. However my text-align settings seem to be applied only after the animation is complete. I…
J Lou
  • 45
  • 4
1 2
3
33 34