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
4
votes
0 answers

Text-Overflow: Ellipsis Not Working with Text-Align: Center in Chrome/Safari?

Why would text-overflow: ellipsis horizontally align differently in Firefox than in Chrome and Safari? Here are some images that show what I am referring to: How I would like it to display (Firefox): text-overflow: ellipsis with text-align: center…
nr159
  • 171
  • 12
4
votes
2 answers

Input - text-align:right - fill input with jQuery

I tried searching for a relevant question but I couldn't find one. I have a simple input field with a text-align:right. #screen { width: 100%; font-size: 2em; padding: 0 0.5em 0 0.5em; border: solid…
4
votes
1 answer

Text-align text 45 degrees

I would like to achieve text-alignment effect like on the screen above. Any suggestions?
Łukasz Ro
  • 85
  • 7
4
votes
3 answers

text-align right in small width div

I'm trying to align text to the right in a small area. It becomes left align when the container is small. Is there anyway to force it right align? div { float: right; width: 100px; height: 50px; text-align: right; border: thin solid…
echo
  • 89
  • 5
4
votes
1 answer

text-align:center works in chrome, doesn't work in safari

This is how I use it. HTML

text

CSS h1 { text-align: center; } In Chrome everything works good, but aligned to the left in Safari. why that happens in Safari?
Borys
  • 49
  • 1
  • 2
4
votes
1 answer

Align left dl-horizontal, dt, and dd

I am working inside a panel and am not able to left align or remove the margins for a horizontal list in Bootstrap. i.e.

4
votes
3 answers

text-align not working on chrome

I'm having some wierd css issue making a website for a client which only occur if using google chrome. on firefox, explorer and edge, it does work fine. Basicly, some code I used several times in the same page, works everytime except for one. I…
Stefano
  • 47
  • 1
  • 6
4
votes
3 answers

Align text right Html Ionic

I'm trying to align text in Html but it doesn't work and I do not know why. I'm using Ionic Framework. My code is: Name

{{paciente.name}}

....
and it looks…
Nestoraj
  • 582
  • 1
  • 4
  • 18
4
votes
1 answer

In HTML, can you shrink a paragraph to make sentences have the same width?

I want to display a short text-align-centered sentence like this.

This is a variable-length sentence which is sometimes only a few words and sometimes up to three lines long.

This…
Hildo Bijl
  • 63
  • 1
  • 4
4
votes
2 answers

How to extend text as wide as its container?

I have a div with a few words of text in it, which I want to extend as far as the div itself. In other words, the word-spacing should automatically stretch until the last word reaches the edge of the div. By reading about text-align: justify, I…
Joe Morano
  • 1,055
  • 7
  • 41
  • 95
4
votes
4 answers

CSS replacement for text-align in percentage

Sticky speaking here's the question itself: Is there any property in CSS3 that alows to place some elements like

or any of like text-align but in percentage. For instance HTML code:

Here's first P

Here's…

pewstiepoll
  • 506
  • 7
  • 21
4
votes
3 answers

Unable to center the text in TextView when width is set to 'match_parent'

I am relatively new to the Android SDK and am working with a TextView amongst other components on my activity UI. When I set the width to wrap_content and use layout_gravity, I am able to center the TextView in my parent container. However, I now…
Darth Coder
  • 1,518
  • 6
  • 30
  • 54
4
votes
3 answers

Align text to the left and right on the same line with CSS

I am working on my about page and having trouble with this. Trying to align the (years or pending) to the right side of the column. See image for example. Top is how it looks now. Bottom image is how I want it to look. Site is located at…
user3808918
  • 41
  • 1
  • 1
  • 5
4
votes
2 answers

Center inline-blocks keeping text-align left

I have a group of items. Is it possible to center the whole group but make sure items on new lines appear on the left and not the center? Here is the example: http://codepen.io/anon/pen/yczku/ And this is what I need:…
Karlis Bikis
  • 53
  • 1
  • 4
4
votes
1 answer

text-align right and padding right

I've seen this posted everywhere, with no real help, or it being closed for no reason other then moderators feeling it would be 'unhelpful' in the future even though google whips up a nice result summing some 55,000+ relevant results. So, why won't…
WASasquatch
  • 994
  • 3
  • 8
  • 19