Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 3807174
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 19, 20262026-05-19T14:56:59+00:00 2026-05-19T14:56:59+00:00

I have some text in html. About 2 paragraphs. I want this to appear

  • 0

I have some text in html. About 2 paragraphs.

I want this to appear in the middle, I can do this using in html but I want it to be “in” on the sides, so it only fills the middle of the screen, away from the edges on the sides.

How to do this?

EDIT:
DESCRIPTION OF PAGE:

EMPTY SPACE |<——text here——>| EMPTY SPACE

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-19T14:57:00+00:00Added an answer on May 19, 2026 at 2:57 pm

    There are various different ways of centering text in a page. For now I will assume you mean horizontal centering.

    You haven’t provided any code for anyone to work with, so I will assume the code goes as follows:

    <html>
      <head>
        <title>Test Page</title>
      </head>
      <body>
        <p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Suspendisse cursus sapien vitae ipsum semper sagittis porta odio tempor. Pellentesque porta mattis porta. Cras in condimentum tellus. Nam porta sapien vel felis aliquam id aliquam neque condimentum.</p>
        <p>Mauris in tellus magna. Nam cursus dapibus diam, ut cursus risus placerat sed. Praesent volutpat elementum faucibus. Donec mi arcu, faucibus eget porta a, feugiat eu dui. Sed dapibus feugiat quam, vel venenatis neque venenatis ut. Ut condimentum tellus eget ipsum aliquam eu faucibus erat egestas. Pellentesque ut metus a elit suscipit vulputate id id magna. Praesent eu sem urna, eu fermentum enim.</p>
      </body>
    </html>
    

    To center the paragraph text in the middle of the page, you need to add the following CSS (in a style element or an external .css file): first example

    p
    {
      text-align: center;
    }
    

    This is probably not what you’re after because it wont push the text away from the edges. If you would like the text to have a fluid width with some padding, use this CSS instead: second example

    p
    {
      padding: 0 100px;
    }
    

    You can of course center the text using both methods to make the text centered and stay away from the edges.

    If you would like a static width that stays centered, use this CSS instead of the padding: third example

    p
    {
      margin: 0 auto;
      width: 300px;
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have this html file where I want to overlay some text over another.
I have some text that has HTML hyper-links in it. I want to remove
I have some html files that I want to convert to text. I have
I have some HTML like this: <input type=radio class=MyRadio name=TheName> <label for=TheLabel>the text</label> How
I have a question about how to present some structured data using HTML. I
I have found many questions and articles about this but i still have some
I have some code that removes HTML tags from text. I don't care about
I have a JeditorPane which has some text in HTML format. When I execute
On extracting some html from a web page, I have some elements containing text
I have a UIWebView containing html-formatted text. In the text some words are links.

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.