语言

Menu
Sites
Language
How to center a text in a div tag

Hello everyone,

I am testing the Tizen UI builder tool, and I started with the creation of a new project:

In the example header, there a text that I managed to change it color and it style, but I failed to make it center: I tried the <center> tag and the "text-align:center" property in the CSS file (into the header tag) but in vain !!!

What's wrong?

Thank you in advance!

编辑者为: Brock Boland 17 3月, 2014 原因: Paragraph tags added automatically from tizen_format_fix module.

响应

8 回复
Lakshmi Grandhi
Hi, Try this code, its working
HelloWorld
Lakshmi Grandhi
copying html code here
  <div data-role="header" id="header1" data-position="fixed">
        <div style="text-align:center">HelloWorld</div>
      </div>
karray gargouri
it's not working :( even the text-align icons into the div properties view is disabled !!! I don't know what's wrong?
konduri sai swathi
Hi, Try the below code :
<div data-role="header" data-position="fixed">
			<center>Title</center>
</div>
Eugene B
tag is not supported in HTML5. It's not recommended to use on Tizen. Folowing code working perfectly for me:
test
If it's not working in your case - simply check computed styles in the web inspector
Eugene B
center tag is not supported in HTML5. It's not recommended to use on Tizen. Folowing code working perfectly for me:
        < div data-role="header" data-position="fixed" style="text-align: center" >
            	test
        < / div >
If it's not working in your case - simply check computed styles in the web inspector
karray gargouri
I'll try it, but as you can see in this picture: http://imageshack.us/f/24/gkw.png/ the text-align icons into the div properties view is disabled !!! I could change the color but why not the align?
karray gargouri
Another question: "What's the difference between page1.css and page1.managed.css ?" these two files are located into the page folder of the Tizen UI Builder Project.