How to use style=“text-align:center;” on the ordinary text?
up vote
0
down vote
favorite
For now I have used <h1></h1>
What to do if I want to center the text without using the header?
html html5
add a comment |
up vote
0
down vote
favorite
For now I have used <h1></h1>
What to do if I want to center the text without using the header?
html html5
add a comment |
up vote
0
down vote
favorite
up vote
0
down vote
favorite
For now I have used <h1></h1>
What to do if I want to center the text without using the header?
html html5
For now I have used <h1></h1>
What to do if I want to center the text without using the header?
html html5
html html5
asked Nov 7 at 20:33
Mr Korni
214
214
add a comment |
add a comment |
2 Answers
2
active
oldest
votes
up vote
1
down vote
h1{
text-align: center;
}
p{
text-align: left;
}<h1>My Text<h1/>
<p>some other text</p>You should start using css to code everything about the html properties, not inside the html code
add a comment |
up vote
1
down vote
Text -- regular paragraphs of text -- should be wrapped in paragraph tags (<p></p>). You can then center all p tags (or just the one you're targetting).
p {
text-align: center;
}<h1>I am a heading</h1>
<p>I am regular text</p>Alternatively, if you want to center everything, you can style the <body> tag.
body {
text-align: center;
}<h1>I am a header</h1>
<h2>I am a subheader</h2>
I am unwrapped text.
<p>I am text in a paragraph tag.</p>Note that putting the style on the body will center everything.
(Some browsers will implicitly wrap your regular text in <p> tags if you don't, but it's much better practice for you to do it yourself.)
add a comment |
2 Answers
2
active
oldest
votes
2 Answers
2
active
oldest
votes
active
oldest
votes
active
oldest
votes
up vote
1
down vote
h1{
text-align: center;
}
p{
text-align: left;
}<h1>My Text<h1/>
<p>some other text</p>You should start using css to code everything about the html properties, not inside the html code
add a comment |
up vote
1
down vote
h1{
text-align: center;
}
p{
text-align: left;
}<h1>My Text<h1/>
<p>some other text</p>You should start using css to code everything about the html properties, not inside the html code
add a comment |
up vote
1
down vote
up vote
1
down vote
h1{
text-align: center;
}
p{
text-align: left;
}<h1>My Text<h1/>
<p>some other text</p>You should start using css to code everything about the html properties, not inside the html code
h1{
text-align: center;
}
p{
text-align: left;
}<h1>My Text<h1/>
<p>some other text</p>You should start using css to code everything about the html properties, not inside the html code
h1{
text-align: center;
}
p{
text-align: left;
}<h1>My Text<h1/>
<p>some other text</p>h1{
text-align: center;
}
p{
text-align: left;
}<h1>My Text<h1/>
<p>some other text</p>answered Nov 7 at 20:35
Jose Manuel Zuñiga Moreno
207
207
add a comment |
add a comment |
up vote
1
down vote
Text -- regular paragraphs of text -- should be wrapped in paragraph tags (<p></p>). You can then center all p tags (or just the one you're targetting).
p {
text-align: center;
}<h1>I am a heading</h1>
<p>I am regular text</p>Alternatively, if you want to center everything, you can style the <body> tag.
body {
text-align: center;
}<h1>I am a header</h1>
<h2>I am a subheader</h2>
I am unwrapped text.
<p>I am text in a paragraph tag.</p>Note that putting the style on the body will center everything.
(Some browsers will implicitly wrap your regular text in <p> tags if you don't, but it's much better practice for you to do it yourself.)
add a comment |
up vote
1
down vote
Text -- regular paragraphs of text -- should be wrapped in paragraph tags (<p></p>). You can then center all p tags (or just the one you're targetting).
p {
text-align: center;
}<h1>I am a heading</h1>
<p>I am regular text</p>Alternatively, if you want to center everything, you can style the <body> tag.
body {
text-align: center;
}<h1>I am a header</h1>
<h2>I am a subheader</h2>
I am unwrapped text.
<p>I am text in a paragraph tag.</p>Note that putting the style on the body will center everything.
(Some browsers will implicitly wrap your regular text in <p> tags if you don't, but it's much better practice for you to do it yourself.)
add a comment |
up vote
1
down vote
up vote
1
down vote
Text -- regular paragraphs of text -- should be wrapped in paragraph tags (<p></p>). You can then center all p tags (or just the one you're targetting).
p {
text-align: center;
}<h1>I am a heading</h1>
<p>I am regular text</p>Alternatively, if you want to center everything, you can style the <body> tag.
body {
text-align: center;
}<h1>I am a header</h1>
<h2>I am a subheader</h2>
I am unwrapped text.
<p>I am text in a paragraph tag.</p>Note that putting the style on the body will center everything.
(Some browsers will implicitly wrap your regular text in <p> tags if you don't, but it's much better practice for you to do it yourself.)
Text -- regular paragraphs of text -- should be wrapped in paragraph tags (<p></p>). You can then center all p tags (or just the one you're targetting).
p {
text-align: center;
}<h1>I am a heading</h1>
<p>I am regular text</p>Alternatively, if you want to center everything, you can style the <body> tag.
body {
text-align: center;
}<h1>I am a header</h1>
<h2>I am a subheader</h2>
I am unwrapped text.
<p>I am text in a paragraph tag.</p>Note that putting the style on the body will center everything.
(Some browsers will implicitly wrap your regular text in <p> tags if you don't, but it's much better practice for you to do it yourself.)
p {
text-align: center;
}<h1>I am a heading</h1>
<p>I am regular text</p>p {
text-align: center;
}<h1>I am a heading</h1>
<p>I am regular text</p>body {
text-align: center;
}<h1>I am a header</h1>
<h2>I am a subheader</h2>
I am unwrapped text.
<p>I am text in a paragraph tag.</p>body {
text-align: center;
}<h1>I am a header</h1>
<h2>I am a subheader</h2>
I am unwrapped text.
<p>I am text in a paragraph tag.</p>answered Nov 7 at 20:37
Roddy of the Frozen Peas
6,97482558
6,97482558
add a comment |
add a comment |
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53197385%2fhow-to-use-style-text-aligncenter-on-the-ordinary-text%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown