251
readers helped!

This helped me

How to Center Web Page Content Using CSS

Do you want to center your website content to create equal sized borders to the left and right but want the text to remain left justified? Read on!

Method 1
Method 1 of 1:

Centering Web Page Content

  1. How.com.vn English: Step 1 Open Notepad or a comparable text editing application.
  2. How.com.vn English: Step 2 Create the basic...
    Create the basic HTML skeleton of the website.
  3. How.com.vn English: Step 3 Within the <head> </head> tags add the following style definition.
  4. How.com.vn English: Step 4 Inside the <body></body> tags add the following div tags.
  5. How.com.vn English: Step 5 Place any content for the site between the <div> </div> tags.
  6. How.com.vn English: Step 6 Finished product:
  7. How.com.vn English: Step 7 Save your file with the extension .htm or .html and you're all done.
    Advertisement

Community Q&A

Search
Add New Question
  • Question
    Can a .css file be saved as .css, or it should be saved as .html?
    How.com.vn English: Community Answer
    Community Answer
    A .css file should be saved as a .css file, with no exceptions.
  • Question
    Can a .css file be saved as .css, or it should be saved as .html? Actually you can add into the head of your HTML file and put your CSS there.
    How.com.vn English: AD Developers
    AD Developers
    Community Answer
    CSS files are different from HTML files. If you write your CSS code you should save it as CSS file with css as suffix. But if you write CSS code inside a HTML document you should save the document as HTML file with html or htm suffix. Just remember you can not include HTML tags or JavaScript tags in your CSS document.
  • Question
    How can someone create an image gallery?
    How.com.vn English: Free Eagle
    Free Eagle
    Community Answer
    1.) Log into your websites cPanel. 2.) Click on Softaculous Apps Installer. 3.) Click on Image Galleries 4.) Choose a gallery to host your images. 5.) You will then be able to upload pictures to your gallery, and link to the gallery from your website. You will receive detail instructions with each gallery.
See more answers
Ask a Question
200 characters left
Include your email address to get a message when this question is answered.
Submit

      Advertisement

      Video

      Tips

      • You can add background-color: color; to the body and centered style codes. If you use different colors for each you can create colored borders on the left and right.
      • Play with the width until you reach the desired look.
      Advertisement

      About this article

      How.com.vn is a “wiki,” similar to Wikipedia, which means that many of our articles are co-written by multiple authors. To create this article, 21 people, some anonymous, worked to edit and improve it over time. This article has been viewed 227,097 times.
      How helpful is this?
      Co-authors: 21
      Updated: June 10, 2022
      Views: 227,097
      Thanks to all authors for creating a page that has been read 227,097 times.

      Is this article up to date?

      ⚠️ Disclaimer:

      Content from Wiki How English language website. Text is available under the Creative Commons Attribution-Share Alike License; additional terms may apply.
      Wiki How does not encourage the violation of any laws, and cannot be responsible for any violations of such laws, should you link to this domain, or use, reproduce, or republish the information contained herein.

      Notices:
      • - A few of these subjects are frequently censored by educational, governmental, corporate, parental and other filtering schemes.
      • - Some articles may contain names, images, artworks or descriptions of events that some cultures restrict access to
      • - Please note: Wiki How does not give you opinion about the law, or advice about medical. If you need specific advice (for example, medical, legal, financial or risk management), please seek a professional who is licensed or knowledgeable in that area.
      • - Readers should not judge the importance of topics based on their coverage on Wiki How, nor think a topic is important just because it is the subject of a Wiki article.

      Advertisement