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.

586 questions
23
votes
3 answers

CSS text-align not working

I have this css code here .navigation{ width:100%; background-color:#7a7a7a; font-size:18px; } .navigation ul { list-style-type: none; margin: 0; } .navigation li { float: left; } .navigation ul a { color: #ffffff; …
user1269625
  • 3,121
  • 26
  • 79
  • 111
21
votes
4 answers

The "text-align: center" isn't working in a span element

I haven't done HTML and CSS for a while so I may be forgetting something, but for some reason a "style" tag with the "text-align" property set isn't working even in the simplest context. I'm about to show you the whole, entire file that I have but…
KarteMushroomPandas
  • 382
  • 2
  • 5
  • 16
18
votes
5 answers

text-align: center not working

I have tried searching for answers but nothing worked. I am trying to align a paragraph. I am pretty sure nothing is overwriting code in CSS. Here is the HTML and CSS: body { background-image: url("../../images/pic01.jpg"); …
Nedas Bolevičius
  • 311
  • 1
  • 2
  • 10
16
votes
9 answers

Margin: Auto not working in IE

URL: http://cyberbat.co.uk/test container margin: auto is not working, is there any other way to put it in the middle in IE. EDIT: Check it again, the index.php was the wrong file, I replaced it with index.html .
Lewes
  • 317
  • 1
  • 2
  • 9
13
votes
3 answers

Can I use CSS to justify text with hyphenating words at the end of a line?

I have a div that is too narrow to text-align:justify (gaps too wide), but yet looks un-uniform when right- or left-justified, because then there is a large gap at the end of lines. Left-justified looks best, but could I use hyphenation, like in…
user1158415
12
votes
2 answers

How to make single-line text center align while multi-line left align?

I am using below css to align text middle and left when multi-line, but how to align text middle and center when one line? .my-text { border: 1px solid black; width: 400px; height: 160px; vertical-align: middle; display:…
licaomeng
  • 919
  • 2
  • 13
  • 27
10
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,548
  • 3
  • 19
  • 30
10
votes
3 answers

Text vertical align inside an anchor () tag

Sample demo: JSFiddle

Tell Me More   

As you can see in my JSFiddle, the text Tell Me More is not vertically center aligned. How can I do that?
rayncorg
  • 963
  • 4
  • 16
  • 33
10
votes
1 answer

text-align:center not working with div elements

I've been searching for about 45 minutes and couldn't find a solution for my issue here. I want my gallery class divs (these will get created dynamically) to align them selves in the center of the gallery_container div using only css rules. I'm…
Doctor Parameter
  • 1,202
  • 2
  • 15
  • 21
10
votes
3 answers

Text Align column in Listview: first column cannot be centered

I have a Listview in detail mode with 3 columns. I want to set the text align for the headers to "center". This works for the last two columns but not for the first. If I want to change it to "center" and click on "center", the field keeps being set…
benst
  • 553
  • 2
  • 12
  • 32
9
votes
2 answers

set the text direction in WebView to RTL

how can I change text direction to the Right to Left in webview ? This is my code WebView web = (WebView) findViewById(R.id.web); web.getSettings().setJavaScriptEnabled(true); web.loadDataWithBaseURL("", myhtml, "text/html", "UTF-8", "");
user3453159
  • 151
  • 1
  • 3
  • 13
9
votes
1 answer

Why "text-align: right" doesn't work on empty contenteditable element in Firefox?

Consider the following: (Live Demo) HTML:
CSS: div { text-align: right; } When you click the div in Firefox, the cursor is located at the left (looks like text-align: right; has no effect). But, if you start typing,…
Misha Moroshko
  • 166,356
  • 226
  • 505
  • 746
8
votes
1 answer

Display: table and text-align right not working

I've got a html-structure like this:
OptimusCrime
  • 14,662
  • 13
  • 58
  • 96
8
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
  • 9,958
  • 11
  • 47
  • 88
8
votes
1 answer

Safari 10.1 – text-align: justify text goes outside the border in RTL languages

I have HTML markup with a text paragraph in the body element. In the CSS stylesheet, I added: body { text-align: justify; color: black; background-color: white; font-size: 23; letter-spacing:0.05pt; line-height: 125%; font-size:…
Ido Meirov
  • 81
  • 4
1
2
3
39 40